lib/fluent/plugin/out_bigquery_base.rb in fluent-plugin-bigquery-2.3.0 vs lib/fluent/plugin/out_bigquery_base.rb in fluent-plugin-bigquery-3.0.0

- old
+ new

@@ -129,11 +129,11 @@ def multi_workers_ready? true end def writer - @writer ||= Fluent::BigQuery::Writer.new(@log, @auth_method, { + @writer ||= Fluent::BigQuery::Writer.new(@log, @auth_method, private_key_path: @private_key_path, private_key_passphrase: @private_key_passphrase, email: @email, json_key: @json_key, location: @location, source_format: @source_format, @@ -148,13 +148,18 @@ time_partitioning_expiration: @time_partitioning_expiration, require_partition_filter: @require_partition_filter, clustering_fields: @clustering_fields, timeout_sec: @request_timeout_sec, open_timeout_sec: @request_open_timeout_sec, - }) + ) end def format(tag, time, record) + if record.nil? + log.warn("nil record detected. corrupted chunks? tag=#{tag}, time=#{time}") + return + end + record = inject_values_to_record(tag, time, record) meta = metadata(tag, time, record) schema = if @fetch_schema