Conversation
|
The test error was caused by: the line here: impl_primitive_from_variant!(datatypes::Time64MicrosecondType, as_time_utc, |v| {
Some((v.num_seconds_from_midnight() * 1_000_000 + v.nanosecond() / 1_000) as i64)
});Multiplication happens before casting Fixed here: 718efbf |
|
@codephage2020 @scovich @klion26 please check when you are available. Thanks! |
codephage2020
left a comment
There was a problem hiding this comment.
LGTM. One small suggestion.
There was a problem hiding this comment.
nit: perhaps we could also use from_parts here?
| let a_field_shredded = | |
| ShreddedVariantFieldArray::from_parts(None, Some(Arc::new(a_field_typed_value)), None); |
(several more below, if you choose to change this)
There was a problem hiding this comment.
I thought about it, but it looked like using VariantArray::from_parts where only one field is used doesn't save much space or make it more readable.
I am open to it tho.
There was a problem hiding this comment.
I realized you were suggesting using ShreddedVariantFieldArray::from_parts, I'll use that!
klion26
left a comment
There was a problem hiding this comment.
Thanks for the improvement. Overall looks great to me. I left some minor comments to be considered.
Another question is whether we need to support shred to LargeUtf8/LargeBinary, I can only find this comment, it seems is legal to support (it may not need to be included in the current pr even if we want to support it)
There was a problem hiding this comment.
Could you please also improve this, "n/a" is also string.
…t_get-clean-up
You're right. I found the mention in arrow-rs/parquet-variant-compute/src/shred_variant.rs Lines 1147 to 1166 in d2e2cda I'd add support for these types for |
|
I filed a ticket for the |
|
Moved some tests to be close to each other, might split to a separate PR to make this easier to review. cc1869f Mostly code movement and removed some comments. |
| arrow::array::BooleanArray::from(vec![Some(true), None, None, Some(false)]) | ||
| }); | ||
|
|
||
| partially_shredded_variant_array_gen!(partially_shredded_utf8_variant_array, || { |
There was a problem hiding this comment.
IIUC, this will generate the data that(the second is invalid) typed_value contains hello, n/a, and world(Variant::from("n/a") in the macro will also be shredded into typed_value) , there is no item located in value, maybe we can improve this case to satisfy that there are some items in typed_value and some in value
Which issue does this PR close?
variant_gettests clean up #9517.Rationale for this change
check issue
What changes are included in this PR?
variant_shredin test macrosVariantArray::from_partsinstead of usingStructArrayBuilderAre these changes tested?
yes, changes pass same tests
Are there any user-facing changes?
no