XComp commented on code in PR #21971:
URL: https://github.com/apache/flink/pull/21971#discussion_r1190867729


##########
flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/connector/datagen/table/SequenceGeneratorVisitor.java:
##########
@@ -82,25 +81,11 @@ public SequenceGeneratorVisitor(String name, ReadableConfig 
config) {
         ConfigOptions.OptionBuilder startKey = key(startKeyStr);
         ConfigOptions.OptionBuilder endKey = key(endKeyStr);
 
-        config.getOptional(startKey.stringType().noDefaultValue())
-                .orElseThrow(
-                        () ->
-                                new ValidationException(
-                                        "Could not find required property '"
-                                                + startKeyStr
-                                                + "' for sequence 
generator."));
-        config.getOptional(endKey.stringType().noDefaultValue())
-                .orElseThrow(
-                        () ->
-                                new ValidationException(
-                                        "Could not find required property '"
-                                                + endKeyStr
-                                                + "' for sequence 
generator."));
-
-        this.intStart = startKey.intType().noDefaultValue();
-        this.intEnd = endKey.intType().noDefaultValue();
-        this.longStart = startKey.longType().noDefaultValue();
-        this.longEnd = endKey.longType().noDefaultValue();
+        // Under sequence, if end and start are not set, the default value is 
used
+        this.intStart = startKey.intType().defaultValue(0);
+        this.intEnd = endKey.intType().defaultValue(Integer.MAX_VALUE);
+        this.longStart = startKey.longType().defaultValue(0L);
+        this.longEnd = endKey.longType().defaultValue((long) 
Integer.MAX_VALUE);

Review Comment:
   With the shortcomings that are going to be fixed in FLINK-31192, I'm 
wondering whether we should lower the default max value for now to avoid 
generating to many elements in memory. WDYT? :thinking: We could update the 
default values as soon as the data generation is called incrementally.



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