apache/seatunnel · error · IllegalArgumentException
tableName cannot be empty
Error message
tableName cannot be empty
What it means
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.
Source
Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/TablePath.java:43
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Getter
@EqualsAndHashCode
public final class TablePath implements Serializable {
private static final long serialVersionUID = 1L;
private final String databaseName;
private final String schemaName;
@NonNull private final String tableName;
public TablePath(String databaseName, String schemaName, @NonNull String tableName) {
this.databaseName = databaseName;
this.schemaName = schemaName;
this.tableName = tableName;
if (StringUtils.isEmpty(tableName)) {
throw new IllegalArgumentException("tableName cannot be empty");
}
}
public static final TablePath DEFAULT = TablePath.of("default", "default", "default");
public static TablePath of(String fullName) {
return of(fullName, false);
}
public static TablePath of(String fullName, boolean schemaFirst) {
String[] paths = fullName.split("\\.");
if (paths.length == 1) {
return of(null, paths[0]);
}
if (paths.length == 2) {
if (schemaFirst) {
return of(null, paths[0], paths[1]);View on GitHub (pinned to cf67b549a7)
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
Example fix
// before
TablePath.of("db", ""); // throws
// after
String table = resolveTableName();
if (table == null || table.trim().isEmpty()) throw new IllegalArgumentException("table name is required");
TablePath.of("db", table); Defensive patterns
Strategy: validation
Validate before calling
if (tableName == null || tableName.trim().isEmpty()) throw new IllegalArgumentException("tableName required");
TablePath p = TablePath.of(db, schema, tableName); Try / catch
try { path = TablePath.of(db, schema, table); } catch (IllegalArgumentException e) { throw new IllegalStateException("Invalid table path, tableName missing: " + e.getMessage(), e); } Prevention
- Check segments for emptiness after splitting a full name on '.'
- Reject full names with trailing/leading dots
- Centralize TablePath construction in one validated helper
When it happens
Trigger: new TablePath(db, schema, "") or TablePath.of(db, "") / TablePath.of("db.schema.") style calls where the table segment is empty or null.
Common situations: 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.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- tableName cannot be empty
- transport.endpoint must be non-empty.
- Condition operator must not be null
- Invalid metalake table id:
- Table URL cannot be null or empty
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/721f4b31ae5a05ef.
Report an issue: GitHub.