alamb commented on code in PR #8365:
URL: https://github.com/apache/arrow-rs/pull/8365#discussion_r2355935781


##########
parquet-variant-compute/src/variant_array.rs:
##########
@@ -246,6 +288,57 @@ impl VariantArray {
     pub fn typed_value_field(&self) -> Option<&ArrayRef> {
         self.shredding_state.typed_value_field()
     }
+
+    // TODO return a field with the correct metadata?
+    pub fn data_type(&self) -> &DataType {
+        self.inner.data_type()
+    }
+
+    pub fn slice(&self, offset: usize, length: usize) -> Self {
+        let inner = self.inner.slice(offset, length);
+        let metadata = self.metadata.slice(offset, length);
+        let shredding_state = self.shredding_state.slice(offset, length);
+        Self {
+            inner,
+            metadata,
+            shredding_state,
+        }
+    }
+
+    pub fn len(&self) -> usize {
+        self.inner.len()
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.inner.is_empty()
+    }
+
+    pub fn nulls(&self) -> Option<&NullBuffer> {
+        self.inner.nulls()
+    }
+
+    /// Is the element at index null?
+    pub fn is_null(&self, index: usize) -> bool {
+        // TODO: should we account for shredded nulls here?

Review Comment:
   > Do you mean, return true here if `Variant::Null` in the `value` column and 
`NULL` in the `typed_value`?
   
   Yeah, that is what I was thinking
   
   > I think that's more a job for `logical_nulls`?
   
   that is a good call



-- 
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]

Reply via email to