pan3793 commented on code in PR #7419:
URL: https://github.com/apache/kyuubi/pull/7419#discussion_r3153990434


##########
externals/kyuubi-jdbc-engine/src/main/scala/org/apache/kyuubi/engine/jdbc/operation/JdbcOperationManager.scala:
##########
@@ -91,7 +93,12 @@ class JdbcOperationManager(conf: KyuubiConf) extends 
OperationManager("JdbcOpera
       schemaName: String,
       tableName: String,
       tableTypes: util.List[String]): Operation = {
-    val query = dialect.getTablesQuery(catalogName, schemaName, tableName, 
tableTypes)
+    val effectiveSchema = if (StringUtils.isBlank(schemaName) || schemaName == 
"%") {
+      session.asInstanceOf[JdbcSessionImpl].effectiveDatabase.orNull
+    } else {
+      schemaName
+    }
+    val query = dialect.getTablesQuery(catalogName, effectiveSchema, 
tableName, tableTypes)

Review Comment:
   I don't recall the details of the initial code of this part, but the API 
looks problematic.
   
   the Hive Thrift GetTablesOperation API is derived from the JDBC API, and 
that's why they look almost identical, for JDBC engine, such a call should 
directly map to the JDBC API instead of requesting a SQL (if you take a look at 
the JDBC driver implementation, you may find some impls are non-SQL-based), the 
current design complicates the whole thing.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to