We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e229410 + 21109bd commit 33061c9Copy full SHA for 33061c9
lib/embulk/input/bigquery.rb
@@ -50,6 +50,7 @@ def self.transaction(config, &control)
50
def run
51
bq = Google::Cloud::Bigquery.new(project: @task[:project], keyfile: @task[:keyfile])
52
params = @task[:params]
53
+ @task[:columns] = values_to_sym(@task[:columns], 'name')
54
option = keys_to_sym(@task[:option])
55
rows = bq.query(@task[:sql], **option)
56
rows.each do |row|
@@ -68,7 +69,13 @@ def run
68
69
return {}
70
end
71
- def keys_to_sym(hash)
72
+ def values_to_sym(hashs, key)
73
+ hashs.map do |h|
74
+ h[key] = h[key].to_sym
75
+ h
76
+ end
77
+
78
+ def keys_to_sym(hash)
79
ret = {}
80
hash.each do |key, value|
81
ret[key.to_sym] = value
0 commit comments