fcb-xiaobo commented on code in PR #8841:
URL: https://github.com/apache/seatunnel/pull/8841#discussion_r1971396421


##########
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:
   > The behavior before is same as this patch. Because when host or port not 
configured, `config.get(RedisBaseOptions.HOST)` will return null.
   
   Thank you for your review. I have tested locally that when the host and port 
are not configured, if the condition is judged as false, the situation you 
mentioned will not occur. Is that my understanding correct? However, I have 
discovered another issue that I will update and fix later
   



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