You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Maria Roy (JIRA)" <ji...@apache.org> on 2016/02/04 11:19:39 UTC
[jira] [Commented] (HIVE-5326) Operators && and || do not work
[ https://issues.apache.org/jira/browse/HIVE-5326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15132092#comment-15132092 ]
Maria Roy commented on HIVE-5326:
---------------------------------
I have analysed this issue and have identified required code changes as below:
1) Modify /hive/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java to add the below code:
a) system.registerGenericUDF("&&", GenericUDFOPAnd.class);
b) add the operator && to the list HIVE_OPERATORS
2) Modify /hive/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/SqlFunctionConverter.java to register a duplicate function with && operator.
Appreciate additional inputs for this fix.
> Operators && and || do not work
> -------------------------------
>
> Key: HIVE-5326
> URL: https://issues.apache.org/jira/browse/HIVE-5326
> Project: Hive
> Issue Type: Bug
> Components: Query Processor
> Reporter: Amareshwari Sriramadasu
>
> Though the documentation https://cwiki.apache.org/Hive/languagemanual-udf.html says they are same as AND and OR, they do not even get parsed. User gets parsing when they are used.
> hive> select key from src where key=a || key =b;
> FAILED: Parse Error: line 1:33 cannot recognize input near '|' 'key' '=' in expression specification
> hive> select key from src where key=a && key =b;
> FAILED: Parse Error: line 1:33 cannot recognize input near '&' 'key' '=' in expression specification
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)