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


##########
parquet-variant-compute/src/variant_get.rs:
##########
@@ -39,30 +40,117 @@ pub fn variant_get(input: &ArrayRef, options: GetOptions) 
-> Result<ArrayRef> {
         )
     })?;
 
+    match (
+        variant_array.metadata_field(),
+        variant_array.value_field(),
+        variant_array.typed_value_field(),
+    ) {
+        (metadata_field, Some(value_field), Some(typed_value_field)) => 
variant_get_shredded(
+            variant_array,
+            metadata_field,
+            value_field,
+            typed_value_field,
+            options,
+        ),
+        (metadata_field, Some(value_field), None) => {
+            variant_get_unshredded(variant_array, metadata_field, value_field, 
options)
+        }
+        (metadata_field, None, Some(typed_value_field)) => 
variant_get_perfectly_shredded(
+            variant_array,
+            metadata_field,
+            typed_value_field,
+            options,
+        ),
+        (metadata_field, None, None) => {
+            // This should not be possible, but return an erro just in case
+            return Err(ArrowError::InvalidArgumentError(format!(
+                "VariantArray has neither value nor typed_value field",
+            )));
+        }
+    }
+}
+
+/// variant_get for a shredded variant array

Review Comment:
   I have thought a lot more about this last night and I have a plan -- will 
try and code it up later today / tomorrow



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to