Skip to content

Commit

Permalink
Merge pull request #34 from rafalcymerys/support_for_other_storage_fo…
Browse files Browse the repository at this point in the history
…rmats

Added support for other storage formats
  • Loading branch information
robertino committed Oct 16, 2015
2 parents 3e38dae + efbcc0a commit 8d4fdad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/rbhive/table_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def initialize(name, comment=nil, options={}, &blk)
@field_sep = options[:field_sep] || "\t"
@line_sep = options[:line_sep] || "\n"
@collection_sep = options[:collection_sep] || "|"
@stored_as = options[:stored_as] || :textfile
@columns = []
@partitions = []
@serde_name = nil
Expand All @@ -31,10 +32,14 @@ def serde(name, properties={})
def create_table_statement()
%[CREATE #{external}TABLE #{table_statement}
ROW FORMAT #{row_format_statement}
STORED AS TEXTFILE
STORED AS #{stored_as}
#{location}]
end

def stored_as
@stored_as.to_s.upcase
end

def row_format_statement
if @serde_name
serde_statement
Expand Down

0 comments on commit 8d4fdad

Please sign in to comment.