栏目分类:
子分类:
返回
终身学习网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
终身学习网 > IT > 前沿技术 > 大数据 > 大数据系统

hive使用ORC格式,注意事项

大数据系统 更新时间:发布时间: 百科书网 趣学号

hive orc格式的表,使用注意事项

测试表

create table orc_part_tb(id int, name string) partitioned by (dt string) stored as orc;

insert into orc_part_tb (dt = '01') select 1,'xiaoming' union all select 2,'xiaohong' union all select 3,'xiaozhang';

使用orc格式的表可以使用alter table orc_part_tb add columns(age int);进行添加字段,字段会添加到末尾,查询也没有问题。
但是不能调整字段的位置,
执行alter table orc_part_tb change age age int after id;, 报错信息如下:

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Reordering columns is not supported for table orc_db.orc_part_tb. SerDe may be incompatible

表orc_db.orc_part_tb不支持对列进行重新排序。

所以如果在数仓中,ods层的数据不建议使用orc格式,因为业务可能不断发生变化,业务表结构可能频繁变动。

转载请注明:文章转载自 www.051e.com
本文地址:http://www.051e.com/it/279887.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 ©2023-2025 051e.com

ICP备案号:京ICP备12030808号