From 51067384afebc7016af108b535663575ff83d1ec Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Fri, 13 May 2022 10:06:34 +0800 Subject: [PATCH] [KYUUBI #2640] Implement TGetInfoType CLI_ODBC_KEYWORDS ### _Why are the changes needed?_ Fix #2637 ### _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 Closes #2640 from pan3793/odbc. Closes #2640 a798271b [Cheng Pan] Implement TGetInfoType CLI_ODBC_KEYWORDS Authored-by: Cheng Pan Signed-off-by: Cheng Pan (cherry picked from commit 8de2f5f17fa909979294a879503700bd3b083df0) Signed-off-by: Cheng Pan --- .../main/scala/org/apache/kyuubi/session/AbstractSession.scala | 1 + .../scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala | 2 ++ 2 files changed, 3 insertions(+) diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/session/AbstractSession.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/session/AbstractSession.scala index f3be78e1bca..46324d22e10 100644 --- a/kyuubi-common/src/main/scala/org/apache/kyuubi/session/AbstractSession.scala +++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/session/AbstractSession.scala @@ -106,6 +106,7 @@ abstract class AbstractSession( case TGetInfoType.CLI_SERVER_NAME => TGetInfoValue.stringValue("Apache Kyuubi (Incubating)") case TGetInfoType.CLI_DBMS_NAME => TGetInfoValue.stringValue("Apache Kyuubi (Incubating)") case TGetInfoType.CLI_DBMS_VER => TGetInfoValue.stringValue(org.apache.kyuubi.KYUUBI_VERSION) + case TGetInfoType.CLI_ODBC_KEYWORDS => TGetInfoValue.stringValue("Unimplemented") case TGetInfoType.CLI_MAX_COLUMN_NAME_LEN | TGetInfoType.CLI_MAX_SCHEMA_NAME_LEN | TGetInfoType.CLI_MAX_TABLE_NAME_LEN => TGetInfoValue.lenValue(128) diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala index 4bf5dec8cba..44b3f2ed3bc 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala @@ -172,6 +172,8 @@ class TFrontendServiceSuite extends KyuubiFunSuite { assert(client.GetInfo(req).getInfoValue.getStringValue === "Apache Kyuubi (Incubating)") req.setInfoType(TGetInfoType.CLI_DBMS_NAME) assert(client.GetInfo(req).getInfoValue.getStringValue === "Apache Kyuubi (Incubating)") + req.setInfoType(TGetInfoType.CLI_ODBC_KEYWORDS) + assert(client.GetInfo(req).getInfoValue.getStringValue === "Unimplemented") req.setInfoType(TGetInfoType.CLI_MAX_COLUMN_NAME_LEN) assert(client.GetInfo(req).getInfoValue.getLenValue === 128) req.setInfoType(TGetInfoType.CLI_MAX_SCHEMA_NAME_LEN)