{"record":{"id":"e5e2f3a93ebca814","repo":"apache/iceberg","slug":"unknown-file-format-s-e5e2f3","errorCode":null,"errorMessage":"Unknown file format %s","messagePattern":"Unknown file format (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/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.1/flink/src/main/java/org/apache/iceberg/flink/sink/SinkUtil.java#L133-L157","documentation":"SinkUtil.writeProperties computes per-format compression properties, and throws IllegalArgumentException when the table's file format is not one of PARQUET, AVRO, or ORC. Iceberg tables only support these three formats, so this indicates a corrupted or unsupported write.file-format value.","triggerScenarios":"Calling SinkUtil.writeProperties with a table whose write.format.default (FileFormat) is something other than PARQUET/AVRO/ORC, which practically means a manually constructed FileFormat or a modified table metadata.","commonSituations":"Custom/extended builds adding a new format without updating this switch; tests constructing FileFormat values directly; version skew where a newer writer added a format an older SinkUtil doesn't know.","solutions":["Ensure the table's write.format.default is parquet, avro, or orc (ALTER TABLE ... SET TBLPROPERTIES ('write.format.default'='parquet')).","If this occurs with a newer format added upstream, upgrade the Iceberg Flink runtime JAR to match the writer that produced the metadata.","Check for a locally modified FileFormat enum and add the missing case to the switch in SinkUtil."],"exampleFix":"// before: 'write.format.default'='iceberg-custom-format'\n// after\nALTER TABLE db.t SET TBLPROPERTIES ('write.format.default'='parquet');","handlingStrategy":"validation","validationCode":"String fmt = table.properties().getOrDefault(\"write.format.default\", \"parquet\");\nif (!Set.of(\"parquet\", \"avro\", \"orc\").contains(fmt.toLowerCase(Locale.ROOT))) {\n  throw new IllegalArgumentException(\"Unsupported write.format.default: \" + fmt);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use parquet, avro, or orc for write.format.default.","Keep client and runtime Iceberg versions in sync to avoid unknown new formats."],"tags":["flink","sink","file-format","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"}