You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2023/01/04 08:24:03 UTC

[GitHub] [kyuubi] Yikf opened a new pull request, #4081: [KYUUBI #4080] Support GetTables for Trino Fe

Yikf opened a new pull request, #4081:
URL: https://github.com/apache/kyuubi/pull/4081

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
     2. If the PR is related to an issue in https://github.com/apache/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   Close https://github.com/apache/kyuubi/issues/4080, This pr aims to support `GetTables` for Trino Fe
   
   
   
   ### _How was this patch tested?_
   - [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] Yikf commented on a diff in pull request #4081: [KYUUBI #4080] Support GetTables for Trino Fe

Posted by GitBox <gi...@apache.org>.
Yikf commented on code in PR #4081:
URL: https://github.com/apache/kyuubi/pull/4081#discussion_r1061295487


##########
kyuubi-server/src/main/antlr4/org/apache/kyuubi/sql/KyuubiSqlBaseLexer.g4:
##########
@@ -59,12 +59,15 @@ GTE : '>=' | '!<';
 LEFT_PAREN: '(';
 RIGHT_PAREN: ')';
 OR: 'OR';
+SEARCH_STRING_ESCAPE: '\\\'' '\\\\' '\\\'';

Review Comment:
   It looks like trino's SQL is `\'\\\'` , https://github.com/trinodb/trino/blob/09fd18bb47154b88365327983ae58cdab433719b/client/trino-jdbc/src/main/java/io/trino/jdbc/TrinoDatabaseMetaData.java#L1633



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] ulysses-you commented on a diff in pull request #4081: [KYUUBI #4080] Support GetTables for Trino Fe

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #4081:
URL: https://github.com/apache/kyuubi/pull/4081#discussion_r1061280895


##########
kyuubi-server/src/main/antlr4/org/apache/kyuubi/sql/KyuubiTrinoFeBaseParser.g4:
##########
@@ -26,13 +26,42 @@ singleStatement
 statement
     : SELECT TABLE_SCHEM COMMA TABLE_CATALOG FROM SYSTEM_JDBC_SCHEMAS
       (WHERE (TABLE_CATALOG EQ catalog=STRING+)? AND? (TABLE_SCHEM LIKE schema=STRING+)?)?

Review Comment:
   we can change this to use the new pattern



##########
kyuubi-server/src/main/antlr4/org/apache/kyuubi/sql/KyuubiTrinoFeBaseParser.g4:
##########
@@ -26,13 +26,42 @@ singleStatement
 statement
     : SELECT TABLE_SCHEM COMMA TABLE_CATALOG FROM SYSTEM_JDBC_SCHEMAS
       (WHERE (TABLE_CATALOG EQ catalog=STRING+)? AND? (TABLE_SCHEM LIKE schema=STRING+)?)?
-      ORDER BY TABLE_CATALOG COMMA TABLE_SCHEM                                                #getSchemas
-    | SELECT TABLE_CAT FROM SYSTEM_JDBC_CATALOGS ORDER BY TABLE_CAT                           #getCatalogs
-    | SELECT TABLE_TYPE FROM SYSTEM_JDBC_TABLE_TYPES ORDER BY TABLE_TYPE                      #getTableTypes
+      ORDER BY TABLE_CATALOG COMMA TABLE_SCHEM                                                      #getSchemas
+    | SELECT TABLE_CAT FROM SYSTEM_JDBC_CATALOGS ORDER BY TABLE_CAT                                 #getCatalogs
+    | SELECT TABLE_TYPE FROM SYSTEM_JDBC_TABLE_TYPES ORDER BY TABLE_TYPE                            #getTableTypes
     | SELECT TYPE_NAME COMMA DATA_TYPE COMMA PRECISION COMMA LITERAL_PREFIX COMMA
       LITERAL_SUFFIX COMMA CREATE_PARAMS COMMA NULLABLE COMMA CASE_SENSITIVE COMMA
       SEARCHABLE COMMA UNSIGNED_ATTRIBUTE COMMA FIXED_PREC_SCALE COMMA AUTO_INCREMENT
       COMMA LOCAL_TYPE_NAME COMMA MINIMUM_SCALE COMMA MAXIMUM_SCALE COMMA SQL_DATA_TYPE
