dybyte commented on code in PR #9642:
URL: https://github.com/apache/seatunnel/pull/9642#discussion_r2250845797
##########
seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/config/RedisSourceOptions.java:
##########
@@ -51,6 +51,6 @@ public enum HashKeyParseMode {
public static final Option<String> KEY_FIELD_NAME =
Options.key("key_field_name")
.stringType()
- .defaultValue("key")
- .withDescription("The value of key you want to write to
redis.");
+ .noDefaultValue()
Review Comment:
I’d like to confirm one point regarding how we handle the default value of
`key_field_name`.
Since the default value depends on the `data_type` (e.g., `"hash_key"` for
`hash` type, `"key"` for others when `read_key_enabled` is true), I
intentionally used `.noDefaultValue()` in the Option definition:
```java
public static final Option<String> KEY_FIELD_NAME =
Options.key("key_field_name")
.stringType()
.noDefaultValue()
.withDescription("Specifies the key field name to be used in
the output row.");
```
Then I set the appropriate default value conditionally in
`RedisParameters.buildWithConfig()`.
Do you think this is the correct approach? Or is there a better way to apply
conditional default values in the Option system?
Thanks in advance!
--
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]