File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
externals/kyuubi-jdbc-engine/src/main/scala/org/apache/kyuubi/engine/jdbc/dialect Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ class MySQLDialect extends JdbcDialect {
3636 statement
3737 }
3838
39+ override def getSchemasOperation (catalog : String , schema : String ): String = {
40+ return " select database()"
41+ }
42+
3943 override def getTablesQuery (
4044 catalog : String ,
4145 schema : String ,
@@ -60,8 +64,11 @@ class MySQLDialect extends JdbcDialect {
6064 filters += s " $TABLE_CATALOG = ' $catalog' "
6165 }
6266
63- if (StringUtils .isNotBlank(schema)) {
67+ // when DBeaver connect use %, kyuubi to return all tables from all other databases.
68+ if (StringUtils .isNotBlank(schema) && ! " %" .equals(schema)) {
6469 filters += s " $TABLE_SCHEMA LIKE ' $schema' "
70+ } else {
71+ filters += s " $TABLE_SCHEMA = database() "
6572 }
6673
6774 if (StringUtils .isNotBlank(tableName)) {
Original file line number Diff line number Diff line change @@ -26,4 +26,8 @@ class StarRocksDialect extends MySQLDialect {
2626
2727 override def getSchemaHelper (): SchemaHelper = new StarRocksSchemaHelper
2828
29+
30+ override def getCatalogsOperation (): String = {
31+ return " show catalogs"
32+ }
2933}
You can’t perform that action at this time.
0 commit comments