fix(doris): use internal database for external catalogs
This commit is contained in:
1 parent
9e2960881b
commit
abee51d625
6 files changed
+82
-13
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import type { ConnectionConfig } from "@/types/database";
|
||||
import { connectionIsDorisFamilyCatalogCapable } from "@/lib/database/databaseFeatureSupport";
|
||||
import { effectiveDatabaseTypeForConnection } from "@/lib/database/jdbcDialect";
|
||||
|
||||
export function dataTabExecutionDatabase(connection: ConnectionConfig | undefined, tabDatabase: string, catalog?: string): string {
|
||||
if (!catalog?.trim()) return tabDatabase;
|
||||
|
||||
const databaseType = effectiveDatabaseTypeForConnection(connection);
|
||||
const usesExternalCatalog = connectionIsDorisFamilyCatalogCapable(connection) || databaseType === "doris" || databaseType === "starrocks";
|
||||
if (!usesExternalCatalog) return tabDatabase;
|
||||
|
||||
// External catalog namespaces qualify the SQL object name, but they are not
|
||||
// valid MySQL-protocol session databases. Keep the configured internal DB.
|
||||
return connection?.database ?? "";
|
||||
}
|
||||
Reference in new issue
Block a user