Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hive External table-CSV File- Header row

Tags:

hive

Below is the hive table i have created:

CREATE EXTERNAL TABLE Activity (
  column1 type, </br>
  column2 type
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
LOCATION '/exttable/';

In my HDFS location /exttable, i have lot of CSV files and each CSV file also contain the header row. When i am doing select queries, the result contains the header row as well.

Is there any way in HIVE where we can ignore the header row or first line ?

like image 227
Ramana Avatar asked May 09 '13 08:05

Ramana


People also ask

Can CSV files have headers?

CSV and spreadsheet content rules. Each row in the file must contain the same number of cells. This rule also applies to the header row. The first row must contain column headers.

Where Hive external tables store data?

An external table is stored on HDFS or any storage compatible with HDFS, because we want to use the data outside of Hive. Thus, Hive is not responsible for managing the storage of the external table. Tables can be stored on an external location for instance on a cloud platform like google cloud or AWS.


1 Answers

you can now skip the header count in hive 0.13.0.


tblproperties ("skip.header.line.count"="1");
like image 168
tariqz Avatar answered Sep 26 '22 21:09

tariqz