{"record":{"id":"92fb1977f1a40caf","repo":"apache/iceberg","slug":"unknown-file-format-s-92fb19","errorCode":null,"errorMessage":"Unknown file format %s","messagePattern":"Unknown file format (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/sink/SinkUtil.java","lineNumber":151,"sourceCode":"        writeProperties.put(PARQUET_SHRED_VARIANTS, String.valueOf(conf.parquetShredVariants()));\n        writeProperties.put(\n            PARQUET_VARIANT_BUFFER_SIZE, String.valueOf(conf.parquetVariantInferenceBufferSize()));\n\n        break;\n      case AVRO:\n        writeProperties.put(AVRO_COMPRESSION, conf.avroCompressionCodec());\n        String avroCompressionLevel = conf.avroCompressionLevel();\n        if (avroCompressionLevel != null) {\n          writeProperties.put(AVRO_COMPRESSION_LEVEL, conf.avroCompressionLevel());\n        }\n\n        break;\n      case ORC:\n        writeProperties.put(ORC_COMPRESSION, conf.orcCompressionCodec());\n        writeProperties.put(ORC_COMPRESSION_STRATEGY, conf.orcCompressionStrategy());\n        break;\n      default:\n        throw new IllegalArgumentException(String.format(\"Unknown file format %s\", format));\n    }\n\n    return writeProperties;\n  }\n}\n","sourceCodeStart":133,"sourceCodeEnd":157,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/sink/SinkUtil.java#L133-L157","documentation":"SinkUtil.writeProperties maps a FileFormat to compression properties for the sink; an unhandled format reaches the default branch and throws IllegalArgumentException(\"Unknown file format %s\"). Only AVIF-free known formats (parquet, avro, orc) are covered by the switch.","triggerScenarios":"Calling SinkUtil.writeProperties (or configuring the sink's file format) with a FileFormat value outside the implemented set — e.g. a custom or newly added format not yet supported by the Flink sink's compression config.","commonSituations":"Setting write.format.default to an unsupported/newer value; running an older runtime against tables configured for a newer format; programmatic use of FileFormat.fromString with arbitrary input.","solutions":["Set write.format.default to parquet, avro, or orc.","Upgrade iceberg-flink-runtime if the format was added in a newer Iceberg release.","If calling writeProperties directly, only pass formats the switch implements."],"exampleFix":"// before\noptions.put(\"write.format.default\", \"lance\");\n// after\noptions.put(\"write.format.default\", \"parquet\");","handlingStrategy":"validation","validationCode":"FileFormat format = FileFormat.fromString(props.getProperty(\"write.format.default\", \"parquet\"));\nif (format != FileFormat.PARQUET && format != FileFormat.AVRO && format != FileFormat.ORC) {\n  throw new IllegalArgumentException(\"Flink sink supports parquet/avro/orc only: \" + format);\n}","typeGuard":null,"tryCatchPattern":"try {\n  Map<String, String> props = SinkUtil.writeProperties(conf);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unknown file format\")) {\n    // fall back to parquet\n  }\n}","preventionTips":["Restrict write.format.default to parquet/avro/orc for Flink jobs.","Upgrade runtime before adopting newer file formats.","Validate table properties in CI with a preflight writeProperties call."],"tags":["flink","file-format","config","invalid-enum"],"backgroundTag":"unsupported-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}