创建表格
hive> CREATE TABLE student(id INT, name STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ' ';
导入数据
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 ' ' STORED AS TEXTFILE;
查询