From 1207a621b32d478ebb785c55506b098993cdd291 Mon Sep 17 00:00:00 2001 From: Aihua Date: Sun, 3 Aug 2025 16:25:14 -0700 Subject: [PATCH 1/3] Clarify variant shredding spec --- VariantShredding.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VariantShredding.md b/VariantShredding.md index f27b4096..fc1f429d 100644 --- a/VariantShredding.md +++ b/VariantShredding.md @@ -125,8 +125,7 @@ If the value is an array, `value` must be null. The list `element` must be a required group. The `element` group can contain `value` and `typed_value` fields. The element's `value` field stores the element as Variant-encoded `binary` when the `typed_value` is not present or cannot represent it. -The `typed_value` field may be omitted when not shredding elements as a specific type. -When `typed_value` is omitted, `value` must be `required`. +The `typed_value` field may be omitted when not shredding elements as a specific type. The `value` field may be omitted when shredding elements as a specific type. However, at least one of the two fields must be present. For example, a `tags` Variant may be shredded as a list of strings using the following definition: ``` @@ -193,6 +192,7 @@ optional group event (VARIANT) { ``` The group for each named field must use repetition level `required`. +Readers may always assume the group is annotated correctly. A field's `value` and `typed_value` are set to null (missing) to indicate that the field does not exist in the variant. To encode a field that is present with a null value, the `value` must contain a Variant null: basic type 0 (primitive) and physical type 0 (null). From 28e8dc2191575bf282ec7c4841906a8b837961c3 Mon Sep 17 00:00:00 2001 From: Aihua Date: Tue, 5 Aug 2025 12:10:16 -0700 Subject: [PATCH 2/3] Update repetition level and style --- VariantShredding.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/VariantShredding.md b/VariantShredding.md index fc1f429d..7c9a1064 100644 --- a/VariantShredding.md +++ b/VariantShredding.md @@ -125,7 +125,9 @@ If the value is an array, `value` must be null. The list `element` must be a required group. The `element` group can contain `value` and `typed_value` fields. The element's `value` field stores the element as Variant-encoded `binary` when the `typed_value` is not present or cannot represent it. -The `typed_value` field may be omitted when not shredding elements as a specific type. The `value` field may be omitted when shredding elements as a specific type. However, at least one of the two fields must be present. +The `typed_value` field may be omitted when not shredding elements as a specific type. +The `value` field may be omitted when shredding elements as a specific type. +However, at least one of the two fields must be present. For example, a `tags` Variant may be shredded as a list of strings using the following definition: ``` @@ -192,7 +194,7 @@ optional group event (VARIANT) { ``` The group for each named field must use repetition level `required`. -Readers may always assume the group is annotated correctly. +Readers may always assume the group has the correct repetition level. A field's `value` and `typed_value` are set to null (missing) to indicate that the field does not exist in the variant. To encode a field that is present with a null value, the `value` must contain a Variant null: basic type 0 (primitive) and physical type 0 (null). From a8b6c19f52c8917568d33c9d44ae7fc94f340aed Mon Sep 17 00:00:00 2001 From: Aihua Date: Tue, 5 Aug 2025 12:52:23 -0700 Subject: [PATCH 3/3] Remove repetition level --- VariantShredding.md | 1 - 1 file changed, 1 deletion(-) diff --git a/VariantShredding.md b/VariantShredding.md index 7c9a1064..d8d9ddf9 100644 --- a/VariantShredding.md +++ b/VariantShredding.md @@ -194,7 +194,6 @@ optional group event (VARIANT) { ``` The group for each named field must use repetition level `required`. -Readers may always assume the group has the correct repetition level. A field's `value` and `typed_value` are set to null (missing) to indicate that the field does not exist in the variant. To encode a field that is present with a null value, the `value` must contain a Variant null: basic type 0 (primitive) and physical type 0 (null).