- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Hive table Creation from ORC format file
- Labels:
-
Apache Hive
Created 03-20-2018 01:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a ORC storage file and I am creating External table in HIVE using the below query.
- CREATE EXTERNAL TABLE mytable
- (col1 bigint,col2 bigint) ROW FORMAT DELIMITED
- FIELDS TERMINATED BY ','
- STORED AS ORC
- location '<ORC File location';
The external table is getting loaded but when i am trying to query in HIVE. it is showing junk data. Can you please suggest what is the mistake in the query. Also , I am using the same delimeter for ORC storage and HIVE table creation.
Created 03-21-2018 01:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ORC is a Column Major storage format! You need not mention ROW FORMAT DELIMITED FIELDS TERMINATED BY statements.
Simply create your table as
CREATE EXTERNAL TABLE mytable ( col1 bigint, col2 bigint ) STORED AS ORC location '<ORC File location';
From Question - I am using the same delimiter for ORC storage and HIVE table creation.
How are you creating ORC file?
Created 04-01-2018 04:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did the answer help in the resolution of your query? Please close the thread by marking the answer as Accepted!