tustvold commented on code in PR #2481:
URL: https://github.com/apache/arrow-rs/pull/2481#discussion_r950378015
##########
parquet/src/arrow/array_reader/primitive_array.rs:
##########
@@ -135,16 +137,31 @@ where
// Convert to arrays by using the Parquet physical type.
// The physical types are then cast to Arrow types if necessary
- let mut record_data = self.record_reader.consume_record_data();
+ let record_data = self.record_reader.consume_record_data();
+ let record_data = match T::get_physical_type() {
+ PhysicalType::BOOLEAN => {
+ let mut boolean_buffer =
BooleanBufferBuilder::new(record_data.len());
- if T::get_physical_type() == PhysicalType::BOOLEAN {
- let mut boolean_buffer =
BooleanBufferBuilder::new(record_data.len());
+ for e in record_data.as_slice() {
+ boolean_buffer.append(*e > 0);
+ }
+ boolean_buffer.finish()
+ }
+ PhysicalType::INT96 => {
+ // SAFETY - record_data is an aligned buffer of Int96
Review Comment:
Once ComplexObjectArrayReader is gone, I intend to see if we can rework the
parquet decoder plumbing to avoid this hackery
--
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]