{"record":{"id":"7869d6c6aed407f9","repo":"apache/seatunnel","slug":"table-already-existed-7869d6","errorCode":"TABLE_ALREADY_EXISTED","errorMessage":"Table %s already exist in Catalog %s.","messagePattern":"Table (.+?) already exist in Catalog (.+?)\\.","errorType":"error_code","errorClass":"TableAlreadyExistException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oceanbase/OceanBaseOracleCatalog.java","lineNumber":97,"sourceCode":"    @Override\n    public void createTable(\n            TablePath tablePath, CatalogTable table, boolean ignoreIfExists, boolean createIndex)\n            throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {\n        checkNotNull(tablePath, \"Table path cannot be null\");\n\n        if (defaultSchema.isPresent()) {\n            tablePath =\n                    new TablePath(\n                            tablePath.getDatabaseName(),\n                            defaultSchema.get(),\n                            tablePath.getTableName());\n        }\n\n        if (tableExists(tablePath)) {\n            if (ignoreIfExists) {\n                return;\n            }\n            throw new TableAlreadyExistException(catalogName, tablePath);\n        }\n\n        createTableInternal(tablePath, table, createIndex);\n    }\n\n    @Override\n    protected List<String> getCreateTableSqls(\n            TablePath tablePath, CatalogTable table, boolean createIndex) {\n        return new OceanBaseOracleCreateTableSqlBuilder(table, createIndex).build(tablePath);\n    }\n}\n","sourceCodeStart":79,"sourceCodeEnd":109,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oceanbase/OceanBaseOracleCatalog.java#L79-L109","documentation":"createTable on OceanBaseOracleCatalog raises TableAlreadyExistException (TABLE_ALREADY_EXISTED) when tableExists(tablePath) reports the target table already present and ignoreIfExists is false. This is a normal, intentional pre-check failure, not a crash.","triggerScenarios":"Calling catalog.createTable for a TablePath whose table already exists in the OceanBase Oracle tenant with ignoreIfExists=false (default).","commonSituations":"Re-running a job or schema-sync without dropTableFirst/ignoreIfExists enabled; concurrent jobs creating the same table; leftover tables from a previous failed run.","solutions":["Set ignoreIfExists=true to skip creation when the table exists","Drop the existing table first (catalog.dropTable(tablePath)) before createTable","Use a unique table name/database for each run","Wrap the call and catch TableAlreadyExistException when idempotent behavior is desired"],"exampleFix":"// before\ncatalog.createTable(path, table, false); // throws if exists\n// after\ntry {\n    catalog.createTable(path, table, false);\n} catch (TableAlreadyExistException e) {\n    // table already present — treat as success\n}","handlingStrategy":"try-catch","validationCode":"// pre-check before create\nboolean exists = catalog.tableExists(tablePath);\nif (exists && !ignoreIfExists) { /* drop or skip before calling createTable */ }","typeGuard":null,"tryCatchPattern":"try { catalog.createTable(path, table, ignoreIfExists); } catch (TableAlreadyExistException e) { /* treat as success or drop+recreate */ }","preventionTips":["Make schema provisioning idempotent (ignoreIfExists=true or drop-first)","Use unique table names per run to avoid concurrent-creation clashes","Clean up leftover tables from failed runs"],"tags":["jdbc","oceanbase","duplicate-table","idempotency"],"backgroundTag":"file-already-exists","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}