Skip to content

Commit 8d4fdad

Browse files
committed
Merge pull request #34 from rafalcymerys/support_for_other_storage_formats
Added support for other storage formats
2 parents 3e38dae + efbcc0a commit 8d4fdad

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/rbhive/table_schema.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def initialize(name, comment=nil, options={}, &blk)
88
@field_sep = options[:field_sep] || "\t"
99
@line_sep = options[:line_sep] || "\n"
1010
@collection_sep = options[:collection_sep] || "|"
11+
@stored_as = options[:stored_as] || :textfile
1112
@columns = []
1213
@partitions = []
1314
@serde_name = nil
@@ -31,10 +32,14 @@ def serde(name, properties={})
3132
def create_table_statement()
3233
%[CREATE #{external}TABLE #{table_statement}
3334
ROW FORMAT #{row_format_statement}
34-
STORED AS TEXTFILE
35+
STORED AS #{stored_as}
3536
#{location}]
3637
end
3738

39+
def stored_as
40+
@stored_as.to_s.upcase
41+
end
42+
3843
def row_format_statement
3944
if @serde_name
4045
serde_statement

0 commit comments

Comments
 (0)