nevi-me commented on a change in pull request #9253:
URL: https://github.com/apache/arrow/pull/9253#discussion_r559940749
##########
File path: rust/parquet/src/arrow/converter.rs
##########
@@ -168,19 +167,19 @@ impl Converter<Vec<Option<FixedLenByteArray>>,
IntervalDayTimeArray>
}
}
-pub struct Int96ArrayConverter {}
+pub struct Int96ArrayConverter {
+ pub timezone: Option<String>,
+}
impl Converter<Vec<Option<Int96>>, TimestampNanosecondArray> for
Int96ArrayConverter {
fn convert(&self, source: Vec<Option<Int96>>) ->
Result<TimestampNanosecondArray> {
- let mut builder = TimestampNanosecondBuilder::new(source.len());
- for v in source {
- match v {
- Some(array) => builder.append_value(array.to_i64() * 1000000),
- None => builder.append_null(),
- }?
- }
-
- Ok(builder.finish())
+ Ok(TimestampNanosecondArray::from_opt_vec(
Review comment:
We've found the builder pattern to be slower than allocating vecs.
There's `FromIter` for PrimitiveArray, but no equivalent for
`TimestampArray::from_opt_vec`. I've filed ARROW-11312 to address this.
On the other field types, we don't use Array builder there, but use
`ArrayData::builder(timestamp_with_timezone)`. So they don't suffer from the
same limitation.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]