-      COMMA SQL_DATETIME_SUB COMMA NUM_PREC_RADIX FROM SYSTEM_JDBC_TYPES ORDER BY DATA_TYPE   #getTypeInfo
-    | .*?                                                                                     #passThrough
+      COMMA SQL_DATETIME_SUB COMMA NUM_PREC_RADIX FROM SYSTEM_JDBC_TYPES ORDER BY DATA_TYPE         #getTypeInfo
+    | SELECT TABLE_CAT COMMA TABLE_SCHEM COMMA TABLE_NAME COMMA TABLE_TYPE COMMA REMARKS COMMA
+      TYPE_CAT COMMA TYPE_SCHEM COMMA TYPE_NAME COMMA SELF_REFERENCING_COL_NAME COMMA REF_GENERATION
+      FROM SYSTEM_JDBC_TABLES
+      (WHERE tableCatalogFilter? AND? tableSchemaFilter? AND? tableNameFilter? AND? tableTypeFilter?)?
+      ORDER BY TABLE_TYPE COMMA TABLE_CAT COMMA TABLE_SCHEM COMMA TABLE_NAME                        #getTables
+    | .*?                                                                                           #passThrough
+    ;
+
+
+tableCatalogFilter
+    : TABLE_CAT IS NULL                                                                             #nulCatalog

Review Comment:
   nulCatalog -> nullCatalog ?



##########
kyuubi-server/src/main/antlr4/org/apache/kyuubi/sql/KyuubiSqlBaseLexer.g4:
##########
@@ -59,12 +59,15 @@ GTE : '>=' | '!<';
 LEFT_PAREN: '(';
 RIGHT_PAREN: ')';
 OR: 'OR';
+SEARCH_STRING_ESCAPE: '\\\'' '\\\\' '\\\'';

Review Comment:
   should it be `'\'\\\''` to match `'\'` ?



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] Yikf commented on a diff in pull request #4081: [KYUUBI #4080] Support GetTables for Trino Fe

Posted by GitBox <gi...@apache.org>.
Yikf commented on code in PR #4081:
URL: https://github.com/apache/kyuubi/pull/4081#discussion_r1061294859


##########
kyuubi-server/src/main/antlr4/org/apache/kyuubi/sql/KyuubiTrinoFeBaseParser.g4:
##########
@@ -26,13 +26,42 @@ singleStatement
 statement
     : SELECT TABLE_SCHEM COMMA TABLE_CATALOG FROM SYSTEM_JDBC_SCHEMAS
       (WHERE (TABLE_CATALOG EQ catalog=STRING+)? AND? (TABLE_SCHEM LIKE schema=STRING+)?)?

Review Comment:
   Yes, I plan file a new PR to change it



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] Yikf commented on a diff in pull request #4081: [KYUUBI #4080] Support GetTables for Trino Fe

Posted by GitBox <gi...@apache.org>.
Yikf commented on code in PR #4081:
URL: https://github.com/apache/kyuubi/pull/4081#discussion_r1062088387


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/parser/trino/KyuubiTrinoFeParserSuite.scala:
##########
@@ -108,4 +108,115 @@ class KyuubiTrinoFeParserSuite extends KyuubiFunSuite {
 
     assert(kyuubiTreeNode.isInstanceOf[GetTypeInfo])
   }
+
+  test("Support GetTables for Trino Fe") {
+    def check(
+        query: String,
+        catalog: String = null,
+        schema: String = null,
+        tableName: String = null,
+        types: List[String] = null,
+        emptyRes: Boolean = false): Unit = {
+      parse(query) match {
+        case GetTables(catalogName, schemaPattern, tableNamePattern, tableTypes, emptyResult) =>
+          assert(catalog == catalogName)
+          assert(schema == schemaPattern)
+          assert(tableName == tableNamePattern)
+          assert(types == tableTypes)
+          assert(emptyRes == emptyResult)
+        case _ => fail(s"Query $query parse failed. ")
+      }
+    }
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin)
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT IS NULL
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin)
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog'
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin,
+      catalog = "ykf_catalog")
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog' AND TABLE_SCHEM IS NULL
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin,
+      catalog = "ykf_catalog")
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog' AND TABLE_SCHEM LIKE '%aa' ESCAPE '\'
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin,
+      catalog = "ykf_catalog",
+      "%aa")
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog' AND TABLE_NAME LIKE '%aa' ESCAPE '\'
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin,
+      catalog = "ykf_catalog",
+      tableName = "%aa")
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog' AND TABLE_NAME LIKE '%aa' ESCAPE '\' AND FALSE
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin,
+      catalog = "ykf_catalog",
+      tableName = "%aa",
+      emptyRes = true)
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog' AND TABLE_SCHEM LIKE '%aa' ESCAPE '\' AND
+        | TABLE_TYPE IN ('ykf_type', 'ykf2_type') ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME

