DonnyZone commented on a change in pull request #1347: [CALCITE-3224] New 
RexNode-to-Expression CodeGen Implementation
URL: https://github.com/apache/calcite/pull/1347#discussion_r355250676
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/test/JdbcTest.java
 ##########
 @@ -2451,12 +2451,14 @@ private void 
checkNullableTimestamp(CalciteAssert.Config config) {
     CalciteAssert.hr()
         .query(
             "select upper((case when \"empid\">\"deptno\"*10 then 'y' else 
null end)) T from \"hr\".\"emps\"")
-        .planContains("static final String "
-            + "$L4J$C$org_apache_calcite_runtime_SqlFunctions_upper_y_ = "
-            + "org.apache.calcite.runtime.SqlFunctions.upper(\"y\");")
-        .planContains("return current.empid <= current.deptno * 10 "
-            + "? (String) null "
-            + ": $L4J$C$org_apache_calcite_runtime_SqlFunctions_upper_y_;")
+        .planContains("      String case_when_value;\n"
 
 Review comment:
   The new codegen framework can naturally reuses expressions, due to:
   It removes the mutable state (i.e., `Map<? extends RexNode, Boolean> 
exprNullableMap`), and generates code strictly corresonding to RexNode in 
one-to-one manner. 
   
   Therefore, the redundant code vaused by tranversing with mutable state will 
not be produced again in the new codegen. On the other hand, we also keep a map 
in `RexToLixTranslator` for same RexNode's code reuse.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to