apache/iceberg · error · IllegalArgumentException
Unknown file format %s
Error message
Unknown file format %s
What it means
SinkUtil.writeProperties builds per-format compression write properties for AVRO, PARQUET, and ORC; any other FileFormat hits the default branch and throws IllegalArgumentException. It guards against FileFormat values unknown to this Flink connector version.
Source
Thrown at flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/SinkUtil.java:151
writeProperties.put(PARQUET_SHRED_VARIANTS, String.valueOf(conf.parquetShredVariants()));
writeProperties.put(
PARQUET_VARIANT_BUFFER_SIZE, String.valueOf(conf.parquetVariantInferenceBufferSize()));
break;
case AVRO:
writeProperties.put(AVRO_COMPRESSION, conf.avroCompressionCodec());
String avroCompressionLevel = conf.avroCompressionLevel();
if (avroCompressionLevel != null) {
writeProperties.put(AVRO_COMPRESSION_LEVEL, conf.avroCompressionLevel());
}
break;
case ORC:
writeProperties.put(ORC_COMPRESSION, conf.orcCompressionCodec());
writeProperties.put(ORC_COMPRESSION_STRATEGY, conf.orcCompressionStrategy());
break;
default:
throw new IllegalArgumentException(String.format("Unknown file format %s", format));
}
return writeProperties;
}
}
View on GitHub (pinned to 86d9c8fc54)
Solutions
- Set the table's format property to avro, parquet, or orc
- Upgrade the Iceberg Flink connector to a version that supports the requested format
- Only call SinkUtil.writeProperties with FileFormat values intended for data files
Example fix
// before
tableBuilder.format("avif")
// after
tableBuilder.format("parquet") Defensive patterns
Strategy: validation
Validate before calling
FileFormat fmt = FileFormat.fromString(table.properties().getOrDefault(TableProperties.DEFAULT_FILE_FORMAT, "parquet"));
if (fmt != FileFormat.AVRO && fmt != FileFormat.PARQUET && fmt != FileFormat.ORC) {
throw new IllegalArgumentException("Flink sink supports only avro|parquet|orc, got: " + fmt);
} Prevention
- Use FileFormat enum constants, never free-form strings, when configuring the table format
- Check the connector version's supported formats before adopting new Iceberg formats
- Keep default-file-format at parquet/orc/avro unless the connector explicitly supports otherwise
When it happens
Trigger: Calling SinkUtil.writeProperties with a format like AVIF or PUFFIN/other non-data formats, or a FileFormat added in a newer Iceberg spec while running an older connector.
Common situations: Programmatic table creation setting an exotic file format; copying format strings from another tool; version skew between table metadata and connector jars.
Related errors
- Unrecognized WRITE_DISTRIBUTION_MODE:
- Unrecognized WRITE_DISTRIBUTION_MODE:
- Unknown catalog-type: %s (Must be 'hive', 'hadoop' or 'rest'
- Class %s does not implement DynamicRecordGeneratorSQL
- Failed to instantiate DynamicRecordGeneratorSQL %s
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/f3ef90a532c198d0.
Report an issue: GitHub.