tustvold commented on a change in pull request #1180: URL: https://github.com/apache/arrow-rs/pull/1180#discussion_r787040998
########## File path: parquet/src/arrow/array_reader/byte_array.rs ########## @@ -579,69 +579,18 @@ impl ByteArrayDecoderDictionary { #[cfg(test)] mod tests { use super::*; + use crate::arrow::array_reader::test_util::{ + byte_array_all_encodings, utf8_column, + }; use crate::arrow::record_reader::buffer::ValuesBuffer; - use crate::basic::Type as PhysicalType; - use crate::data_type::{ByteArray, ByteArrayType}; - use crate::encodings::encoding::{get_encoder, DictEncoder, Encoder}; - use crate::schema::types::{ColumnDescriptor, ColumnPath, Type}; - use crate::util::memory::MemTracker; use arrow::array::{Array, StringArray}; - use std::sync::Arc; - - fn column() -> ColumnDescPtr { - let t = Type::primitive_type_builder("col", PhysicalType::BYTE_ARRAY) - .with_converted_type(ConvertedType::UTF8) - .build() - .unwrap(); - - Arc::new(ColumnDescriptor::new( - Arc::new(t), - 1, - 0, - ColumnPath::new(vec![]), - )) - } - - fn get_encoded(encoding: Encoding, data: &[ByteArray]) -> ByteBufferPtr { - let descriptor = column(); - let mem_tracker = Arc::new(MemTracker::new()); - let mut encoder = - get_encoder::<ByteArrayType>(descriptor, encoding, mem_tracker).unwrap(); - - encoder.put(data).unwrap(); - encoder.flush_buffer().unwrap() - } #[test] fn test_byte_array_decoder() { - let data: Vec<_> = vec!["hello", "world", "a", "b"] Review comment: This code is extracted out into test_utils so that it can be reused -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org