Hive实现数据文件导入与分析

一、启动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;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值