I am loading from csv file and data is separated by space. After loading data into final table it is loading extra NULLs are an extra row along with actual data.
Actual Data
id first_name last_name email gender ip_address
1 James Coleman [email protected] Male 136.90.241.52
2 Lillian Lawrence [email protected] Female 101.177.15.130
3 Theresa Hall [email protected] Female 114.123.153.64
4 Samuel Tucker [email protected] Male 89.60.227.31
5 Emily Dixon [email protected] Female 119.92.21.19
Table creation
create table serde_sample(id int,first_name string,last_name string,email string,gender string,ip_address string)
row format serde 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
with serdeproperties (
"separatorChar" = "\t"
)
tblproperties('skip.header.line.count'='1')
;
LOAD DATA LOCAL INPATH '/home/cloudera/Desktop/files/serde.csv' into table serde_sample;
got an Output
NULL NULL NULL NULL NULL NULL
1 James Coleman [email protected] Male 136.90.241.52
NULL NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
2 Lillian Lawrence [email protected] Female 101.177.15.130
NULL NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
3 Theresa Hall [email protected] Female 114.123.153.64
NULL NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
4 Samuel Tucker [email protected] Male 89.60.227.31
NULL NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
5 Emily Dixon [email protected] Female 119.92.21.19
NULL NULL NULL NULL NULL
NULL NULL NULL NULL NULL NULL
I am not sure where it is going wrong. Why extra NULL rows are coming. Can someone help to resolve this issue