MusbahELFIL opened a new pull request #1286: CALCITE-3155 : Fixing bug in the 
unparse of UNION_ALL SqlSetOperator when it has no operands
URL: https://github.com/apache/calcite/pull/1286
 
 
   when we have a query of the form "select X from TEST_TABLE where Y= ( select 
Z from TEST-TABLE2 where 1=2), when converting to a RelNode, the plan contains 
a LogicalValues with no tuples (which is correct since the right hand side 
should return no tuples).
   
   When converting the above RelNode to an SqlNode the LogicalValues is being 
converted to a UNION_ALL operator with no operands. Its toString() method which 
is called when doing an unparse (when converting the generated SqlNode back to 
an SQL string) is throwing an exception (since it has no tuples).
   
   The fix converts the values with no tuples to a "select NULL, NULL ... from 
DUAL"

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