apache/seatunnel · warning

The read columns configuration will be filtered by the schem

Error message

The read columns configuration will be filtered by the schema configuration, this may cause the actual results to be inconsistent with expectations. This is due to read columns not being a subset of the schema, maybe you should check the schema and read_columns!

What it means

XmlReadStrategy.setCatalogTable intersects the user-configured read_columns list with the field names of the schema (catalog table row type). If retainAll removed any columns — meaning read_columns was not a subset of the schema — it logs this warning and proceeds with only the surviving columns. The read result will silently contain fewer columns than the user asked for.

Source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/XmlReadStrategy.java:242

    }

    @Override
    public void setCatalogTable(CatalogTable catalogTable) {
        SeaTunnelRowType rowType = catalogTable.getSeaTunnelRowType();
        if (ArrayUtils.isEmpty(rowType.getFieldNames())
                || ArrayUtils.isEmpty(rowType.getFieldTypes())) {
            throw new FileConnectorException(
                    CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,
                    "Schema information is undefined or misconfigured, please check your configuration file.");
        }

        String partitionPath = getPathForPartitionInference(null);
        if (readColumns.isEmpty()) {
            this.seaTunnelRowType = rowType;
            this.seaTunnelRowTypeWithPartition = mergePartitionTypes(partitionPath, rowType);
        } else {
            if (readColumns.retainAll(Arrays.asList(rowType.getFieldNames()))) {
                log.warn(
                        "The read columns configuration will be filtered by the schema configuration, this may cause the actual results to be inconsistent with expectations. This is due to read columns not being a subset of the schema, "
                                + "maybe you should check the schema and read_columns!");
            }
            int[] indexes = new int[readColumns.size()];
            String[] fields = new String[readColumns.size()];
            SeaTunnelDataType<?>[] types = new SeaTunnelDataType[readColumns.size()];
            for (int i = 0; i < readColumns.size(); i++) {
                indexes[i] = rowType.indexOf(readColumns.get(i));
                fields[i] = rowType.getFieldName(indexes[i]);
                types[i] = rowType.getFieldType(indexes[i]);
            }
            this.seaTunnelRowType = new SeaTunnelRowType(fields, types);
            this.seaTunnelRowTypeWithPartition =
                    mergePartitionTypes(partitionPath, this.seaTunnelRowType);
        }
    }

    @SneakyThrows

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Align read_columns to be an exact subset of the schema field names (same names and casing)
  2. Or remove read_columns entirely so the reader uses all schema columns
  3. Regenerate the schema block from the actual XML structure, then re-derive read_columns from it

Example fix

// before
schema = { fields { id INT, name STRING } }
read_columns = ["id", "Name"]
// after
schema = { fields { id INT, name STRING } }
read_columns = ["id", "name"]
Defensive patterns

Strategy: validation

Validate before calling

// Validate read_columns is a subset of schema fields before creating the reader
java.util.List<String> readColumns =
        new java.util.ArrayList<>(java.util.Arrays.asList(configReadColumns));
java.util.List<String> schemaFields = java.util.Arrays.asList(rowType.getFieldNames());
if (!schemaFields.containsAll(readColumns)) {
    throw new IllegalArgumentException(
            "read_columns must be a subset of schema fields; schema=" + schemaFields
                    + ", read_columns=" + readColumns);
}

Prevention

When it happens

Trigger: Calling setCatalogTable (via createXmlReadStrategy) with a read_columns config containing column names that do not appear in the schema's field names; e.g. typos, case mismatches, or columns that exist in the XML file but were excluded from the schema block.

Common situations: User defines schema in the job config but lists read_columns from an older file layout; column name casing differs between config and schema; copy-paste of read_columns from another table's job.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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