How To Export The Header Of Hive Table Into CSV File?
Maybe your like
- Community
- Training
- Partners
- Support
- Cloudera Community
- Support
- Support Questions
- How to export the header of hive table into CSV fi...
Labels:
- Apache Hive
Created 06-16-2018 08:01 PM
26,419 Views- All forum topics
- Previous
- Next
Created 06-18-2018 05:18 AM
Venkat Please try this :
hive -e 'set hive.cli.print.header=true; select * from your_Table' | sed 's/[\t]/,/g' > /home/yourfile.csvOriginal answer https://stackoverflow.com/questions/17086642/how-to-export-a-hive-table-into-a-csv-file
19,887 Views 2 KudosCreated 06-20-2018 05:58 PM
For this command I getting only the header.I want both header and data in the csv file
19,887 ViewsCreated 06-21-2018 01:32 AM
Venkat
You should be getting both header and data with this command. I have just added "hive.cli.print.header=true" to print header along with data.
hive -e 'set hive.cli.print.header=true; select * from your_Table' | sed 's/[\t]/,/g' > /home/yourfile.csvWhats the result you are seeing if you just do "select * from your_Table"? Does the table have the data?
19,887 ViewsCreated 06-21-2018 02:20 PM
Sorry @ssharma it is working but when I trying like this
- hive -e 'set hive.cli.print.header=true; create table test row format delimited fields terminated by '|' as select * from test1'>/home/yourfile.csv in this scenario it only showing the header not the whole data csv file
Tag » How To Adding Column Headers To Hive Result Set
-
Adding Column Headers To Hive Result Set - Amazon S3 - Stack Overflow
-
Hive: How To Display Column Names In SELECT Statement Output
-
Adding Column Headers To Hive Result Set - Hadoop Online Tutorials
-
Export Hive Table Into CSV File With Header? - Spark By {Examples}
-
What Are Some Good Practices To Get Formatted Query Result In HiveQL?
-
e.s = False Not Working
-
DESCRIBE Statement - Apache Impala
-
Hive DDL - Confluence Mobile - Apache Software Foundation
-
Hive Command Examples For Exporting, Importing, And Querying Data ...
-
Hive - Alter Table - Tutorialspoint
-
Runtime Column Propagation (Hive Connector) - IBM
-
CREATE TABLE (HADOOP) Statement - IBM
-
Composing A Smart Hive Query (AWS)
-
SELECT - Amazon Athena - AWS Documentation