nzw921rx commented on code in PR #11032:
URL: https://github.com/apache/seatunnel/pull/11032#discussion_r3655441442


##########
seatunnel-connectors-v2/connector-fake/src/main/java/org/apache/seatunnel/connectors/seatunnel/fake/source/FakeSourceFactory.java:
##########
@@ -110,9 +132,110 @@ public OptionRule optionRule() {
                 .conditional(BIGINT_FAKE_MODE, 
FakeSourceOptions.FakeMode.TEMPLATE, BIGINT_TEMPLATE)
                 .conditional(FLOAT_FAKE_MODE, 
FakeSourceOptions.FakeMode.TEMPLATE, FLOAT_TEMPLATE)
                 .conditional(DOUBLE_FAKE_MODE, 
FakeSourceOptions.FakeMode.TEMPLATE, DOUBLE_TEMPLATE)
+                .optional(
+                        TINYINT_MIN,
+                        greaterOrEqual(TINYINT_MIN, TINYINT_MIN.defaultValue())
+                                .and(lessOrEqual(TINYINT_MIN, 
TINYINT_MAX.defaultValue())))
+                .optional(
+                        TINYINT_MAX,
+                        greaterOrEqual(TINYINT_MAX, TINYINT_MIN.defaultValue())
+                                .and(lessOrEqual(TINYINT_MAX, 
TINYINT_MAX.defaultValue())))
+                .optional(
+                        SMALLINT_MIN,
+                        greaterOrEqual(SMALLINT_MIN, 
SMALLINT_MIN.defaultValue())
+                                .and(lessOrEqual(SMALLINT_MIN, 
SMALLINT_MAX.defaultValue())))
+                .optional(
+                        SMALLINT_MAX,
+                        greaterOrEqual(SMALLINT_MAX, 
SMALLINT_MIN.defaultValue())
+                                .and(lessOrEqual(SMALLINT_MAX, 
SMALLINT_MAX.defaultValue())))
+                .optional(
+                        INT_MIN,
+                        greaterOrEqual(INT_MIN, INT_MIN.defaultValue())
+                                .and(lessOrEqual(INT_MIN, 
INT_MAX.defaultValue())))
+                .optional(
+                        INT_MAX,
+                        greaterOrEqual(INT_MAX, INT_MIN.defaultValue())
+                                .and(lessOrEqual(INT_MAX, 
INT_MAX.defaultValue())))
+                .optional(
+                        BIGINT_MIN,
+                        greaterOrEqual(BIGINT_MIN, BIGINT_MIN.defaultValue())
+                                .and(lessOrEqual(BIGINT_MIN, 
BIGINT_MAX.defaultValue())))
+                .optional(
+                        BIGINT_MAX,
+                        greaterOrEqual(BIGINT_MAX, BIGINT_MIN.defaultValue())
+                                .and(lessOrEqual(BIGINT_MAX, 
BIGINT_MAX.defaultValue())))
+                .optional(
+                        FLOAT_MIN,
+                        greaterOrEqual(FLOAT_MIN, FLOAT_MIN.defaultValue())
+                                .and(lessOrEqual(FLOAT_MIN, 
FLOAT_MAX.defaultValue())))
+                .optional(
+                        FLOAT_MAX,
+                        greaterOrEqual(FLOAT_MAX, FLOAT_MIN.defaultValue())
+                                .and(lessOrEqual(FLOAT_MAX, 
FLOAT_MAX.defaultValue())))
+                .optional(
+                        DOUBLE_MIN,
+                        greaterOrEqual(DOUBLE_MIN, DOUBLE_MIN.defaultValue())
+                                .and(lessOrEqual(DOUBLE_MIN, 
DOUBLE_MAX.defaultValue())))
+                .optional(
+                        DOUBLE_MAX,
+                        greaterOrEqual(DOUBLE_MAX, DOUBLE_MIN.defaultValue())
+                                .and(lessOrEqual(DOUBLE_MAX, 
DOUBLE_MAX.defaultValue())))
+                .optional(
+                        VECTOR_FLOAT_MIN,
+                        greaterOrEqual(VECTOR_FLOAT_MIN, 
VECTOR_FLOAT_MIN.defaultValue())
+                                .and(
+                                        lessOrEqual(
+                                                VECTOR_FLOAT_MIN, 
VECTOR_FLOAT_MAX.defaultValue())))
+                .optional(
+                        VECTOR_FLOAT_MAX,
+                        greaterOrEqual(VECTOR_FLOAT_MAX, 
VECTOR_FLOAT_MIN.defaultValue())
+                                .and(
+                                        lessOrEqual(
+                                                VECTOR_FLOAT_MAX, 
VECTOR_FLOAT_MAX.defaultValue())))
+                .valueConstraint(

Review Comment:
   Thank you for your contribution
   The existing `optional`, `required`, and `conditional` in this scenario can 
also express this meaning, and it seems that there is no need to add an API,
   
   - The following case illustrates the following verification process when a 
user passes in Tableau CONFIGS
   
   examples: 
   
   ``` java
   .optional(
                           ConnectorCommonOptions.TABLE_CONFIGS,
                           Conditions.extension(
                                   ConnectorCommonOptions.TABLE_CONFIGS, new 
TableConfigsValidationExtension()))
   ```
   



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