apache/seatunnel · error · FileConnectorException
CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED
CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED
Error message
Column [%s] does not exists in table schema [%s]
What it means
When a user supplies a row type (schema) for ORC reads, OrcReadStrategy validates every requested read column exists in the ORC file's schema. If a configured field name is absent from fieldNames, TABLE_SCHEMA_GET_FAILED is thrown listing the requested column and the file's actual schema. This catches schema drift between the config and the data files.
Source
Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/OrcReadStrategy.java:184
try (Reader reader =
hadoopFileSystemProxy.doWithHadoopAuth(
((configuration, userGroupInformation) -> {
OrcFile.ReaderOptions readerOptions =
OrcFile.readerOptions(configuration);
return OrcFile.createReader(new Path(path), readerOptions);
}))) {
TypeDescription schema = reader.getSchema();
List<String> fieldNames = schema.getFieldNames();
if (readColumns.isEmpty()) {
readColumns.addAll(fieldNames);
}
String[] fields = new String[readColumns.size()];
SeaTunnelDataType<?>[] types = new SeaTunnelDataType[readColumns.size()];
for (int i = 0; i < readColumns.size(); i++) {
fields[i] = readColumns.get(i);
int index = fieldNames.indexOf(readColumns.get(i));
if (index == -1) {
throw new FileConnectorException(
CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED,
String.format(
"Column [%s] does not exists in table schema [%s]",
readColumns.get(i), String.join(",", fieldNames)));
}
types[i] =
orcDataType2SeaTunnelDataType(
schema.getChildren().get(index),
configRowType != null && configRowType.getTotalFields() > i
? configRowType.getFieldType(i)
: null);
}
seaTunnelRowType = new SeaTunnelRowType(fields, types);
seaTunnelRowTypeWithPartition = mergePartitionTypes(path, seaTunnelRowType);
return getActualSeaTunnelRowTypeInfo();
} catch (IOException e) {
String errorMsg = String.format("Create orc reader for this file [%s] failed", path);
throw new FileConnectorException(View on GitHub (pinned to cf67b549a7)
Solutions
- Compare the configured field names against the list printed in the message and fix the schema block.
- Check field name case-sensitivity and spelling; ORC field names are matched exactly.
- Regenerate the schema from the actual ORC file metadata to keep it in sync.
- If the column was intentionally removed upstream, remove it from the source projection.
Example fix
// before: config asks for 'user_id', ORC schema has 'userId'
schema = { fields { user_id = int } }
// after
schema = { fields { userId = int } } Defensive patterns
Strategy: validation
Validate before calling
// compare configured fields against ORC schema orc-tools meta file.orc | jq '.fieldNames' // then assert every configured field is in the list
Type guard
function fieldsExist(configured, orcFieldNames) { return configured.every(f => orcFieldNames.includes(f)); } Try / catch
try { rowType = strategy.getSeaTunnelRowTypeInfo(path); } catch (FileConnectorException e) { if (e.getMessage().contains("does not exists in table schema")) { log.error("Fix schema fields to match: {}", extractSchema(e.getMessage())); } throw e; } Prevention
- Generate the schema from actual ORC file metadata
- Watch for case-sensitive field names
- Version the schema contract between writer and reader
- Test schema changes upstream against reader configs in CI
When it happens
Trigger: getSeaTunnelRowTypeInfoWithUserConfigRowType() iterating readColumns; any configured schema field (including projection columns) not present in the ORC file's fieldNames.
Common situations: Upstream ORC writer renamed/dropped a column; case-sensitive name mismatch (Name vs name); user config written for a different table version; typos in the schema fields list.
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
- UNSUPPORTED_DATA_TYPE
- CommonErrorCodeDeprecated.UNSUPPORTED_OPERATION
- FileConnectorErrorCode.FILE_TYPE_INVALID
- FILE_TYPE_INVALID
- COMMON_ERROR_CODE-1
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/e1875e2f4c964808.
Report an issue: GitHub.