zjffdu 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_r395441410
##########
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:
Thanks for your conform
----------------------------------------------------------------
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