You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/02/16 01:35:43 UTC

[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #1912: [KYUUBI #1911] Add GetTypeInfo for trino engine

ulysses-you commented on a change in pull request #1912:
URL: https://github.com/apache/incubator-kyuubi/pull/1912#discussion_r807460208



##########
File path: externals/kyuubi-trino-engine/src/test/scala/org/apache/kyuubi/engine/trino/operation/TrinoOperationSuite.scala
##########
@@ -45,6 +46,61 @@ class TrinoOperationSuite extends WithTrinoEngine with HiveJDBCTestHelper {
 
   override protected def jdbcUrl: String = getJdbcUrl
 
+  test("trino - get type info") {
+    withJdbcStatement() { statement =>
+      val typeInfo = statement.getConnection.getMetaData.getTypeInfo
+      val types = Set(
+        BIGINT,
+        INTEGER,
+        SMALLINT,
+        TINYINT,
+        BOOLEAN,
+        DATE,
+        DECIMAL,
+        REAL,
+        DOUBLE,
+        HYPER_LOG_LOG,
+        QDIGEST,
+        P4_HYPER_LOG_LOG,
+        INTERVAL_DAY_TO_SECOND,
+        INTERVAL_YEAR_TO_MONTH,
+        TIMESTAMP,
+        TIMESTAMP_WITH_TIME_ZONE,
+        TIME,
+        TIME_WITH_TIME_ZONE,
+        VARBINARY,
+        VARCHAR,
+        CHAR,
+        ROW,
+        ARRAY,
+        MAP,
+        JSON,
+        IPADDRESS,
+        UUID,
+        GEOMETRY,
+        SPHERICAL_GEOGRAPHY,
+        BING_TILE,
+        "color",
+        "KdbTree",
+        "CodePoints",
+        "JsonPath",
+        "Regressor",
+        "JoniRegExp",
+        "unknown",
+        "ObjectId",
+        "SetDigest",
+        "Re2JRegExp",
+        "Model",
+        "tdigest",
+        "LikePattern",
+        "function",
+        "Classifier")
+      while (typeInfo.next()) {
+        assert(types.contains(typeInfo.getString(TYPE_NAME)))
+      }

Review comment:
       Shall we add a check for the total type size ? It would be helpful to detect the implicit change.
   ```scala
   while (typeInfo.next()) {
     assert(types.contains(typeInfo.getString(TYPE_NAME)))
     i += 1
   }
   assert(types.size == i)
   ```




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

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