Review Comment:
   It seems to be identified `'\' AND TABLE_TYPE IN ('` instead of `SEARCH_STRING_ESCAPE  + AND + tableTypeFilter `, that is a errorToken, do you have any idea? @ulysses-you 



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] ulysses-you commented on a diff in pull request #4081: [KYUUBI #4080] Support GetTables for Trino Fe

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #4081:
URL: https://github.com/apache/kyuubi/pull/4081#discussion_r1062095405


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/parser/trino/KyuubiTrinoFeParserSuite.scala:
##########
@@ -108,4 +108,115 @@ class KyuubiTrinoFeParserSuite extends KyuubiFunSuite {
 
     assert(kyuubiTreeNode.isInstanceOf[GetTypeInfo])
   }
+
+  test("Support GetTables for Trino Fe") {
+    def check(
+        query: String,
+        catalog: String = null,
+        schema: String = null,
+        tableName: String = null,
+        types: List[String] = null,
+        emptyRes: Boolean = false): Unit = {
+      parse(query) match {
+        case GetTables(catalogName, schemaPattern, tableNamePattern, tableTypes, emptyResult) =>
+          assert(catalog == catalogName)
+          assert(schema == schemaPattern)
+          assert(tableName == tableNamePattern)
+          assert(types == tableTypes)
+          assert(emptyRes == emptyResult)
+        case _ => fail(s"Query $query parse failed. ")
+      }
+    }
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin)
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT IS NULL
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin)
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog'
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin,
+      catalog = "ykf_catalog")
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog' AND TABLE_SCHEM IS NULL
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin,
+      catalog = "ykf_catalog")
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog' AND TABLE_SCHEM LIKE '%aa' ESCAPE '\'
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin,
+      catalog = "ykf_catalog",
+      "%aa")
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog' AND TABLE_NAME LIKE '%aa' ESCAPE '\'
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin,
+      catalog = "ykf_catalog",
+      tableName = "%aa")
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog' AND TABLE_NAME LIKE '%aa' ESCAPE '\' AND FALSE
+        | ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
+        |""".stripMargin,
+      catalog = "ykf_catalog",
+      tableName = "%aa",
+      emptyRes = true)
+
+    check(
+      """
+        | SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS,
+        | TYPE_CAT, TYPE_SCHEM, TYPE_NAME,
+        | SELF_REFERENCING_COL_NAME, REF_GENERATION
+        | FROM system.jdbc.tables
+        | WHERE TABLE_CAT = 'ykf_catalog' AND TABLE_SCHEM LIKE '%aa' ESCAPE '\' AND
+        | TABLE_TYPE IN ('ykf_type', 'ykf2_type') ORDER BY TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME

Review Comment:
   seems `'\'` is strict, how about relaxing it to `stirngInValue` ?



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] ulysses-you commented on pull request #4081: [KYUUBI #4080] Support GetTables for Trino Fe

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on PR #4081:
URL: https://github.com/apache/kyuubi/pull/4081#issuecomment-1372081923

   thanks, merging to master


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] Yikf commented on pull request #4081: [KYUUBI #4080] Support GetTables for Trino Fe

Posted by GitBox <gi...@apache.org>.
Yikf commented on PR #4081:
URL: https://github.com/apache/kyuubi/pull/4081#issuecomment-1370613137

   cc @ulysses-you 


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] ulysses-you commented on a diff in pull request #4081: [KYUUBI #4080] Support GetTables for Trino Fe

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on code in PR #4081:
URL: https://github.com/apache/kyuubi/pull/4081#discussion_r1061298281


##########
kyuubi-server/src/main/antlr4/org/apache/kyuubi/sql/KyuubiSqlBaseLexer.g4:
##########
@@ -59,12 +59,15 @@ GTE : '>=' | '!<';
 LEFT_PAREN: '(';
 RIGHT_PAREN: ')';
 OR: 'OR';
+SEARCH_STRING_ESCAPE: '\\\'' '\\\\' '\\\'';

Review Comment:
   I test it locally, it print `'\'`
   ```java
   public static void main(String[] args) {
     StringBuilder b = new StringBuilder();
     quoteStringLiteral(b, "\\");
     System.out.println(b.toString());
   }
   
   private static void quoteStringLiteral(StringBuilder out, String value)
   {
     out.append('\'');
     for (int i = 0; i < value.length(); i++) {
        char c = value.charAt(i);
        out.append(c);
        if (c == '\'') {
           out.append('\'');
        }
     }
     out.append('\'');
   }
   ```



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] ulysses-you closed pull request #4081: [KYUUBI #4080] Support GetTables for Trino Fe

Posted by GitBox <gi...@apache.org>.
ulysses-you closed pull request #4081: [KYUUBI #4080] Support GetTables for Trino Fe
URL: https://github.com/apache/kyuubi/pull/4081


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org