HIVE 查询返回 NULL

创建表格

hive> CREATE TABLE student(id INT, name STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';

导入数据

load data local inpath '/home/testData/dataTest.txt' overwrite into table student;

查询为NULL  

 

错误原因,因为分隔符号是错的, 正确如下

重新建表

CREATE TABLE testTab(id int, name String) ROW FORMAT DELIMITED FIELDS TERMINATED BY ' '
LINES TERMINATED BY '\n' STORED AS TEXTFILE;

查询

 

 

  

 

posted @ 2020-04-10 14:00  抽象Java  阅读(377)  评论(0编辑  收藏  举报