Hisoka-X commented on code in PR #8841:
URL: https://github.com/apache/seatunnel/pull/8841#discussion_r1971440353


##########
seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/config/RedisParameters.java:
##########
@@ -65,10 +65,14 @@ public class RedisParameters implements Serializable {
     private int redisVersion;
 
     public void buildWithConfig(ReadonlyConfig config) {
-        // set host
-        this.host = config.get(RedisBaseOptions.HOST);
-        // set port
-        this.port = config.get(RedisBaseOptions.PORT);
+        if (config.getOptional(RedisBaseOptions.HOST).isPresent()) {
+            // set host
+            this.host = config.get(RedisBaseOptions.HOST);
+        }
+        if (config.getOptional(RedisBaseOptions.PORT).isPresent()) {
+            // set port
+            this.port = config.get(RedisBaseOptions.PORT);
+        }

Review Comment:
   I mean this part you changed the bahavior is same as before you change.
   When host existed, get host value and set to this.host, when host not 
existed, the host value would set to null. So I think the change of this part 
is unnecessary.



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