手机版
网站地图
美文美图
最新动态
你好,欢迎访问
好美文阅读网
个性皮肤
搜索
网站首页
美文
文章
散文
日记
诗歌
小说
故事
句子
作文
签名
祝福语
情书
范文
读后感
文学百科
美文摘抄
节日文章
名家散文
网名大全
座右铭
口号大全
面试技巧
说说大全
阅读答案
诗词默写
流言蜚语
节日祝福
好句子
经典台词
谚语大全
亲情故事
友情故事
表白情书
工作报告
活动总结
心得体会
专题汇总
美文网首页
hive内部表、外部表、分区表、视图
hive内部表、外部表、分区表、视图
作者:
chuweiyan
| 来源:发表于
2020-11-07 00:26 被阅读0次
1、Table 内部表
1).与数据库中的Table在概念上是类似的
2).每一个Table在Hive中都有一个相应的目录存储数据
3).所有的Table数据(不包括 External Table) 都保存在这个目录中
4).删除表时,元数据与数据都会被删除
5).建表:
2、Partition 分区表
1).Partition 对应于数据库的Partition列的密集索引
2).在Hive中,表中的一个Partition对应于表下的一个目录,所有的Partition的数据都存储在对应的目录中。
3).建表: hive> create table partition_table > (sid int, sname string) > partitioned by (gender string) > row format delimited fields terminated by ',';
3、External Table 外部表
1).指向已经在HDFS中存在的数据,可以创建Partition
2).它和内部表在元数据的组织上是相同的,而实际数据的存储则有较大的差异
3).外部表只有一个过程,加载数据和创建表同时完成,并不会移动到数据库目录中,知识与外部数据建立一个连接。当删除一个外部表时,仅删除连接。
4).建表: hive> create external table external_student > (sid int,sname string,age int) > row format delimited fields terminated by ',' > location '/input';
4、Bucket Table 桶表
1). 桶表是对数据进行哈希取值,值不同的放到不同的文件中存储。
2). 建表: hive> create table bucket_table > (sid int,sname string,age int) > clustered by(sname) into 5 buckets;
5、视图
1)视图是一种虚表,是一个逻辑概念;可以跨越多张表
2)视图建立在已有表的基础上,视图赖以建立的这些表称为基表
3)视图可以简化复杂的查询
4)建立视图: hive> create view empinfo > as > select e.empno,e.ename,e.sal,e.sal*12 annlsal,d.dname > from emp e,dept d > where e.deptno=d.deptno;
相关文章
网友评论
本文标题:
hive内部表、外部表、分区表、视图
本文链接:
https://www.haomeiwen.com/subject/qxlfsktx.html
延伸阅读
那年盛夏诗歌
环境监察队工作总结范文
优秀教师学习心得范文
华胥引的读后感300字
《Its red》教学反思范文
农资购销的合同范本
竞选中队委优秀演讲稿
辞金蹈海的成语解释
《世纪宝鼎》公开课教案设计
因为爱你,所以牵挂
今生今世红尘醉——美到
一个90后的内心独白
致已逝去的高中年华
深度阅读
您也可以注册成为美文阅读网的作者,发表您的原创作品、分享您的心情!
情人节
母亲节
重阳节
清明节
端午节
植树节
元宵节
妇女节
愚人节
圣诞节
父亲节
教师节
儿童节
劳动节
青年节
建军节
万圣节
平安夜
光棍节
中秋节
国庆节
感恩节
腊八节
更多话题
栏目导航
摄影
故事
互联网
读书
旅行
热点阅读
《642件可写的事-日更57》以外星人的视角描述地球
令人神往的沉浸式光影艺术作品
20多岁的我迎来了最2的阶段
java之使用数组去重复数据
梦
[乡土]平凡人生曲折路(972)
iOS多线程编程介绍
图片分享
你只是看起来很努力
我在《小说的越界》里,捕获一枚“灵魂有香气”的女子
网友评论