You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "raghav-reglobe (via GitHub)" <gi...@apache.org> on 2026/08/09 08:46:19 UTC
[I] [Variant] `VariantArray::value` silently returns `Variant::Null` for unimplemented `typed_value` types in release builds [arrow-rs]
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: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Variant] `VariantArray::value` silently returns `Variant::Null` for unimplemented `typed_value` types in release builds [arrow-rs]
Posted by "yongster (via GitHub)" <gi...@apache.org>.
yongster commented on issue #10597:
URL: https://github.com/apache/arrow-rs/issues/10597#issuecomment-5232191853
I'd like to take this. I'll add a regression test for a shredded Struct and change the unsupported-type fallback to return an error rather than silently returning .
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Variant] `VariantArray::value` silently returns `Variant::Null` for unimplemented `typed_value` types in release builds [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey closed issue #10597: [Variant] `VariantArray::value` silently returns `Variant::Null` for unimplemented `typed_value` types in release builds
URL: https://github.com/apache/arrow-rs/issues/10597
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org