rubenada commented on code in PR #6523:
URL: https://github.com/apache/hive/pull/6523#discussion_r3783693766


##########
ql/src/test/results/clientpositive/llap/allcolref_in_udf.q.out:
##########
@@ -76,10 +76,10 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: a
-                  filterExpr: (UDFToDouble(key) < 100.0D) (type: boolean)
+                  filterExpr: ((UDFToDouble(key) < 100.0D) and 
(UDFToDouble(key) + 1.0D) is not null) (type: boolean)
                   Statistics: Num rows: 500 Data size: 89000 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (UDFToDouble(key) < 100.0D) (type: boolean)
+                    predicate: ((UDFToDouble(key) < 100.0D) and 
(UDFToDouble(key) + 1.0D) is not null) (type: boolean)

Review Comment:
   IIUC the issue here is that `key` is declared as type `string`, so the cast 
to double is not a "lossless cast". RexSimplify now considers this while 
simplifying calls, e.g. `isSafeExpression` visitor (used by 
`simplifyIs[Not]Null`) now checks `RexUtil.isLosslessCast`, so basically the 
simplification of certain expressions involving "lossless casts" are now 
"aborted" and won't happen.
   



-- 
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.

To unsubscribe, e-mail: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to