hive創建表

1.要注意;user是一個關鍵字,不能普通的使用;不能直接將其作爲表名,列名;

如果需要使用user ,應該這樣:`user`          是tab鍵上面的一個按鍵。

犯下的錯誤:


2.hive建表語句:

建表字段:username string,month string,invit int。表名:student

語句:create table student(username string,month string,invit int) row format delimited fields terminated by '\t';

3.數據導入到表student中

語句:load data local inpath '/home/cry/student.txt' into table student;

4.student.txt  數據內容:

A 2015-01 5
A 2015-01 15
B 2015-01 5
A 2015-01 8
B 2015-01 25
A 2015-01 5
A 2015-02 4
A 2015-02 6
B 2015-02 10
B 2015-02 5
A 2015-03 16
A 2015-03 22
B 2015-03 23
B 2015-03 10

B 2015-03 11


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章