一、启动hdfs;
二、初始化:
schematool -initSchema -dbType derby
三、进入hive:
hive
四、创建数据库:
create database ll_hive_test;
五、切换到新建数据库并查看databases:
use ll_hive_test;
show databases;
六、创建测试表:
create table student(id int,name string) row format delimited fields terminated by ',';
七、将本地数据准备好并上传数据库:
vim student.txt
cat student.txt
1,haha
2,baba
3,zixia
4,jiayuan
5,lulu
6,laoqin
7,qianer
8,jackson
9,roy
10,karry
load data local inpath '/home/LL/hive/apache-hive-2.1.1-bin/test_data/student.txt' into table ll_hive_test.student;
八、操作student表:
select *from student;