raghav-reglobe opened a new issue, #10597: URL: https://github.com/apache/arrow-rs/issues/10597
**Describe the bug** `VariantArray::try_value` / `value` convert scalar `typed_value` types, but the fallback arm for everything else is: ```rust // https://github.com/apache/arrow-rs/issues/8091 debug_assert!(false, "Unsupported typed_value type: {}", typed_value.data_type()); Ok(Variant::Null) ``` In release builds the `debug_assert!` compiles out, so reading a row whose `typed_value` is valid but of an unimplemented type (e.g. an object-shredded `Struct`) **silently returns `Variant::Null`** — stored data reads as null with no error and no signal. In debug builds the same read panics. #8091 is closed (the scalar conversions landed there), so nothing currently tracks this arm. **To Reproduce** ```rust use arrow_array::{ArrayRef, StringArray}; use arrow_schema::{DataType, Field}; use parquet_variant_compute::{json_to_variant, shred_variant}; use std::sync::Arc; let json: ArrayRef = Arc::new(StringArray::from(vec![r#"{"qty": 3}"#])); let variant = json_to_variant(&json).unwrap(); let shred_type = DataType::Struct(vec![Field::new("qty", DataType::Int64, true)].into()); let shredded = shred_variant(&variant, &shred_type).unwrap(); // debug build: panics "Unsupported typed_value type: Struct(...)" // release build: returns Variant::Null — the stored {"qty": 3} reads as null let v = shredded.value(0); ``` Hit in practice rendering shredded variant columns through a `value()`-based canonicalization path: every typed row rendered as JSON `null` in a release build, with nothing to indicate loss. **Expected behavior** An error. `try_value` already documents "Errors if the data in `typed_value` cannot be interpreted as a valid `Variant`" — returning `ArrowError::NotYetImplemented` for these types keeps wrong-data out of release builds and makes debug/release behavior consistent, until the remaining conversions are implemented (the borrowed `Variant<'_, '_>` return can't express an assembled object without owned bytes, so the full fix is a larger change). Happy to send the small error-instead-of-null PR. -- 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]
