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/14 10:14:39 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1902: [KYUUBI #1886] Add GetSchemas for trino engine

yaooqinn commented on a change in pull request #1902:
URL: https://github.com/apache/incubator-kyuubi/pull/1902#discussion_r805689268



##########
File path: externals/kyuubi-trino-engine/src/test/scala/org/apache/kyuubi/engine/trino/operation/TrinoOperationSuite.scala
##########
@@ -71,6 +71,72 @@ class TrinoOperationSuite extends WithTrinoEngine with HiveJDBCTestHelper {
     }
   }
 
+  test("trino - get schemas") {
+    case class SchemaWithCatalog(catalog: String, schema: String)
+
+    withJdbcStatement() { statement =>
+      statement.execute("CREATE SCHEMA IF NOT EXISTS memory.test_escape_1")
+      statement.execute("CREATE SCHEMA IF NOT EXISTS memory.test2escape_1")
+      statement.execute("CREATE SCHEMA IF NOT EXISTS memory.test_escape11")
+
+      val meta = statement.getConnection.getMetaData
+      val resultSetBuffer = ArrayBuffer[SchemaWithCatalog]()
+
+      val schemas1 = meta.getSchemas(null, null)
+      while (schemas1.next()) {
+        resultSetBuffer +=
+          SchemaWithCatalog(schemas1.getString(TABLE_CATALOG), schemas1.getString(TABLE_SCHEM))
+      }
+      assert(resultSetBuffer.contains(SchemaWithCatalog("memory", "information_schema")))
+      assert(resultSetBuffer.contains(SchemaWithCatalog("system", "information_schema")))

Review comment:
       do trino-jdbc or trino-cli modles expose system tables/dbs to end-users?




-- 
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