Skip to content

Remove duplicate :bigint entry and return nil for NULL Hive values #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rbhive/t_c_l_i_schema_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class TCLISchemaDefinition
TYPES = {
:boolean => :to_s,
:string => :to_s,
:bigint => :to_i,
:float => :to_f,
:double => :to_f,
:int => :to_i,
Expand Down Expand Up @@ -67,6 +66,7 @@ def coerce_row(row)

def coerce_column(column_name, value)
type = column_type_map[column_name]
return nil if value.nil?
return INFINITY if (type != :string && value == "Infinity")
return NAN if (type != :string && value == "NaN")
return coerce_complex_value(value) if type.to_s =~ /^array/
Expand Down