I believe it needs needs to be VARIANT(1) , the (1) being the
"specification_version" [1]

We recently fixed an example in LogicalTypes.md[2] to follow the .thrift

Fixing the examples in VariantEncoding.md[3] I think would be a good change

Andrew

[1]:
https://github.com/apache/parquet-format/blob/285b6fd1335da2e8bafe8570f0c00b55c2c41748/src/main/thrift/parquet.thrift#L412
[2]: https://github.com/apache/parquet-format/pull/555
[3]: https://github.com/apache/parquet-format/blob/master/VariantEncoding.md

On Mon, Mar 30, 2026 at 9:10 AM Steve Loughran <[email protected]> wrote:

> The normative specification of variants, parquet-format/VariantEncoding.md,
> uses examples
>
> optional group shredded_variant_name (VARIANT) {
>   required binary metadata;
>   optional binary value;
>   optional int64 typed_value;
> }
>
> But copy that and you get an error
>
> java.lang.IllegalArgumentException: Expecting only spec version for variant
> annotation args: []
> at org.apache.parquet.Preconditions.checkArgument(Preconditions.java:70)
> at
>
> org.apache.parquet.schema.LogicalTypeAnnotation$LogicalTypeToken$3.fromString(LogicalTypeAnnotation.java:64)
> at
>
> org.apache.parquet.schema.MessageTypeParser.addGroupType(MessageTypeParser.java:139)
> at
>
> org.apache.parquet.schema.MessageTypeParser.addType(MessageTypeParser.java:109)
> at
>
> org.apache.parquet.schema.MessageTypeParser.addGroupTypeFields(MessageTypeParser.java:99)
> at
>
> org.apache.parquet.schema.MessageTypeParser.parse(MessageTypeParser.java:92)
> at
>
> org.apache.parquet.schema.MessageTypeParser.parseMessageType(MessageTypeParser.java:82)
>
> It has to be (VARIANT(1)), as is done in the limited number of places a
> variant is declared in the code.
>
> Is this an omission in the specification?
>
> If it is, I'll file an issue/pr to fix.
>

Reply via email to