{"record":{"id":"16f682692ed11c05","repo":"apache/seatunnel","slug":"the-catalog-is-not-supported-the-getdatabasewi-16f682","errorCode":null,"errorMessage":"The catalog: {} is not supported the getDatabaseWithConditionSql for databaseExists","messagePattern":"The catalog: (.+?) is not supported the getDatabaseWithConditionSql for databaseExists","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/xugu/XuguCatalog.java","lineNumber":163,"sourceCode":"\n    // \"Test\" and \"TEST\" are the same database\n    @Override\n    protected String getListDatabaseSql() {\n        return \"SELECT UPPER(DB_NAME) FROM all_databases\";\n    }\n\n    // Rewrite the databaseExists method, and xugu will force the conversion to uppercase\n    @Override\n    public boolean databaseExists(String databaseName) throws CatalogException {\n        if (StringUtils.isBlank(databaseName)) {\n            return false;\n        }\n        try {\n            return querySQLResultExists(\n                    defaultUrl, getDatabaseWithConditionSql(databaseName.toUpperCase()));\n        } catch (SeaTunnelRuntimeException e) {\n            if (e.getSeaTunnelErrorCode().getCode().equals(UNSUPPORTED_METHOD.getCode())) {\n                log.warn(\n                        \"The catalog: {} is not supported the getDatabaseWithConditionSql for databaseExists\",\n                        this.catalogName);\n                return listDatabases().contains(databaseName.toUpperCase());\n            }\n            throw e;\n        } catch (SQLException e) {\n            throw new SeaTunnelException(\"Failed to querySQLResult\", e);\n        }\n    }\n\n    @Override\n    protected String getCreateTableSql(\n            TablePath tablePath, CatalogTable table, boolean createIndex) {\n        return new XuguCreateTableSqlBuilder(table, createIndex).build(tablePath);\n    }\n\n    @Override\n    protected String getDropTableSql(TablePath tablePath) {","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/xugu/XuguCatalog.java#L145-L181","documentation":"XuguCatalog.databaseExists() probes existence with getDatabaseWithConditionSql() against the database name upper-cased (Xugu identifiers are typically uppercase). If that builder throws UNSUPPORTED_METHOD, the catalog logs this warning and falls back to listDatabases().contains(upperCasedName). The fallback answer is still returned.","triggerScenarios":"Calling databaseExists() on XuguCatalog where getDatabaseWithConditionSql is not implemented/unsupported, so querySQLResultExists throws UNSUPPORTED_METHOD.","commonSituations":"Auto-creation flows on Xugu databases checking database presence; running a connector version where the Xugu dialect's conditional-database SQL is missing.","solutions":["Rely on the fallback; ensure listDatabases() works and the name is upper-cased as Xugu expects.","Implement getDatabaseWithConditionSql(String) in XuguCatalog to enable the direct probe.","Upgrade the SeaTunnel JDBC connector for fuller Xugu dialect support.","Verify database name casing: pass a name whose uppercase form matches the stored identifier."],"exampleFix":"// before\nboolean exists = catalog.databaseExists(\"mydb\");\n// after (match Xugu uppercase identifiers)\nboolean exists = catalog.databaseExists(\"mydb\".toUpperCase());","handlingStrategy":"fallback","validationCode":"// Xugu stores uppercase identifiers\nString upper = databaseName.toUpperCase();\nboolean exists = catalog.listDatabases().contains(upper);\nif (!exists) throw new IllegalStateException(\"Database missing on Xugu: \" + upper);","typeGuard":null,"tryCatchPattern":"// databaseExists handles the fallback internally\nboolean exists = catalog.databaseExists(databaseName.toUpperCase());\n","preventionTips":["Always upper-case identifiers for Xugu before catalog calls","Verify listDatabases() output matches the expected casing","Upgrade the connector for full Xugu dialect SQL support"],"tags":["jdbc","catalog","xugu","unsupported-operation","fallback"],"backgroundTag":"unsupported-operation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}