Failed to recognize predicate 'xxx'. Failed rule: 'identifier' in column specification
2017-06-14 16:10
465 查看
1. 问题描述
在Hive1.2.2版本运行如下HQL时:select dt as date, comMap['searchType'] as search_type, comMap['clickType'] as click_type from search_click where 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_type from search_click where 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>
相关文章推荐
- FAILED: ParseException line 4:2 Failed to recognize predicate 'user'. Failed rule: 'identifier' in c
- SSE优化指令集编译错误: inlining failed in call to always_inline 'xxx': target specific option mismatch xxx
- Attempt to fetch logical page (...) in database 2 failed. It belongs to allocation unit xxxx not to xxx
- Hive连接产生笛卡尔集. FAILED: ParseException line 1:18 Failed to recognize predicate 'a'. Failed rule: 'kwIn
- idea创建maven项目失败, Failed to create a Maven project:'D:/xxx' already exists in VFS
- idea创建maven项目失败, Failed to create a Maven project:'D:/xxx' already exists in VFS
- Issue of weblogic [Servlet: "action" failed to preload on startup in Web application]
- How to merge blank cells in one column in Office Excel?
- Failed to add 'XXX': object of the same name already already exists
- To JavaScript Prompts for Buttons in Asp::DataGrid for Delete Column(ZT)
- How To contain multiple fileds in the querystrig, DataNavigateUrlFormatString=xxx.asp?ID={0}&Name={1}
- MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length
- vc6.0中 identifier was truncated to '255' characters in the debug information警告的解决
- Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
- How To Split column In SQL
- solution:Failed to update database "XXX.MDF" because the database is read-only.
- Could not store transport type data for Receive Location 'Recv.Loc' to config store. Primary SSO Server 'Sql-server' failed. The external credentials in the SSO database are more recent.
- sql express 2008 - Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instan
- Servlet:"action" failed to preload on startup in web application 问题的解决
- System.Data.SqlClient.SqlException: Cannot insert explicit value for identity column in table 'Food' when IDENTITY_INSERT is set to OFF