Blog

Download Sample Data

Create hive table and see data contain header

CREATE EXTERNAL TABLE IF NOT EXISTS header.tablewithheader
(id int,
first_name STRING,
last_name STRING,
email STRING,
gender STRING,
ip_address STRING)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '|'
STORED AS TEXTFILE
LOCATION 'hdfs://localhost:9000/user/hive/input/tablewithheader/';

Load data to hive table and see data has header


load data local inpath 'header_usersdata.csv' into table header.tablewithheader;

Create table with header properties

CREATE EXTERNAL TABLE IF NOT EXISTS header.rmhdr
(id int,
first_name STRING,
last_name STRING,
email STRING,
gender STRING,
ip_address STRING)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '|'
STORED AS TEXTFILE
LOCATION 'hdfs://localhost:9000/user/hive/input/rmhdr/'
TBLPROPERTIES("skip.header.line.count"="2");

Load data into hive table. header will not loaded to hive table


load data local inpath 'header_usersdata.csv' into table header.rmhdr;

Follow me

Contact us for Training/ Job Support

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.