博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Hive分区+根据分区查询
阅读量:3958 次
发布时间:2019-05-24

本文共 626 字,大约阅读时间需要 2 分钟。

分区通过partition by(字段名 字段类型) - 分区最后会形成一个目录。分区的字段,不在源数据中出现,但是表的一部分创建一个分区表hive> create table stud01(       id string,       name string,       age int     )partitioned by (grade string)row format delimitedfields terminated by '\t';创建多级目录hive> create table stud01(    id string,    name string,    age int    )partitioned by (create_year string,create_month string)row format delimitedfields terminated by '\t';导入数据在导入数据时,通过partition提定分区的值:hive> load data local inpath '${env:HOME}/stud.txt' into table stud01 partition(grade='2009');查看分区hive>show partitions stu01;查询分区数据select * from AccountRegister where create_date="2014-10-1";

 

转载地址:http://csazi.baihongyu.com/

你可能感兴趣的文章
python超简单的web服务器
查看>>
代理模式、静态代理、动态代理、aop
查看>>
Struts1.x Spring2.x Hibernate3.x DWR2.x整合工具文档v1.00
查看>>
大型Web2.0站点构建技术初探
查看>>
机器学习算法汇总:人工神经网络、深度学习及其它
查看>>
解决Spring中AOP不能切入Struts的DispatchAction方法的问题
查看>>
出国以后才知道英语应该怎么学
查看>>
计算机专业权威期刊投稿经验总结
查看>>
如何在三个月内学会一门外语?
查看>>
看看你对Linux到底了解多少?
查看>>
网上看到的:ARM入门最好的文章(转)
查看>>
中国最美情诗100句
查看>>
javascript注册window的onload事件问题研究
查看>>
客户端技术分页控件javascript+css,可用于任何服务器端技术
查看>>
学习Swing 的网站[转]
查看>>
Google App engine 的第一个应用 midispot
查看>>
提问的智慧
查看>>
关于dom4j无法解析xmlns问题及生成非UTF-8字符集乱码问题的解决
查看>>
很好的一篇文章 如果让我重做一次研究生 王汎森
查看>>
保护U盘批处理文件
查看>>