Failed to recognize predicate 'xxx' Failed rule 'identifie

编程入门 行业动态 更新时间:2024-10-20 04:06:26
               

1. 问题描述

在Hive1.2.2版本运行如下HQL时:

select dt as date, comMap['searchType'] as search_type, comMap['clickType'] as click_typefrom search_clickwhere dt = '20170614';

会抛出如下异常:

Failed to recognize predicate 'date'. Failed rule: 'identifier' in column specification

2. 问题分析

在Hive1.2.0版本开始增加了如下配置选项,默认值为true

hive.support.sql11.reserved.keywords

该选项的目的是:是否启用对SQL2011保留关键字的支持。 启用后,将支持部分SQL2011保留关键字。

3. 解决方案

从上面可以知道是因为启用了对保留关键字的支持导致的,上面语句中date是保留关键字.所以解决方案如下:

  • 弃用保留关键字date
select dt, comMap['searchType'] as search_type, comMap['clickType'] as click_typefrom search_clickwhere dt = '20170614';
  • 弃用对保留关键字的支持
sudo -uwirelessdev hive -e "   set hive.support.sql11.reserved.keywords = false ;   select dt, comMap['searchType'] as search_type, comMap['clickType'] as click_type   from search_click   where dt = '20170614';" > a.txt

或者在conf下的hive-site.xml配置文件中修改配置选项:

<property>    <name>hive.support.sql11.reserved.keywords</name>    <value>false</value></property>
           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn/jiangjunshow

更多推荐

Failed to recognize predicate 'xxx' Failed rule 'identifie

本文发布于:2023-06-14 08:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1456627.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:predicate   recognize   Failed   identifie   rule

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!