apache/seatunnel · error · AssertConnectorException

CATALOG_TABLE_FAILED

CATALOG_TABLE_FAILED

Error message

tableSchema is null

What it means

AssertCatalogTableRule.checkRule validates table-level assertions against the CatalogTable. If CatalogTable.getTableSchema() returns null there is no schema to validate against, so AssertConnectorException(CATALOG_TABLE_FAILED) is thrown. This indicates the upstream table carried no table schema metadata.

Source

Thrown at seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/rule/AssertCatalogTableRule.java:59

@Data
public class AssertCatalogTableRule implements Serializable {

    @OptionMark(description = "assert primary key rule")
    private AssertPrimaryKeyRule primaryKeyRule;

    @OptionMark(description = "constraint key rule")
    private AssertConstraintKeyRule constraintKeyRule;

    @OptionMark(description = "column rule")
    private AssertColumnRule columnRule;

    @OptionMark(description = "tableIdentifier rule")
    private AssertTableIdentifierRule tableIdentifierRule;

    public void checkRule(CatalogTable catalogTable) {
        TableSchema tableSchema = catalogTable.getTableSchema();
        if (tableSchema == null) {
            throw new AssertConnectorException(CATALOG_TABLE_FAILED, "tableSchema is null");
        }
        if (primaryKeyRule != null) {
            primaryKeyRule.checkRule(tableSchema.getPrimaryKey());
        }
        if (constraintKeyRule != null) {
            constraintKeyRule.checkRule(tableSchema.getConstraintKeys());
        }
        if (columnRule != null) {
            columnRule.checkRule(tableSchema.getColumns());
        }
        if (tableIdentifierRule != null) {
            tableIdentifierRule.checkRule(catalogTable.getTableId());
        }
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Ensure the upstream source declares a proper CatalogTable with a table schema
  2. Add a preceding transform (e.g. SQL/FieldMapper) that produces a concrete schema if the upstream schema is absent
  3. Check connector version; upgrade if schema propagation was fixed in a newer release
  4. If building CatalogTable programmatically, pass a non-null TableSchema to the builder

Example fix

// before
CatalogTable.builder().tableIdentifier(id).build(); // tableSchema null
// after
CatalogTable.builder().tableIdentifier(id).tableSchema(tableSchema).build();
Defensive patterns

Strategy: validation

Validate before calling

if (catalogTable.getTableSchema() == null) {
    throw new IllegalStateException("upstream CatalogTable has no table schema; cannot assert");
}

Prevention

When it happens

Trigger: Assert sink receiving a CatalogTable whose tableSchema is null — typically when the upstream source/transform does not propagate schema information into the catalog table.

Common situations: Using assert sink after a connector or transform that builds CatalogTable without a TableSchema; hand-built CatalogTable in tests missing schema; older connector versions with incomplete schema propagation.

Related errors


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