{"record":{"id":"03f1044f3d3f3f83","repo":"apache/seatunnel","slug":"catalog-table-failed","errorCode":"CATALOG_TABLE_FAILED","errorMessage":"tableSchema is null","messagePattern":"tableSchema is null","errorType":"error_code","errorClass":"AssertConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/rule/AssertCatalogTableRule.java","lineNumber":59,"sourceCode":"@Data\npublic class AssertCatalogTableRule implements Serializable {\n\n    @OptionMark(description = \"assert primary key rule\")\n    private AssertPrimaryKeyRule primaryKeyRule;\n\n    @OptionMark(description = \"constraint key rule\")\n    private AssertConstraintKeyRule constraintKeyRule;\n\n    @OptionMark(description = \"column rule\")\n    private AssertColumnRule columnRule;\n\n    @OptionMark(description = \"tableIdentifier rule\")\n    private AssertTableIdentifierRule tableIdentifierRule;\n\n    public void checkRule(CatalogTable catalogTable) {\n        TableSchema tableSchema = catalogTable.getTableSchema();\n        if (tableSchema == null) {\n            throw new AssertConnectorException(CATALOG_TABLE_FAILED, \"tableSchema is null\");\n        }\n        if (primaryKeyRule != null) {\n            primaryKeyRule.checkRule(tableSchema.getPrimaryKey());\n        }\n        if (constraintKeyRule != null) {\n            constraintKeyRule.checkRule(tableSchema.getConstraintKeys());\n        }\n        if (columnRule != null) {\n            columnRule.checkRule(tableSchema.getColumns());\n        }\n        if (tableIdentifierRule != null) {\n            tableIdentifierRule.checkRule(catalogTable.getTableId());\n        }\n    }\n\n    @Data\n    @NoArgsConstructor\n    @AllArgsConstructor","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/rule/AssertCatalogTableRule.java#L41-L77","documentation":"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.","triggerScenarios":"Assert sink receiving a CatalogTable whose tableSchema is null — typically when the upstream source/transform does not propagate schema information into the catalog table.","commonSituations":"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.","solutions":["Ensure the upstream source declares a proper CatalogTable with a table schema","Add a preceding transform (e.g. SQL/FieldMapper) that produces a concrete schema if the upstream schema is absent","Check connector version; upgrade if schema propagation was fixed in a newer release","If building CatalogTable programmatically, pass a non-null TableSchema to the builder"],"exampleFix":"// before\nCatalogTable.builder().tableIdentifier(id).build(); // tableSchema null\n// after\nCatalogTable.builder().tableIdentifier(id).tableSchema(tableSchema).build();","handlingStrategy":"validation","validationCode":"if (catalogTable.getTableSchema() == null) {\n    throw new IllegalStateException(\"upstream CatalogTable has no table schema; cannot assert\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm the chosen source propagates TableSchema into CatalogTable","Test assert pipelines with a simple known-schema source first","Avoid building CatalogTable manually without a schema"],"tags":["assert","catalog-table","null-schema"],"backgroundTag":"null-argument","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"}