hsyuan commented on a change in 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#discussion_r298811054
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java
 ##########
 @@ -390,7 +390,22 @@ public Result visit(Values e) {
                 new SqlIdentifier("DUAL", POS), null, null,
                 null, null, null, null, null));
       }
-      if (list.size() == 1) {
+      if (list.isEmpty()) {
+        //In this case we need to construct the following query:
+        // SELECT NULL as C0, NULL as C1, NULL as C2 ... FROM DUAL WHERE FALSE
+        //This would return an empty result set with the same number of 
columns as the field names.
 
 Review comment:
   Please leave a space after //

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