We have a table called employee.dat with below contents:

1,ryan,d'souza,it,20000
2,michael,fernandes,admin,25000

then in Hive, query:

create table myTbl (a INT, b STRING)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
TBLPROPERTIES ("serialization.null.format"="\\N");

LOAD DATA LOCAL INPATH "/.../employee.dat" overwrite into table myTbl;

when do:
select * from myTbl;

the result is:

1 ryan
2 michael

Is this correct? One of my teammate says if the dat file and table def has
different number of columns, NULL values should be in the table.

Can someone please confirm which one is expected behavior?

Thanks,

Reply via email to