hadoop - 如何更新配置单元中分区表中的某些行?
问题描述
我需要按日期更新分区表中的某些行,包含日期范围,但我不知道该怎么做?
解决方案
使用动态分区,您可以覆盖需要更新的分区。使用 case 语句检查要修改的行并设置值,如在此模板中:
set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;
insert overwrite table table_name partition (partition_column)
select col1,
col2,
case when col1='record to be updated' then 'new value' else col3 end as col3,
...
colN,
partition_column --partition_column should be the last
from table_name
where ...--partition predicate here
推荐阅读
- wolfram-mathematica - 无法在 wolfram-mathmica 中完成傅立叶分析?
- python - 如何处理 PyTorch 的 LSTM 模块中的可变大小序列?
- c++ - 无法在 C++ 中打印矢量对象数据成员值
- javascript - 在 Intersection Observer API 中定位目标
- amazon-web-services - AWS CloudFomation:无法与 ElasticBeanstalk 一起创建 RDS 资源
- tensorflow - 使用 TensorFlow Quantum 进行多类分类
- javascript - 当我按下提交/播放时,表单上的事件监听器不会触发
- c# - 从另一个方法调用一个方法并传递参数
- javascript - ElectronJS 为每张幻灯片指定程序路径( SlickJs )
- docusignapi - 什么会导致 Docusign Payments 消息“付款设置失败”?