julianhyde commented on a change in pull request #1117: [CALCITE-2921] support 
null literal in function call
URL: https://github.com/apache/calcite/pull/1117#discussion_r309939693
 
 

 ##########
 File path: core/src/test/resources/sql/sub-query.iq
 ##########
 @@ -32,7 +32,7 @@ where t1.x not in (select t2.x from t2);
 (0 rows)
 
 !ok
-EnumerableCalc(expr#0..4=[{inputs}], expr#5=[0], expr#6=[=($t1, $t5)], 
expr#7=[<>($t1, $t5)], expr#8=[IS NULL($t4)], expr#9=[>=($t2, $t1)], 
expr#10=[IS NOT NULL($t0)], expr#11=[AND($t7, $t8, $t9, $t10)], 
expr#12=[OR($t6, $t11)], X=[$t0], $condition=[$t12])
+EnumerableCalc(expr#0..4=[{inputs}], expr#5=[0], expr#6=[=($t1, $t5)], 
expr#7=[IS NULL($t4)], expr#8=[>=($t2, $t1)], expr#9=[IS NOT NULL($t0)], 
expr#10=[AND($t7, $t8, $t9)], expr#11=[OR($t6, $t10)], X=[$t0], 
$condition=[$t11])
 
 Review comment:
   You're right to be concerned. But I did some investigation and I think this 
is OK.
   
   There are some places in rules (e.g. `SubQueryRemoveRule`) where we create 
raw null values (using `RelBuilder.literal(null)`). With this new 
type-inference logic, those null literals can now be converted to typed nulls, 
and therefore the plans get better.
   
   But we should not be relying on type-inference. I have made a pass over the 
code to ensure that when we create null literals internally, we give them a 
type.

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


With regards,
Apache Git Services

Reply via email to