hive语句 partition(dt=substr('2016-12-01',1,7))取分区问题
来源:互联网 发布:程序员交流 编辑:程序博客网 时间:2024/06/09 19:15
今天帮助一个朋友排查hive语句的问题,如下:
insert overwrite table database.table
partition(dt=substr('2016-12-01',1,7))
select substr('2016-12-01',1,7) as month,...
报错:
cannot recognize input near 'substring' '(' ''2016-12-01'' in constant
select substr('2016-12-01',1,7) as month,...
网上查找到:
for dynamic partitions the partition clause must look like
PARTITION(year, month, edate)
the actual expressions should be included in the select list. So in your
example the select list should look something like
SELECT sh.EVENT_TIME, sh.person_NAME, substring(event_time, 0, 4) as year,
解决方法:
insert overwrite table database.table
partition(dt)
select substr('2016-12-01',1,7) as dt,...
insert overwrite table database.table
partition(dt=substr('2016-12-01',1,7))
select substr('2016-12-01',1,7) as month,...
报错:
cannot recognize input near 'substring' '(' ''2016-12-01'' in constant
问题出现partition(dt=substr('2016-12-01',1,7))这部分
select substr('2016-12-01',1,7) as month,...
网上查找到:
for dynamic partitions the partition clause must look like
PARTITION(year, month, edate)
the actual expressions should be included in the select list. So in your
example the select list should look something like
SELECT sh.EVENT_TIME, sh.person_NAME, substring(event_time, 0, 4) as year,
解决方法:
insert overwrite table database.table
partition(dt)
select substr('2016-12-01',1,7) as dt,...
dt是分区的字段名称
参考:http://mail-archives.apache.org/mod_mbox/hive-user/201204.mbox/%3CCAOn+50K1LYvBN4LGz=CHDNeoqYAgg0f+uGA5bb2noH0VmidSsA@mail.gmail.com%3E
0 0
- hive语句 partition(dt=substr('2016-12-01',1,7))取分区问题
- hive partition ||| hive分区
- Hive分区partition详解
- hive 分区(partition)简介
- hive分区(partition)简介
- hive分区(partition)简介
- hive分区(partition)简介
- hive分区(partition)简介
- hive partition 分区详解一
- hive partition 分区详解二
- hive分区(partition)简介
- hive分区(partition)简介
- hive分区(partition)简介
- hive 分区(partition)简介
- hive分区(partition)简介
- hive分区语句
- hive外部表使用分区partition
- Hive 外部表使用分区 Partition
- OSHashTable 分析
- 大于号、小于号、单引号 转义字符
- jsp中<%%> 与<%!%> , <%%>与<%=%>的区别是什么? - u013305082的专栏 - 博客频道 - CSDN.NET
- eclipse插件之Findbugs、Checkstyle、PMD安装及使用
- 使用angular2的[(ngModel)]
- hive语句 partition(dt=substr('2016-12-01',1,7))取分区问题
- vi 常用复制与粘帖技巧
- SecureCRT的使用方法和技巧(详细使用教程)
- 设计模式之代理模式
- js拼接json
- Python 爬虫多线程爬取美女图片保存到本地
- Paxos 实现日志复制同步
- 数据加密
- 机器学习算法中GBDT和XGBOOST