zstan commented on PR #3203:
URL: https://github.com/apache/calcite/pull/3203#issuecomment-1562446539

   > Sorry for the late reply. I make some tests in my local environment. The 
optimization for `BinaryExpression` seems to be incorrect. The code after 
optimization throws compilation error.
   > 
   > ```
   >         Boolean a = true || null;
   >         Boolean b = null || true;
   > ```
   @DonnyZone thanks for reply
   
   I can\`t obtain such a code after optimization ( can you show me how can i 
make it ?
   
   final ParameterExpression x_ = Expressions.parameter(Object.class, "x");
   BinaryExpression y1 = Expressions.orElse(Expressions.constant(true), 
Expressions.constant(null));
   DeclarationStatement exp0 = Expressions.declare(Modifier.PUBLIC, x_, y1);
   
   assertEquals("{\n  public Object x = true;\n}\n",
           optimize(exp0))
   
   after optimization shows:
   public Object x = true;
   


-- 
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: commits-unsubscr...@calcite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to