hanyuzheng7 commented on code in PR #29624:
URL: https://github.com/apache/flink/pull/29624#discussion_r4401915576


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/common/CommonExecValues.java:
##########
@@ -69,16 +71,36 @@ protected Transformation<RowData> translateToPlanInternal(
                         (RowType) getOutputType(),
                         tuples,
                         getClass().getSimpleName());
-        final Transformation<RowData> transformation =
-                planner.getExecEnv()
-                        .createInput(inputFormat, 
inputFormat.getProducedType())
-                        .getTransformation();
+        final Transformation<RowData> transformation;
+        // Without rows, VALUES keeps the legacy source: a DataGeneratorSource 
emits at least one.
+        if (legacySourceEnabled() || tuples.isEmpty()) {

Review Comment:
   Done, it's in the first two commits now. `NumberSequenceSource` accepts to 
== from - 1 as an empty sequence (not only -1, so it works for any from), and 
`DataGeneratorSource` generates no data points for a count of 0 or less. So 
VALUES without rows runs as a `ValuesSource` too, and `CommonExecValues` 
doesn't need the special case.
   



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