Skip to content
Open
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
3 changes: 2 additions & 1 deletion lib/rbhive/t_c_l_i_schema_definition.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'json'
require File.join(File.dirname(__FILE__), *%w[.. thrift t_c_l_i_service_constants])

module RBHive
class TCLISchemaDefinition
Expand Down Expand Up @@ -52,7 +53,7 @@ def column_type_map
@column_type_map ||= column_names.inject({}) do |hsh, c|
definition = @schema.columns.find {|s| s.columnName.to_sym == c }
# If the column isn't in the schema (eg partitions in SELECT * queries) assume they are strings
type = TYPE_NAMES[definition.typeDesc.types.first.primitiveEntry.type].downcase rescue nil
type = Hive2::Thrift::TYPE_NAMES[definition.typeDesc.types.first.primitiveEntry.type].downcase rescue nil
hsh[c] = definition && type ? type.to_sym : :string
hsh
end
Expand Down