0

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 jcoleman0@cam.ac.uk Male 136.90.241.52

2 Lillian Lawrence llawrence1@statcounter.com Female 101.177.15.130

3 Theresa Hall thall2@sohu.com Female 114.123.153.64

4 Samuel Tucker stucker3@sun.com Male 89.60.227.31

5 Emily Dixon edixon4@surveymonkey.com 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 jcoleman0@cam.ac.uk Male 136.90.241.52  
NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL

2 Lillian Lawrence llawrence1@statcounter.com Female 101.177.15.130 

NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL

3 Theresa Hall thall2@sohu.com Female 114.123.153.64    

NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL

4 Samuel Tucker stucker3@sun.com Male 89.60.227.31  

NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL

5 Emily Dixon edixon4@surveymonkey.com 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

leftjoin
  • 36,950
  • 8
  • 57
  • 116
alnkr
  • 33
  • 5

0 Answers0