apache/seatunnel · error · IllegalArgumentException

Table name is empty

Error message

Table name is empty

What it means

IcebergTableLoader.create resolves the target table name from the loaded CatalogTable's TableId or from the connector config's 'table' option. If neither yields a non-empty name it throws IllegalArgumentException("Table name is empty"), because a TableIdentifier cannot be built without a table name.

Source

Thrown at seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/IcebergTableLoader.java:102

    @VisibleForTesting
    public static IcebergTableLoader create(IcebergCommonConfig config) {
        return create(config, null);
    }

    public static IcebergTableLoader create(IcebergCommonConfig config, CatalogTable catalogTable) {
        IcebergCatalogLoader catalogFactory = new IcebergCatalogLoader(config);
        String table;
        if (Objects.nonNull(catalogTable)
                && StringUtils.isNotEmpty(catalogTable.getTableId().getTableName())) {
            log.info(
                    "Config table name is empty, use catalog table name: {}",
                    catalogTable.getTableId().getTableName());
            table = catalogTable.getTableId().getTableName();
        } else if (StringUtils.isNotEmpty(config.getTable())) {
            // for test in sink
            table = config.getTable();
        } else {
            throw new IllegalArgumentException("Table name is empty");
        }
        return new IcebergTableLoader(
                catalogFactory, TableIdentifier.of(Namespace.of(config.getNamespace()), table));
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set the 'table' option explicitly in the Iceberg sink/source config so config.getTable() is non-empty
  2. If relying on catalog-provided table ids, verify the upstream CatalogTable actually carries a TableId
  3. Update config to include namespace+table as expected by the catalog factory in use

Example fix

// before
sink { Iceberg { namespace = "db" } }
// after
sink { Iceberg { namespace = "db", table = "events" } }
Defensive patterns

Strategy: validation

Validate before calling

String table = config.getTable();
if (table == null || table.isEmpty()) {
  throw new IllegalArgumentException("Set the 'table' option in the Iceberg config");
}

Try / catch

try {
  IcebergTableLoader loader = IcebergTableLoader.create(...);
} catch (IllegalArgumentException e) {
  if ("Table name is empty".equals(e.getMessage())) {
    // add table=<name> to config and retry
  } else throw e;
}

Prevention

When it happens

Trigger: create is called and catalogTable's table id is empty/absent AND config.getTable() returns null or empty string — e.g. sink config omits 'table' and the upstream metadata provides no table name.

Common situations: Sink config missing the table option when writing in tests or with a catalog that doesn't supply table ids; upstream metadata keys changed so the fallback path no longer populates the name.

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


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/38a059e437922306. Report an issue: GitHub.