liunaijie commented on code in PR #9574:
URL: https://github.com/apache/seatunnel/pull/9574#discussion_r2222810568


##########
seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/source/RedisSourceFactory.java:
##########
@@ -54,7 +54,10 @@ public OptionRule optionRule() {
                         RedisSourceOptions.HASH_KEY_PARSE_MODE,
                         RedisBaseOptions.AUTH,
                         RedisBaseOptions.USER,
-                        RedisBaseOptions.KEY)
+                        RedisBaseOptions.KEY,
+                        RedisSourceOptions.READ_KEY_ENABLED,
+                        RedisSourceOptions.SINGLE_FIELD_NAME,
+                        RedisSourceOptions.KEY_FIELD_NAME)

Review Comment:
   the `optionRule` method can used in:
   
   1. runtime validation 
   only requires `single_field_name` when `read_key_enabled = true`, as 
`key_field_name` is optional due to its default value.
   In this case, we don't need set `key_field_name`
   2. configuration creation 
   e.g., in WebUI needs stricter rules:
           when enabling read_key_enabled:
           show key_field_name input with pre-filled default (key)
           show single_field_name as required empty field (must be explicitly 
set)
           block config submission until single_field_name is provided
   In this case, we need set `key_field_name` and `single_field_name` are 
required when `read_key_enabled=true`
   
   
   
   Given the second scenario, it's advisable to explicitly set both parameters.
   
   



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