{"record":{"id":"f1ce775280e93f2c","repo":"apache/seatunnel","slug":"table-tablepath-already-exists-in-catalog-cat","errorCode":null,"errorMessage":"Table ${tablePath} already exists in catalog ${catalogName}","messagePattern":"Table (.+?) already exists in catalog (.+?)","errorType":"exception","errorClass":"TableAlreadyExistException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java","lineNumber":185,"sourceCode":"        try {\n            return catalog.getTable(toIdentifier(tablePath));\n        } catch (org.apache.paimon.catalog.Catalog.TableNotExistException e) {\n            throw new TableNotExistException(this.catalogName, tablePath);\n        }\n    }\n\n    @Override\n    public void createTable(TablePath tablePath, CatalogTable table, boolean ignoreIfExists)\n            throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {\n        try {\n            Schema paimonSchema =\n                    SchemaUtil.toPaimonSchema(\n                            table.getTableSchema(),\n                            new PaimonSinkConfig(readonlyConfig),\n                            table.getComment());\n            catalog.createTable(toIdentifier(tablePath), paimonSchema, ignoreIfExists);\n        } catch (org.apache.paimon.catalog.Catalog.TableAlreadyExistException e) {\n            throw new TableAlreadyExistException(this.catalogName, tablePath);\n        } catch (org.apache.paimon.catalog.Catalog.DatabaseNotExistException e) {\n            throw new DatabaseNotExistException(this.catalogName, tablePath.getDatabaseName());\n        } catch (Exception e) {\n            resolveException(e);\n        }\n    }\n\n    @Override\n    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {\n        try {\n            catalog.dropTable(toIdentifier(tablePath), ignoreIfNotExists);\n        } catch (org.apache.paimon.catalog.Catalog.TableNotExistException e) {\n            throw new TableNotExistException(this.catalogName, tablePath);\n        }\n    }\n\n    @Override","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java#L167-L203","documentation":"PaimonCatalog.createTable maps Paimon's native Catalog.TableAlreadyExistException to SeaTunnel's TableAlreadyExistException when catalog.createTable finds the identifier already occupied. It signals the create request conflicts with an existing table at the same path.","triggerScenarios":"Calling createTable(tablePath, table, ignoreIfExists) where a table already exists at the identifier and ignoreIfExists is false, causing Paimon to raise TableAlreadyExistException.","commonSituations":"Auto-create logic running against a table created by a previous job, concurrent jobs creating the same table, re-running a pipeline without drop/cleanup, or forgetting ignoreIfExists=true for idempotent creates.","solutions":["Pass ignoreIfExists=true if the table may legitimately pre-exist.","Drop the existing table (or use truncateTable) before recreating.","Use a different table path for the new output.","Coordinate concurrent jobs so only one creates the table, or make creation idempotent."],"exampleFix":"// before\ncatalog.createTable(path, table, false); // fails if table exists\n// after\ncatalog.createTable(path, table, true); // idempotent create","handlingStrategy":"try-catch","validationCode":"if (catalog.tableExists(tablePath)) {\n    // already there: skip, drop, or reuse\n}","typeGuard":null,"tryCatchPattern":"try {\n    catalog.createTable(tablePath, table, false);\n} catch (TableAlreadyExistException e) {\n    LOG.warn(\"Table {} already exists; skipping create\", tablePath);\n}","preventionTips":["Use ignoreIfExists=true for idempotent pipelines.","Check tableExists before auto-creating tables.","Avoid concurrent jobs creating the same table path."],"tags":["paimon","catalog","table-already-exists","create-table"],"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-14T05:17:10.506Z"}