lib/embulk/input/zendesk/plugin.rb in embulk-input-zendesk-0.1.9 vs lib/embulk/input/zendesk/plugin.rb in embulk-input-zendesk-0.1.10
- old
+ new
@@ -55,9 +55,14 @@
# https://github.com/embulk/embulk/issues/379
# This is workaround for that
if records.any? {|r| [Array, Hash].include?(r[hash[:name]].class) }
hash[:type] = :json
end
+ if hash[:name].match(/_id$/)
+ # NOTE: sometimes *_id will be guessed as timestamp format:%d%m%Y (e.g. 21031998), all *_id columns should be type:long
+ hash[:type] = :long
+ hash.delete(:format) # has it if type:timestamp
+ end
hash
end
task[:includes].each do |ent|