Skip to content

Commit efbcc0a

Browse files
committed
Added support for other storage formats.
1 parent 42e1fb5 commit efbcc0a

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)