第19天: stutct
来源:互联网 发布:多标签分类算法 编辑:程序博客网 时间:2024/05/17 06:23
Hive学习实战
--------------------------------------------------------------
Hive从入门到实战【40讲】---笔记记录
--------------------------------------------------------------
hive命令
1、show tables;
2、show databases;
3、 desc login; ---查看表结构。
4、 show partitions test5; --查看分区
load data local inpath
'/hadoop/hive0.9/testHive/login_struct.txt'
into table login_struct;
第19天: stutct
create table login_struct(
ip string,
user struct<uid:bigint,name :string>
)
partitioned by (dt string)
row format delimited
fields terminated by ','
collection items terminated by '|'
stored as textfile;
printf "%s,%s|%s\n" 192.168.1.1 2000000 blue >> login_struct.txt
printf "%s,%s|%s\n" 192.168.1.2 2000001 red >> login_struct.txt
load data local inpath
'/hadoop/hive0.9/testHive/login_struct.txt'
overwrite into table login_struct partition (dt='20150207');
stuct可以根据 . 来查询。
select ip,user.uid from login_struct;
--------------------------------------------------------------
Hive从入门到实战【40讲】---笔记记录
--------------------------------------------------------------
hive命令
1、show tables;
2、show databases;
3、 desc login; ---查看表结构。
4、 show partitions test5; --查看分区
load data local inpath
'/hadoop/hive0.9/testHive/login_struct.txt'
into table login_struct;
第19天: stutct
create table login_struct(
ip string,
user struct<uid:bigint,name :string>
)
partitioned by (dt string)
row format delimited
fields terminated by ','
collection items terminated by '|'
stored as textfile;
printf "%s,%s|%s\n" 192.168.1.1 2000000 blue >> login_struct.txt
printf "%s,%s|%s\n" 192.168.1.2 2000001 red >> login_struct.txt
load data local inpath
'/hadoop/hive0.9/testHive/login_struct.txt'
overwrite into table login_struct partition (dt='20150207');
stuct可以根据 . 来查询。
select ip,user.uid from login_struct;
0 0
- 第19天: stutct
- 坚持#第19天~
- 第19天
- 考前的第19天
- java基础第19天
- 第19天 作业好多
- 暑假第19天总结
- java学习第19天
- 【第19天】内涵深厚才能妙语连珠
- 黑马程序员 + 第19天 IO流
- 学习iOS开发的第19天
- JAVASE学习笔记第19天
- java初级第19天总结笔记
- 第19天 异常的简单介绍
- 华恩JAVA班第19天
- vue学习第19天,核心 defineProperty
- 第9天 考研第一天
- 第6天 css的第一天
- 正则表达式
- Fiddler
- 用PHP编写CAPTCHA(验证码)
- opencv实现车牌识别之车牌号定位_2
- Java EE 7 教程 第二部分 平台基础 第3章 创建资源 第3.1节 资源和JNDI命名
- 第19天: stutct
- Android异步任务类分析
- service小结(一)
- python模拟登陆网站
- android实现微信支付
- 求整数均值
- 优化linux内核参数
- error while loading shared libraries问题的解决办法
- 黑马程序员------C语言-----指针