Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How import text file format data to ORC Table in hive.

avatar
New Contributor

Suggest me direct import option,I have created text file format table and from text file format table i can import to ORC file format,

Is there any other way import?

2 REPLIES 2

avatar
@Pugazhvanan parthiban

It is not possible to directly load a text file into a ORC table. Steps to load data into ORC file format in hive:

1.Create one normal table using textFile format.

2.Load the data normally into this table.

3.Create one table with the schema of the expected results of your normal hive table using stored as orcfile.

4.Insert overwrite query to copy the data from textFile table to orcfile table.

avatar

You could also use pig to import text files, e.g. csv:

  1. Create an ORC table in Hive with the right schema
  2. Use something like https://community.hortonworks.com/questions/49818/how-to-load-csv-file-directly-into-hive-orc-table....