NobiGo commented on code in PR #4057:
URL: https://github.com/apache/calcite/pull/4057#discussion_r1862050071


##########
core/src/test/resources/sql/sub-query.iq:
##########
@@ -3448,13 +3448,13 @@ select * from "scott".emp where empno not in (null, 
7782);
 
 !ok
 
-EnumerableCalc(expr#0..12=[{inputs}], expr#13=[0:BIGINT], expr#14=[=($t8, 
$t13)], expr#15=[IS NULL($t12)], expr#16=[>=($t9, $t8)], expr#17=[AND($t15, 
$t16)], expr#18=[OR($t14, $t17)], proj#0..7=[{exprs}], $condition=[$t18])
+EnumerableCalc(expr#0..12=[{inputs}], expr#13=[0], expr#14=[=($t8, $t13)], 
expr#15=[IS NULL($t12)], expr#16=[>=($t9, $t8)], expr#17=[AND($t15, $t16)], 
expr#18=[OR($t14, $t17)], proj#0..7=[{exprs}], $condition=[$t18])

Review Comment:
   Hi @mihaibudiu, I check the code. These two places build the literal 0 with 
different methods,
   In SqlToRel:
   ```
   final RelDataType longType =typeFactory.createSqlType(SqlTypeName.BIGINT);
   final RexLiteral zero =rexBuilder.makeExactLiteral(BigDecimal.ZERO, 
longType);
   ```
   In SubqueryRemoveRule:
   ```
   builder.literal(0)
   ```
   Because need to compare with the value of COUNT, the first one is more 
reasonable.



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

Reply via email to