You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "liamzwbao (via GitHub)" <gi...@apache.org> on 2025/11/03 23:53:22 UTC

Re: [PR] [Variant] Add variant to arrow for `DataType::{Utf8, LargeUtf8}` and `DataType::Binary` [arrow-rs]

liamzwbao commented on code in PR #8768:
URL: https://github.com/apache/arrow-rs/pull/8768#discussion_r2488187249


##########
parquet-variant-compute/src/variant_to_arrow.rs:
##########
@@ -60,6 +61,9 @@ pub(crate) enum PrimitiveVariantToArrowRowBuilder<'a> {
     TimestampNanoNtz(VariantToTimestampNtzArrowRowBuilder<'a, datatypes::TimestampNanosecondType>),
     Time(VariantToPrimitiveArrowRowBuilder<'a, datatypes::Time64MicrosecondType>),
     Date(VariantToPrimitiveArrowRowBuilder<'a, datatypes::Date32Type>),
+    Utf8(VariantToUtf8ArrowRowBuilder<'a, i32>),
+    LargeUtf8(VariantToUtf8ArrowRowBuilder<'a, i64>),
+    Binary(VariantToBinaryArrowRowBuilder<'a>),

Review Comment:
   I think we already have a binary builder [here](https://github.com/apache/arrow-rs/blob/a30890e6c4d7379c1de2d376488b1e724deefb3a/parquet-variant-compute/src/variant_to_arrow.rs#L588-L628), how about reusing it? Perhaps just change this [line](https://github.com/apache/arrow-rs/blob/a30890e6c4d7379c1de2d376488b1e724deefb3a/parquet-variant-compute/src/variant_to_arrow.rs#L332) to make it work
   
   Plus, this builder is called `PrimitiveVariantToArrowRowBuilder` but `String` and `binary` are not primitive type. So I think we need either rename the builder or put them into a new builder.



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