{"record":{"id":"7f7e4a5ccc528f5a","repo":"apache/seatunnel","slug":"illegal-argument-7f7e4a","errorCode":"ILLEGAL_ARGUMENT","errorMessage":"SeaTunnel does not supported this file format","messagePattern":"SeaTunnel does not supported this file format","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":123,"sourceCode":"        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 =\n                            String.format(\n                                    \"Get table schema from file [%s] failed\", filePaths.get(0));\n                    throw new FileConnectorException(\n                            CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED, errorMsg, e);\n                }","sourceCodeStart":105,"sourceCodeEnd":141,"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#L105-L141","documentation":"BaseFileSource's schema-handling switch hit a FileFormat value it does not recognize while a user-defined schema was configured, so it throws ILLEGAL_ARGUMENT with a generic 'does not supported this file format' message. This is the defensive default branch of the switch at BaseFileSource.java:123.","triggerScenarios":"An unrecognized/unsupported FileFormat enum value reaching the default case in BaseFileSource's user-defined-schema switch — normally caused by a misspelled or unsupported `file_format_type` in the source config combined with a schema block.","commonSituations":"Typo in file_format_type (e.g. 'parqet', 'texte'); using a format name valid elsewhere but not in this switch; config generated by tooling with a bad enum value.","solutions":["Correct `file_format_type` to a supported value (text, csv, json, parquet, orc, excel, binary).","Remove the user-defined `schema` block if the format is parquet/orc/binary (see UNSUPPORTED_OPERATION).","Check connector version documentation — some formats are only supported in newer releases.","Validate the HOCON config before submitting."],"exampleFix":"// before\nfile_format_type = parqet\n// after\nfile_format_type = parquet","handlingStrategy":"validation","validationCode":"java.util.Set<String> supported = java.util.Set.of(\"text\",\"csv\",\"json\",\"parquet\",\"orc\",\"excel\",\"binary\");\nString fmt = config.getString(\"file_format_type\");\nif (!supported.contains(fmt)) {\n    throw new IllegalArgumentException(\"Unsupported file_format_type: \" + fmt);\n}","typeGuard":null,"tryCatchPattern":"try {\n    // build source\n} catch (FileConnectorException e) {\n    if (CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT.equals(e.getErrorCode())) {\n        throw new IllegalStateException(\"file_format_type value is not recognized — fix the enum spelling\", e);\n    }\n    throw e;\n}","preventionTips":["Validate file_format_type against the documented enum at config load time.","Avoid programmatic config generation without enum checks.","Pin connector versions so supported formats are known."],"tags":["config","file-format","enum"],"backgroundTag":"invalid-enum-value","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"}