摘要: 一、hive文件存储格式 Hive支持的存储数的格式主要有:TEXTFILE 、SEQUENCEFILE、ORC、PARQUET。 上图左边为逻辑表,右边第一个为行式存储,第二个为列式存储。 行存储的特点: 查询满足条件的一整行数据的时候,列存储则需要去每个聚集的字段找到对应的每个列的值,行存储只需 阅读全文
posted @ 2019-10-03 13:13 newtest00 阅读(601) 评论(0) 推荐(0) 编辑
摘要: 一、分桶及抽样查询 1、分桶表创建 hive (db_test)> create table stu_buck(id int,name string) > clustered by(id) > into 4 buckets > row format delimited fields terminat 阅读全文
posted @ 2019-10-03 12:59 newtest00 阅读(1051) 评论(0) 推荐(0) 编辑
摘要: 一、全表查询和特定列查询 1、全表查询: hive (db_test)> select * from dept;OKdept.deptno dept.dname dept.loc10 ACCOUNTING 170020 RESEARCH 180030 SALES 190040 OPERATIONS 阅读全文
posted @ 2019-09-30 13:27 newtest00 阅读(887) 评论(0) 推荐(0) 编辑
摘要: 1、分区表管理 1.1、创建分区表 hive (db_test)> create table dept_partition(deptno int, dname string, loc string) > partitioned by(month string) > row format delimi 阅读全文
posted @ 2019-09-14 17:05 newtest00 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 1、在hive中显示当前数据库的名字和表头的信息,需要在$HIVE_HOME/conf目录下的hive-site.xml文件中添加如下内容: <property> <name>hive.cli.print.header</name> <value>true</value> </property> < 阅读全文
posted @ 2019-09-11 17:02 newtest00 阅读(443) 评论(0) 推荐(0) 编辑
摘要: MapReduce作业提交查看源码 1、判断job的状态 //将private Job.JobState state的值修改为DEFINE,然后执行submit()方法; public boolean waitForCompletion(boolean verbose) throws IOExcep 阅读全文
posted @ 2019-08-30 16:43 newtest00 阅读(376) 评论(0) 推荐(0) 编辑