hive学习 hive中的表
来源:互联网 发布:python 最优分箱 编辑:程序博客网 时间:2024/05/16 14:50
stored as 存储格式(testfile/sequencefile/rcfile)
hive中的表分为内部表和外部表,内部表认为是数据完整的,删除表时也会删除表的数据,而外部表不会删除表的数据,只会删除表的元数据。
怎么创建一个外部表:
create <span style="color:#FF0000;">external </span> table 表名 (参数) raw format delimited fields terminated by ‘,’//指定数据的解析分隔符location ‘数据的位置(如果在hdfs上,则天蝎hdfs的位置)’
分区表(优化性能):
怎么创建一个分区表:
create table 表名 (参数) partitioned by(country string, state string); 其中:country,state也算是表的字段,如果用户在表的字段中有与之重复的字段,则会被忽略在hive中,mapred任务是触发提交的,当任务巨大是就会触发
在进行分区表查询是,建议设置:hive.mapred.mode=strict 模式,这样当有没有添加where的分区表查询时,会倍禁止提交。
怎么创建一个外部分区表:
create external table 表名(列名)partitioned by(分区属性)row formate delimited fields terminated by ‘分隔符’
外部表怎么加入数据:
alter table xxx add partition(xx=xx) location ‘数据位置’如果想修改指向的路径:
alter table xxx add partition(xx=xx) set location ‘数据位置’
怎么察看表中的分区:
show partitions 表名;
describe extended 表名
察看某个特定的分区是否存在:
show partitions 表名 partition(xxx=xxx)
怎么将数据存入分区表:
load data local inpath‘数据目录’ into table 表名partition(xxx=xxx);
怎么指定表中数据的存储格式:
stored as 存储格式(textfile/sequencefile/rcfile)
怎么重命名表:
alter table 表名 rename to 新名字怎么删除分区:
alter table 表名 drop partition(xx=xx)
怎么对表中的数据进行修改:
alter table 表名 change column xxx INT after xxx;将列xxx移动到xxx之后怎么增加列:
alter table 表名 add column (app-name string)
怎么删除和替换:
alter table 表名 replace column (xxxx 数据类型)
怎么修改存储属性:
alter table 表名 set serde ‘com.example.xxx’with serdeproperties('key1'='value1','key2'='value2');
怎么出发钩子(不懂,带研究):
alter table xxxx touch partition(xxx=xxx)
怎么自定义数据格式,在之后介绍
0 0
- hive学习 hive中的表
- hive学习 hive中的数据类型
- hive学习 hive基本功
- hive学习-------初始hive
- Hive外部表学习
- hive学习之三:项目中的hive优化实践
- 学习hive
- Hive学习
- Hive学习
- Hive学习
- hive学习
- hive学习
- Hive学习
- Hive学习
- Hive学习
- #hive#hive中的union all
- hive 中的两表join
- Hive学习之Hive配置管理
- OpenCV图像处理 图像的点运算 ( 灰度直方图 )
- 对于C++窗口编译一闪而过的解决方法 (DEV CPP下)
- hdoj 2520 我是菜鸟,我怕谁 水过~
- Python3基础(六) 深入list列表
- 卡帝乐鳄鱼 夏日时尚
- hive学习 hive中的表
- CCI 9.3 魔术索引
- linux中: cat和more的区别
- 转载--http的安全方法和幂等性
- powerdesiger 生成excel 数据字典
- django可重用app目录
- javascript中Array.sort()方法
- iOS屏幕旋转学习笔记
- 微信公众号开发