Skip to content

Commit

Permalink
fix: timezone setting for TIME type
Browse files Browse the repository at this point in the history
  • Loading branch information
p-eye committed Jul 25, 2024
1 parent 8eaab04 commit 8fd7b4e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/embulk/output/bigquery/value_converter_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,19 @@ def string_converter
}
end
when 'TIME'
Proc.new {|val|
next nil if val.nil?
with_typecast_error(val) do |val|
if @timestamp_format
Proc.new {|val|
next nil if val.nil?
with_typecast_error(val) do |val|
Time.strptime(val, @timestamp_format).strftime("%H:%M:%S.%6N")
end
}
else
Proc.new {|val|
next nil if val.nil?
Time.parse(val).strftime("%H:%M:%S.%6N")
end
}
}
end
when 'RECORD'
Proc.new {|val|
next nil if val.nil?
Expand Down

0 comments on commit 8fd7b4e

Please sign in to comment.