{"record":{"id":"e25c42e8cd0319c0","repo":"apache/seatunnel","slug":"unsupported-operation-e25c42","errorCode":"UNSUPPORTED_OPERATION","errorMessage":"SeaTunnel does not support user-defined schema for [parquet, orc, binary] files","messagePattern":"SeaTunnel does not support user-defined schema for \\[parquet, orc, binary\\] files","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/BaseFileSource.java","lineNumber":118,"sourceCode":"        }\n\n        // support user-defined schema\n        CatalogTable userDefinedCatalogTable;\n        // only json text csv type support user-defined schema now\n        if (pluginConfig.getOptional(ConnectorCommonOptions.SCHEMA).isPresent()) {\n            switch (fileFormat) {\n                case CSV:\n                case TEXT:\n                case JSON:\n                case EXCEL:\n                case XML:\n                    userDefinedCatalogTable = CatalogTableUtil.buildWithConfig(pluginConfig);\n                    readStrategy.setCatalogTable(userDefinedCatalogTable);\n                    break;\n                case ORC:\n                case PARQUET:\n                case BINARY:\n                    throw new FileConnectorException(\n                            CommonErrorCodeDeprecated.UNSUPPORTED_OPERATION,\n                            \"SeaTunnel does not support user-defined schema for [parquet, orc, binary] files\");\n                default:\n                    // never got in there\n                    throw new FileConnectorException(\n                            CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                            \"SeaTunnel does not supported this file format\");\n            }\n        } else {\n            if (filePaths.isEmpty()) {\n                userDefinedCatalogTable = buildCatalogTableForEmptyPath(path, fileFormat);\n            } else {\n                try {\n                    SeaTunnelRowType rowType =\n                            readStrategy.getSeaTunnelRowTypeInfo(filePaths.get(0));\n                    userDefinedCatalogTable = CatalogTableUtil.getCatalogTable(\"default\", rowType);\n                } catch (FileConnectorException e) {\n                    String errorMsg =","sourceCodeStart":100,"sourceCodeEnd":136,"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/BaseFileSource.java#L100-L136","documentation":"Columnar and binary file formats (PARQUET, ORC, BINARY) carry their own schema, so SeaTunnel forbids declaring a user-defined `schema` block in the source config for them. BaseFileSource raises UNSUPPORTED_OPERATION as soon as it sees schema config combined with one of these formats.","triggerScenarios":"Configuring a file source with file_format_type = parquet, orc, or binary together with a `schema = { ... }` option; BaseFileSource.java:118 throws during source initialization.","commonSituations":"Copy-pasting a JSON/CSV config and changing only the format to parquet/orc; users migrating configs from text-based formats; misunderstanding that schema is only for schemaless formats.","solutions":["Remove the `schema` option from the source config when using parquet, orc, or binary.","Let the connector read the schema embedded in the parquet/ORC file.","If you need explicit typing, switch the format to json/text/csv which support user-defined schema.","Resubmit the job after the config change."],"exampleFix":"// before\nfile_format_type = parquet\nschema = { fields { id bigint } }\n// after\nfile_format_type = parquet","handlingStrategy":"validation","validationCode":"String fmt = config.getString(\"file_format_type\");\nboolean schemaDefined = config.getConfigMap(\"schema\") != null && !config.getConfigMap(\"schema\").isEmpty();\nif (schemaDefined && (\"parquet\".equals(fmt) || \"orc\".equals(fmt) || \"binary\".equals(fmt))) {\n    throw new IllegalArgumentException(\"schema is not supported for file_format_type=\" + fmt);\n}","typeGuard":null,"tryCatchPattern":"try {\n    // build source\n} catch (FileConnectorException e) {\n    if (CommonErrorCodeDeprecated.UNSUPPORTED_OPERATION.equals(e.getErrorCode())) {\n        throw new IllegalStateException(\"Remove the schema block for parquet/orc/binary sources\", e);\n    }\n    throw e;\n}","preventionTips":["Only add schema blocks to text/csv/json sources.","Lint configs: schema + parquet/orc/binary should fail config validation.","Read format docs before switching file_format_type."],"tags":["config","schema","file"],"backgroundTag":"unsupported-operation","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"}