{"record":{"id":"3aab2a6bbf2bf1d0","repo":"apache/seatunnel","slug":"failed-creating-table-tablepath-getfullname","errorCode":null,"errorMessage":"Failed creating table {tablePath.getFullName()}","messagePattern":"Failed creating table (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/AbstractJdbcCatalog.java","lineNumber":510,"sourceCode":"        throw new UnsupportedOperationException();\n    }\n\n    protected List<String> getCreateTableSqls(\n            TablePath tablePath, CatalogTable table, boolean createIndex) {\n        return Collections.singletonList(getCreateTableSql(tablePath, table, createIndex));\n    }\n\n    protected void createTableInternal(TablePath tablePath, CatalogTable table, boolean createIndex)\n            throws CatalogException {\n        String dbUrl = getUrlFromDatabaseName(tablePath.getDatabaseName());\n        try {\n            final List<String> createTableSqlList =\n                    getCreateTableSqls(tablePath, table, createIndex);\n            for (String sql : createTableSqlList) {\n                executeInternal(dbUrl, sql);\n            }\n        } catch (Exception e) {\n            throw new CatalogException(\n                    String.format(\"Failed creating table %s\", tablePath.getFullName()), e);\n        }\n    }\n\n    @Override\n    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {\n        checkNotNull(tablePath, \"Table path cannot be null\");\n\n        if (!tableExists(tablePath)) {\n            if (ignoreIfNotExists) {\n                return;\n            }\n            throw new TableNotExistException(catalogName, tablePath);\n        }\n\n        dropTableInternal(tablePath);\n    }","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/AbstractJdbcCatalog.java#L492-L528","documentation":"createTableInternal wraps any exception during execution of the generated CREATE TABLE (and optional index) DDL into a CatalogException 'Failed creating table {fullName}'. This is a DDL execution failure, not a validation failure.","triggerScenarios":"Calling createTable() when executeInternal fails on the DDL: syntax unsupported by the target dialect, invalid column types in the CatalogTable, insufficient privileges, connection loss, or table concurrently created (race).","commonSituations":"SeaTunnel type mapping produces types the target DB rejects; user lacks CREATE privilege; strict-mode servers reject unsupported DDL options; network drop mid-DDL.","solutions":["Read the wrapped cause for the server's DDL error (syntax/type/permission)","Check that the JDBC catalog dialect supports your target database version","Verify column types in your CatalogTable map to legal types on the target DB","Grant CREATE privileges to the catalog user and retry","Handle the race case by catching the exception and checking tableExists()"],"exampleFix":"// before\ncatalog.createTable(path, table, false); // opaque failure\n// after\ntry {\n    catalog.createTable(path, table, false);\n} catch (CatalogException e) {\n    LOG.error(\"create table DDL failed for {}\", path.getFullName(), e.getCause());\n}","handlingStrategy":"try-catch","validationCode":"// validate types are supported before DDL\ntable.getTableSchema().getColumns().forEach(c ->\n    LOG.info(\"column {} type {}\", c.getName(), c.getSourceType()));","typeGuard":null,"tryCatchPattern":"try {\n    catalog.createTable(path, table, ignoreIfExists);\n} catch (CatalogException e) {\n    LOG.error(\"DDL failed for {}\", path.getFullName(), e.getCause());\n    throw e;\n}","preventionTips":["Review the cause for server-side DDL errors before changing config","Ensure the catalog user has CREATE privilege","Confirm the dialect supports your DB version and column types","Expect races: on failure, re-check tableExists() before retrying"],"tags":["jdbc","catalog","ddl","create-table"],"backgroundTag":"database-write-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}