sdf-jkl commented on code in PR #9599:
URL: https://github.com/apache/arrow-rs/pull/9599#discussion_r2977874158
##########
parquet-variant-compute/src/shred_variant.rs:
##########
@@ -102,19 +102,50 @@ pub fn shred_variant(array: &VariantArray, as_type:
&DataType) -> Result<Variant
))
}
+/// Controls how `append_null` is encoded for a shredded `(value,
typed_value)` pair.
+///
+/// | Mode | Struct validity bit | `value` | `typed_value` | Meaning |
+/// | --- | --- | --- | --- | --- |
+/// | `TopLevelVariant` | null | NULL | NULL | SQL NULL at the top-level
variant row |
+/// | `ObjectField` | non-null | NULL | NULL | Missing object field |
+/// | `ArrayElement` | non-null | `Variant::Null` | NULL | Explicit null array
element |
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub(crate) enum AppendNullMode {
+ TopLevelVariant,
+ ObjectField,
+ ArrayElement,
+}
+
+impl AppendNullMode {
+ fn append_to_null_row(
Review Comment:
True...
Wouldn't `append_null` look weird?
```rust
fn append_null(&mut self) -> Result<()> {
self.null_mode
.append_null(&mut self.nulls, &mut self.value_builder)
```
I think I like the `append_null_to` more:
```rust
fn append_null(&mut self) -> Result<()> {
self.null_mode
.append_null_to(&mut self.nulls, &mut self.value_builder)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]