zenozeng commented on a change in pull request #4029:
URL: https://github.com/apache/zeppelin/pull/4029#discussion_r561616614



##########
File path: jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
##########
@@ -513,7 +513,7 @@ public Connection getConnection(String dbPrefix, 
InterpreterContext context)
     String url = properties.getProperty(URL_KEY);
     String connectionUrl = appendProxyUserToURL(url, user, dbPrefix);
 
-    String authType = properties.getProperty("zeppelin.jdbc.auth.type", 
"SIMPLE")
+    String authType = 
StringUtils.defaultIfEmpty(getProperty("zeppelin.jdbc.auth.type"), "SIMPLE")

Review comment:
       Without `StringUtils.defaultIfEmpty`, jdbcIntegrationTest will fail, see 
also:
   https://github.com/apache/zeppelin/runs/1728251503
   
   If `zeppelin.jdbc.auth.type` is empty string (`""`), 
`properties.getProperty("zeppelin.jdbc.auth.type", "SIMPLE")` will return `""`.
   But `defaultIfEmpty(T str, T defaultStr)` returns the value of defaultStr 
the CharSequence is empty or null.

##########
File path: jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
##########
@@ -513,7 +513,7 @@ public Connection getConnection(String dbPrefix, 
InterpreterContext context)
     String url = properties.getProperty(URL_KEY);
     String connectionUrl = appendProxyUserToURL(url, user, dbPrefix);
 
-    String authType = properties.getProperty("zeppelin.jdbc.auth.type", 
"SIMPLE")
+    String authType = 
StringUtils.defaultIfEmpty(getProperty("zeppelin.jdbc.auth.type"), "SIMPLE")

Review comment:
       @zjffdu Without `StringUtils.defaultIfEmpty`, jdbcIntegrationTest will 
fail, see also:
   https://github.com/apache/zeppelin/runs/1728251503
   
   If `zeppelin.jdbc.auth.type` is empty string (`""`), 
`properties.getProperty("zeppelin.jdbc.auth.type", "SIMPLE")` will return `""`.
   But `defaultIfEmpty(T str, T defaultStr)` returns the value of defaultStr 
the CharSequence is empty or null.

##########
File path: jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
##########
@@ -513,7 +513,7 @@ public Connection getConnection(String dbPrefix, 
InterpreterContext context)
     String url = properties.getProperty(URL_KEY);
     String connectionUrl = appendProxyUserToURL(url, user, dbPrefix);
 
-    String authType = properties.getProperty("zeppelin.jdbc.auth.type", 
"SIMPLE")
+    String authType = 
StringUtils.defaultIfEmpty(getProperty("zeppelin.jdbc.auth.type"), "SIMPLE")

Review comment:
       @zjffdu Without `StringUtils.defaultIfEmpty`, jdbcIntegrationTest will 
fail, see also:
   https://github.com/apache/zeppelin/runs/1728251503
   
   If `zeppelin.jdbc.auth.type` is empty string (`""`), 
`properties.getProperty("zeppelin.jdbc.auth.type", "SIMPLE")` will return `""`.
   But `defaultIfEmpty(T str, T defaultStr)` returns the value of defaultStr if 
the CharSequence is empty or null.

##########
File path: jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
##########
@@ -513,7 +513,7 @@ public Connection getConnection(String dbPrefix, 
InterpreterContext context)
     String url = properties.getProperty(URL_KEY);
     String connectionUrl = appendProxyUserToURL(url, user, dbPrefix);
 
-    String authType = properties.getProperty("zeppelin.jdbc.auth.type", 
"SIMPLE")
+    String authType = 
StringUtils.defaultIfEmpty(getProperty("zeppelin.jdbc.auth.type"), "SIMPLE")

Review comment:
       @zjffdu DONE




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to