Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a use case where I have to convert HDFS file format to csv or tsv. I know a way where we can create hive table on top of hdfs file format and than store the data as required format. But for this, I required information of data(like column name to create table). Is there any other way using hive or something else which convert any file format of hdfs to csv or tsv?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
248 views
Welcome To Ask or Share your Answers For Others

1 Answer

First of all.. to convert the data to CSV or TSV you will be needing your data as structured please check for this once.
The way which you specified to convert the data using Hive is one of the options.
Other option would be to use spark. -- Here you have to read the data in structured format and then while saving you have to convert to CSV. Please refer to the following link for more explanation:

How to export data from Spark SQL to CSV

You can use python as well to convert the data to CSV.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...