{"record":{"id":"721f4b31ae5a05ef","repo":"apache/seatunnel","slug":"tablename-cannot-be-empty-721f4b","errorCode":null,"errorMessage":"tableName cannot be empty","messagePattern":"tableName cannot be empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/TablePath.java","lineNumber":43,"sourceCode":"\nimport java.io.Serializable;\nimport java.util.ArrayList;\nimport java.util.List;\n\n@Getter\n@EqualsAndHashCode\npublic final class TablePath implements Serializable {\n    private static final long serialVersionUID = 1L;\n    private final String databaseName;\n    private final String schemaName;\n    @NonNull private final String tableName;\n\n    public TablePath(String databaseName, String schemaName, @NonNull String tableName) {\n        this.databaseName = databaseName;\n        this.schemaName = schemaName;\n        this.tableName = tableName;\n        if (StringUtils.isEmpty(tableName)) {\n            throw new IllegalArgumentException(\"tableName cannot be empty\");\n        }\n    }\n\n    public static final TablePath DEFAULT = TablePath.of(\"default\", \"default\", \"default\");\n\n    public static TablePath of(String fullName) {\n        return of(fullName, false);\n    }\n\n    public static TablePath of(String fullName, boolean schemaFirst) {\n        String[] paths = fullName.split(\"\\\\.\");\n\n        if (paths.length == 1) {\n            return of(null, paths[0]);\n        }\n        if (paths.length == 2) {\n            if (schemaFirst) {\n                return of(null, paths[0], paths[1]);","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/TablePath.java#L25-L61","documentation":"TablePath's constructor requires a non-empty tableName. After @NonNull, it checks StringUtils.isEmpty(tableName) and throws IllegalArgumentException. TablePath encodes database.schema.table coordinates; an empty table name would produce an unusable path.","triggerScenarios":"new TablePath(db, schema, \"\") or TablePath.of(db, \"\") / TablePath.of(\"db.schema.\") style calls where the table segment is empty or null.","commonSituations":"Parsing full names with trailing dots (\"mydb.myschema.\"), table names sourced from empty env vars/config keys, or catalog code constructing paths from partially filled metadata.","solutions":["Supply a valid table name when building TablePath","When parsing a fullName, check each segment for emptiness before calling TablePath.of(parts...)","Fix the source of the empty name (config key, split logic) and re-run"],"exampleFix":"// before\nTablePath.of(\"db\", \"\"); // throws\n// after\nString table = resolveTableName();\nif (table == null || table.trim().isEmpty()) throw new IllegalArgumentException(\"table name is required\");\nTablePath.of(\"db\", table);","handlingStrategy":"validation","validationCode":"if (tableName == null || tableName.trim().isEmpty()) throw new IllegalArgumentException(\"tableName required\");\nTablePath p = TablePath.of(db, schema, tableName);","typeGuard":null,"tryCatchPattern":"try { path = TablePath.of(db, schema, table); } catch (IllegalArgumentException e) { throw new IllegalStateException(\"Invalid table path, tableName missing: \" + e.getMessage(), e); }","preventionTips":["Check segments for emptiness after splitting a full name on '.'","Reject full names with trailing/leading dots","Centralize TablePath construction in one validated helper"],"tags":["table-path","validation","empty-string"],"backgroundTag":"empty-required-field","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"}