{"record":{"id":"96a2196e393dca6e","repo":"apache/seatunnel","slug":"failed-create-table-in-catalog-s-sql-s","errorCode":null,"errorMessage":"Failed create table in catalog %s, sql :[%s]","messagePattern":"Failed create table in catalog (.+?), sql :\\[(.+?)\\]","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/catalog/StarRocksCatalog.java","lineNumber":398,"sourceCode":"\n    @SuppressWarnings(\"MagicNumber\")\n    private Map<String, String> buildConnectorOptions(TablePath tablePath) {\n        Map<String, String> options = new HashMap<>(8);\n        options.put(\"connector\", \"starrocks\");\n        options.put(\"url\", baseUrl + tablePath.getDatabaseName());\n        options.put(\"table-name\", tablePath.getFullName());\n        return options;\n    }\n\n    public void createTable(String sql)\n            throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {\n        try {\n            log.info(\"create table sql is :{}\", sql);\n            try (Statement stmt = conn.createStatement()) {\n                stmt.execute(sql);\n            }\n        } catch (Exception e) {\n            throw new CatalogException(\n                    String.format(\"Failed create table in catalog %s, sql :[%s]\", catalogName, sql),\n                    e);\n        }\n    }\n\n    /**\n     * URL has to be without database, like \"jdbc:mysql://localhost:5432/\" or\n     * \"jdbc:mysql://localhost:5432\" rather than \"jdbc:mysql://localhost:5432/db\".\n     */\n    public static boolean validateJdbcUrlWithoutDatabase(String url) {\n        String[] parts = url.trim().split(\"\\\\/+\");\n\n        return parts.length == 2;\n    }\n\n    /**\n     * URL has to be with database, like \"jdbc:mysql://localhost:5432/db\" rather than\n     * \"jdbc:mysql://localhost:5432/\".","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/catalog/StarRocksCatalog.java#L380-L416","documentation":"Thrown by StarRocksCatalog.createTable when executing the generated CREATE TABLE DDL fails; wraps the SQL exception with the catalog name and the full DDL that failed, so the offending statement is visible in the error.","triggerScenarios":"Thrown at seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/catalog/StarRocksCatalog.java:398 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix schema/DDL issues reported by StarRunks (types, keys, options)","Check that the table does not already conflict with existing objects","Inspect the wrapped SQLException alongside the logged DDL for the exact failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}