{"record":{"id":"c066276862fd805f","repo":"apache/iceberg","slug":"unknown-file-format-s","errorCode":null,"errorMessage":"Unknown file format %s","messagePattern":"Unknown file format (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/SinkUtil.java","lineNumber":145,"sourceCode":"        if (parquetCompressionLevel != null) {\n          writeProperties.put(PARQUET_COMPRESSION_LEVEL, parquetCompressionLevel);\n        }\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":127,"sourceCodeEnd":151,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/SinkUtil.java#L127-L151","documentation":"SinkUtil.writeProperties builds format-specific compression properties and only handles PARQUET, AVRO, and ORC; any other FileFormat throws IllegalArgumentException 'Unknown file format %s'. It means the sink was asked to write a file format it cannot configure compression for (and by extension the write path does not support it).","triggerScenarios":"Setting format via FlinkWriteOptions.WRITE_FORMAT / 'write-format' to a value that resolves to a FileFormat outside the handled set (e.g. a table default write.format.default of parquet/orc/avro is fine, but programmatic FileFormat values or future formats are not), or passing a custom FileFormat enum constant.","commonSituations":"Configuring write-format with an unsupported/typo value in SQL hints or write options; using a new Iceberg format support (e.g. a format added in a newer release) with an older runtime; programmatic API misuse passing FileFormat values directly.","solutions":["Set write format to one of parquet, avro, or orc via FlinkWriteOptions.WRITE_FORMAT or the table's write.format.default property","If you need a newer format, upgrade iceberg-flink-runtime to a release that supports it in the sink","Check where format comes from (table properties vs write options) — a table property like write.format.default with a bad value must be corrected on the table","Validate format parsing before building the sink: FileFormat.fromString will throw earlier for bad strings"],"exampleFix":"// before\nFlinkSink.forRowData(input).set(\"write-format\", \"json\").tableLoader(loader).append();\n// after\nFlinkSink.forRowData(input).set(\"write-format\", \"parquet\").tableLoader(loader).append();","handlingStrategy":"validation","validationCode":"String fmt = writeOptions.getOrDefault(\"write-format\", 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: \" + fmt);\n}","typeGuard":null,"tryCatchPattern":"try {\n  sink.append();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Unknown file format\")) {\n    LOG.error(\"fix write-format/write.format.default to parquet|avro|orc\");\n  }\n  throw e;\n}","preventionTips":["Validate write-format write options at job-config time","Check table property write.format.default is one of parquet/avro/orc","Do not pass custom/future FileFormat constants to APIs built against an older spec"],"tags":["flink","config","file-format","iceberg"],"backgroundTag":"invalid-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}