lib/embulk/output/bigquery.rb in embulk-output-bigquery-0.4.8 vs lib/embulk/output/bigquery.rb in embulk-output-bigquery-0.4.9
- old
+ new
@@ -370,10 +370,10 @@
else
if !paths.empty?
target_table = task['temp_table'] ? task['temp_table'] : task['table']
if bucket = task['gcs_bucket']
gcs = GcsClient.new(task)
- gcs.insert_bucket(bucket) if task['auto_create_gcs_bucket']
+ gcs.insert_temporary_bucket(bucket) if task['auto_create_gcs_bucket']
objects = paths.size.times.map { SecureRandom.uuid.to_s }
gcs.insert_objects(paths, objects: objects, bucket: bucket)
object_uris = objects.map {|object| URI.join("gs://#{bucket}", object).to_s }
responses = bigquery.load_from_gcs(object_uris, target_table)
objects.each {|object| gcs.delete_object(object, bucket: bucket) }