Reputation: 403
I have created a managed hive table which is stored as ORC and when loading .txt files its working fine, however am not able to load an ORC file into that table. Is there anything to do with delimiters? or am i missing something?
Upvotes: 2
Views: 6849
Reputation: 501
After several tries, here is the solution that works for me :
create table MyDB.TEST (
Col1 String,
Col2 String,
Col3 String,
Col4 String)
STORED AS ORC
LOCATION 'hdfs://hdfs/dir/folder/to/orc/files/';
Upvotes: 0
Reputation: 49
Below code is working for me, while loading ORC files present in HDFS into a hive table.
Create a table in hive.
create table MyDB.TEST (
Col1 String,
Col2 String,
Col3 String,
Col4 String)
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat';
Load data to the table.
LOAD DATA INPATH '/hdfs/dir/folder/to/orc/files/' INTO TABLE MyDB.TEST;
Upvotes: 2