Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (2)
avatar
Master Guru

Converting CSV Files to Apache Hive Tables with Apache ORC Files


I received some CSV files of data to load into Apache Hive. There are many ways to do this, but I wanted to see how easy it was to do in Apache NiFi with zero code.

72565-cvsprocessing1.png

I read CSV files from a directory of files. Then I can Convert the CSV to AVRO directly with ConvertRecord.

72562-convertrecordcsv.png

I will need a schema, so I use the below settings for InferAvroSchema. if ever file is different, you will need to do this every time.

72563-avroschemafromcsv.png

CSV Reader

72564-csvreader.png

I use the Jackson CSV parser which works very well. The first line of the CSV is a header. It can figure out the fields from the header.

Once I have an Apache AVRO file it's easy to convert to Apache ORC and then store in HDFS.

Template:

csvprocess.xml

4,802 Views
Version history
Last update:
‎08-17-2019 07:38 AM
Updated by:
Contributors