You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2021/10/22 04:25:44 UTC

[zeppelin] branch branch-0.10 updated: [ZEPPELIN-5551] add support for trino driver for recent versions

This is an automated email from the ASF dual-hosted git repository.

zjffdu pushed a commit to branch branch-0.10
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/branch-0.10 by this push:
     new 0c6f6fc  [ZEPPELIN-5551] add support for trino driver for recent versions
0c6f6fc is described below

commit 0c6f6fc17ac2cdbf10f75f52fbb1772bc289a14d
Author: jaeho.yoo <ja...@navercorp.com>
AuthorDate: Tue Oct 12 20:40:38 2021 +0900

    [ZEPPELIN-5551] add support for trino driver for recent versions
    
    ### What is this PR for?
    
    - Prestosql has changed its name to Trino in 2020.12 and Trino no longer supports the name `io.prestosql.jdbc.PrestoDriver` and has been removed in v358.
    - Adds support for trino drivers for v358 and above
    - Users can now use trino named driver for driver name.
    
    ### What type of PR is it?
    
    - Bug Fix
    
    ### What is the Jira issue?
    
    https://issues.apache.org/jira/browse/ZEPPELIN-5551
    
    ### How should this be tested?
    * Test if JDBC Interpreter works for trino/presto
    
    ### Screenshots (if appropriate)
    
    ![image](https://user-images.githubusercontent.com/25147023/137051013-c3a65d30-9b52-4212-8c13-b7b54a7cbe3a.png)
    ![image](https://user-images.githubusercontent.com/25147023/137051018-6f2c656c-4b16-410b-963c-d6ec292e01b0.png)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: jaeho.yoo <ja...@navercorp.com>
    
    Closes #4253 from Chaho12/feature/jaeho.yoo/support_trino_jdbc and squashes the following commits:
    
    8da748ec06 [jaeho.yoo] add support for trino driver for recent versions
---
 jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
index 3af326d..58068e2 100644
--- a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
+++ b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
@@ -473,10 +473,14 @@ public class JDBCInterpreter extends KerberosInterpreter {
     LOGGER.info("Creating connection pool for url: {}, user: {}, dbPrefix: {}, properties: {}",
             url, user, dbPrefix, properties);
 
+    /* Remove properties that is not valid properties for presto/trino by checking driver key.
+     * - Presto: com.facebook.presto.jdbc.PrestoDriver
+     * - Trino(ex. PrestoSQL): io.trino.jdbc.TrinoDriver / io.prestosql.jdbc.PrestoDriver
+     */
     String driverClass = properties.getProperty(DRIVER_KEY);
     if (driverClass != null && (driverClass.equals("com.facebook.presto.jdbc.PrestoDriver")
-            || driverClass.equals("io.prestosql.jdbc.PrestoDriver"))) {
-      // Only add valid properties otherwise presto won't work.
+            || driverClass.equals("io.prestosql.jdbc.PrestoDriver")
+            || driverClass.equals("io.trino.jdbc.TrinoDriver"))) {
       for (String key : properties.stringPropertyNames()) {
         if (!PRESTO_PROPERTIES.contains(key)) {
           properties.remove(key);