{"record":{"id":"5f538b8e6ba211ba","repo":"apache/beam","slug":"configuration-with-compression-is-not-compatible-with","errorCode":null,"errorMessage":"configuration with compression is not compatible with ParquetIO","messagePattern":"configuration with compression is not compatible with ParquetIO","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/file-schema-transform/src/main/java/org/apache/beam/sdk/io/fileschematransform/FileWriteSchemaTransformProvider.java","lineNumber":197,"sourceCode":"      if (configuration.getParquetConfiguration() != null && !format.equals(PARQUET)) {\n        throw new IllegalArgumentException(\n            String.format(\n                \"configuration with %s is not compatible with a %s format\",\n                FileWriteSchemaTransformConfiguration.ParquetConfiguration.class.getName(),\n                format));\n      }\n      if (configuration.getXmlConfiguration() != null && !format.equals(XML)) {\n        throw new IllegalArgumentException(\n            String.format(\n                \"configuration with %s is not compatible with a %s format\",\n                FileWriteSchemaTransformConfiguration.XmlConfiguration.class.getName(), format));\n      }\n      if (format.equals(AVRO) && !Strings.isNullOrEmpty(configuration.getCompression())) {\n        throw new IllegalArgumentException(\n            \"configuration with compression is not compatible with AvroIO\");\n      }\n      if (format.equals(PARQUET) && !Strings.isNullOrEmpty(configuration.getCompression())) {\n        throw new IllegalArgumentException(\n            \"configuration with compression is not compatible with ParquetIO\");\n      }\n    }\n  }\n}\n","sourceCodeStart":179,"sourceCodeEnd":203,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/file-schema-transform/src/main/java/org/apache/beam/sdk/io/fileschematransform/FileWriteSchemaTransformProvider.java#L179-L203","documentation":"validateConfiguration rejects a compression setting when the format is PARQUET, because the ParquetIO sink used by this transform does not accept user-supplied compression via this configuration. IllegalArgumentException at validation time.","triggerScenarios":"FileWriteSchemaTransformConfiguration with format=PARQUET and a non-empty getCompression() value.","commonSituations":"Config templates that always set compression; migrating Avro configs to Parquet expecting the same knob to work.","solutions":["Remove/unset compression when format is PARQUET","Configure compression on ParquetIO directly if outside this transform's contract","Verify only format-supported fields are populated"],"exampleFix":"// before\nFileWriteSchemaTransformConfiguration.builder().setFormat(\"PARQUET\").setCompression(\"GZIP\").build();\n// after\nFileWriteSchemaTransformConfiguration.builder().setFormat(\"PARQUET\").build();","handlingStrategy":"validation","validationCode":"if (\"PARQUET\".equals(cfg.getFormat()) && cfg.getCompression() != null && !cfg.getCompression().isEmpty()) throw new IllegalArgumentException(\"compression not allowed for PARQUET in this transform\");","typeGuard":null,"tryCatchPattern":"try { ... } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"ParquetIO\")) { /* reconfigure without compression */ } else throw e; }","preventionTips":["Keep per-format config builders instead of one shared builder","Add config linting in CI for FileWriteSchemaTransformConfiguration"],"tags":["java","apache-beam","validation","compression"],"backgroundTag":"unsupported-config-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}