electrum commented on a change in pull request #3694: [ZEPPELIN-2891]. 
Impossible to use jdbc interface with presto-jdbc >=0.180
URL: https://github.com/apache/zeppelin/pull/3694#discussion_r395433276
 
 

 ##########
 File path: jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
 ##########
 @@ -407,7 +408,33 @@ private void setUserProperty(String propertyKey, 
InterpreterContext interpreterC
   }
 
   private void createConnectionPool(String url, String user, String 
propertyKey,
-      Properties properties) throws SQLException, ClassNotFoundException {
+      Properties properties) throws SQLException, ClassNotFoundException, 
IOException {
+
+    String driverClass = properties.getProperty(DRIVER_KEY);
+    if (driverClass != null && 
(driverClass.equals("com.facebook.presto.jdbc.PrestoDriver")
+            || driverClass.equals("io.prestosql.jdbc.PrestoDriver"))) {
+      Properties newProperties = new Properties();
+      // Only add valid properties otherwise presto won't work.
+      try {
+        Class clazz = null;
+        try {
+          clazz = 
Class.forName("com.facebook.presto.jdbc.ConnectionProperties");
+        } catch (ClassNotFoundException e) {
+          clazz = Class.forName("io.prestosql.jdbc.ConnectionProperties");
+        }
+        Method lookUpKeyMethod = clazz.getMethod("forKey", String.class);
 
 Review comment:
   I don’t foresee us removing properties, as we take backwards compatibility 
seriously. I believe the main issue here was not validation of arbitrary 
properties, but that Zeppelin was adding its own properties like “url”. If we 
can avoid that, then we shouldn’t need to worry about validation.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to