[ 
https://issues.apache.org/jira/browse/HIVE-24998?focusedWorklogId=589567&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-589567
 ]

ASF GitHub Bot logged work on HIVE-24998:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Apr/21 05:45
            Start Date: 27/Apr/21 05:45
    Worklog Time Spent: 10m 
      Work Description: jcamachor commented on a change in pull request #2163:
URL: https://github.com/apache/hive/pull/2163#discussion_r620876210



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRexExecutorImpl.java
##########
@@ -52,6 +56,10 @@ public void reduce(RexBuilder rexBuilder, List<RexNode> 
constExps, List<RexNode>
       // initialize the converter
       ExprNodeConverter converter = new ExprNodeConverter("", null, null, null,
           new HashSet<>(), rexBuilder.getTypeFactory());
+
+      if (rexNode.getKind() == SqlKind.IS_DISTINCT_FROM) {

Review comment:
       This should be move to the `ExprNodeConverter` itself. For instance, 
check `visitCall` method.

##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTConverter.java
##########
@@ -788,6 +789,9 @@ public ASTNode visitCall(RexCall call) {
           }
         }
         break;
+      case IS_DISTINCT_FROM:
+        // convert IS DISTINCT FROM to NOT (IS NOT DISTINCT FROM)
+        return visitCall((RexCall) 
RexUtil.not(rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_DISTINCT_FROM, 
call.getOperands())));

Review comment:
       If you rely on `buildAST(SqlOperator op, List<ASTNode> children)`, you 
would not have to declare the function in `FunctionRegistry`?
   i) Call `visitCall` on the call operands, ii) then `buildAST` with 
`SqlStdOperatorTable.IS_NOT_DISTINCT_FROM`, iii) then `buildAST` with the 
output of the previous one.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 589567)
    Time Spent: 1h 20m  (was: 1h 10m)

> IS [NOT] DISTINCT FROM failing with SemanticException
> -----------------------------------------------------
>
>                 Key: HIVE-24998
>                 URL: https://issues.apache.org/jira/browse/HIVE-24998
>             Project: Hive
>          Issue Type: Bug
>          Components: CBO
>            Reporter: Manthan B Y
>            Assignee: Soumyakanti Das
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Hive: INSERT statements failing with UDFArgumentException and 
> SemanticException
> Problem Statement:
> {code:java}
> CREATE TABLE t2(c0 boolean , c1 FLOAT );
> INSERT INTO t2(c0) VALUES (NOT (0.379 IS NOT DISTINCT FROM 641));
> -- Insert failing with: Error: Error while compiling statement: FAILED: 
> UDFArgumentException UDF tables only one argument (state=42000,code=40000)
> INSERT INTO t2(c0,c1) VALUES (NOT (0.379 IS NOT DISTINCT FROM 641), 0.2);
> -- Insert failing with: SemanticException 0:0 Expected 2 columns for 
> insclause-0/database52@t2; select produces 1 columns. Error encountered near 
> token '0.2' (state=42000,code=40000) {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to