{"record":{"id":"e1875e2f4c964808","repo":"apache/seatunnel","slug":"commonerrorcodedeprecated-table-schema-get-failed","errorCode":"CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED","errorMessage":"Column [%s] does not exists in table schema [%s]","messagePattern":"Column \\[(.+?)\\] does not exists in table schema \\[(.+?)\\]","errorType":"error_code","errorClass":"FileConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/OrcReadStrategy.java","lineNumber":184,"sourceCode":"        try (Reader reader =\n                hadoopFileSystemProxy.doWithHadoopAuth(\n                        ((configuration, userGroupInformation) -> {\n                            OrcFile.ReaderOptions readerOptions =\n                                    OrcFile.readerOptions(configuration);\n                            return OrcFile.createReader(new Path(path), readerOptions);\n                        }))) {\n            TypeDescription schema = reader.getSchema();\n            List<String> fieldNames = schema.getFieldNames();\n            if (readColumns.isEmpty()) {\n                readColumns.addAll(fieldNames);\n            }\n            String[] fields = new String[readColumns.size()];\n            SeaTunnelDataType<?>[] types = new SeaTunnelDataType[readColumns.size()];\n            for (int i = 0; i < readColumns.size(); i++) {\n                fields[i] = readColumns.get(i);\n                int index = fieldNames.indexOf(readColumns.get(i));\n                if (index == -1) {\n                    throw new FileConnectorException(\n                            CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED,\n                            String.format(\n                                    \"Column [%s] does not exists in table schema [%s]\",\n                                    readColumns.get(i), String.join(\",\", fieldNames)));\n                }\n                types[i] =\n                        orcDataType2SeaTunnelDataType(\n                                schema.getChildren().get(index),\n                                configRowType != null && configRowType.getTotalFields() > i\n                                        ? configRowType.getFieldType(i)\n                                        : null);\n            }\n            seaTunnelRowType = new SeaTunnelRowType(fields, types);\n            seaTunnelRowTypeWithPartition = mergePartitionTypes(path, seaTunnelRowType);\n            return getActualSeaTunnelRowTypeInfo();\n        } catch (IOException e) {\n            String errorMsg = String.format(\"Create orc reader for this file [%s] failed\", path);\n            throw new FileConnectorException(","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/OrcReadStrategy.java#L166-L202","documentation":"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.","triggerScenarios":"getSeaTunnelRowTypeInfoWithUserConfigRowType() iterating readColumns; any configured schema field (including projection columns) not present in the ORC file's fieldNames.","commonSituations":"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.","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."],"exampleFix":"// before: config asks for 'user_id', ORC schema has 'userId'\nschema = { fields { user_id = int } }\n// after\nschema = { fields { userId = int } }","handlingStrategy":"validation","validationCode":"// compare configured fields against ORC schema\norc-tools meta file.orc | jq '.fieldNames' // then assert every configured field is in the list","typeGuard":"function fieldsExist(configured, orcFieldNames) { return configured.every(f => orcFieldNames.includes(f)); }","tryCatchPattern":"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; }","preventionTips":["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"],"tags":["orc","schema","column-missing","file-source"],"backgroundTag":"schema-validation-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}