From 40b2a3ec2bbb867ffbd6b7e800db7ac14839ddfe Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Fri, 3 Nov 2023 20:08:42 +0900 Subject: [PATCH] chore: remove unstable features (#4) --- src/arrow_reader/column/binary.rs | 2 +- src/arrow_reader/column/boolean.rs | 2 +- src/arrow_reader/column/date.rs | 2 +- src/arrow_reader/column/float.rs | 2 +- src/arrow_reader/column/int.rs | 2 +- src/arrow_reader/column/string.rs | 8 ++--- src/arrow_reader/column/timestamp.rs | 2 +- src/lib.rs | 5 --- src/reader/decode/rle_v2.rs | 48 ++++++++++++++-------------- 9 files changed, 34 insertions(+), 39 deletions(-) diff --git a/src/arrow_reader/column/binary.rs b/src/arrow_reader/column/binary.rs index df935711..f0e04c09 100644 --- a/src/arrow_reader/column/binary.rs +++ b/src/arrow_reader/column/binary.rs @@ -23,7 +23,7 @@ use crate::reader::decode::variable_length::Values; use crate::reader::decompress::Decompressor; pub fn new_binary_iterator(column: &Column) -> error::Result>> { - let null_mask = new_present_iter(column)?.try_collect::>()?; + let null_mask = new_present_iter(column)?.collect::>>()?; let values = column .stream(Kind::Data) diff --git a/src/arrow_reader/column/boolean.rs b/src/arrow_reader/column/boolean.rs index 9d1ffb9d..59433d7f 100644 --- a/src/arrow_reader/column/boolean.rs +++ b/src/arrow_reader/column/boolean.rs @@ -7,7 +7,7 @@ use crate::proto::stream::Kind; use crate::reader::decode::boolean_rle::BooleanIter; pub fn new_boolean_iter(column: &Column) -> Result> { - let present = new_present_iter(column)?.try_collect::>()?; + let present = new_present_iter(column)?.collect::>>()?; let rows: usize = present.iter().filter(|&p| *p).count(); let iter = column diff --git a/src/arrow_reader/column/date.rs b/src/arrow_reader/column/date.rs index 26030daf..af2ec786 100644 --- a/src/arrow_reader/column/date.rs +++ b/src/arrow_reader/column/date.rs @@ -35,7 +35,7 @@ impl Iterator for DateIterator { } pub fn new_date_iter(column: &Column) -> Result> { - let present = new_present_iter(column)?.try_collect::>()?; + let present = new_present_iter(column)?.collect::>>()?; let data = column .stream(Kind::Data) diff --git a/src/arrow_reader/column/float.rs b/src/arrow_reader/column/float.rs index fea44307..694580e9 100644 --- a/src/arrow_reader/column/float.rs +++ b/src/arrow_reader/column/float.rs @@ -10,7 +10,7 @@ macro_rules! impl_float_iter { ($tp:ident) => { paste::item! { pub fn [] (column: &Column) -> Result> { - let present = new_present_iter(column)?.try_collect::>()?; + let present = new_present_iter(column)?.collect::>>()?; let rows: usize = present.iter().filter(|&p| *p).count(); let iter = column .stream(Kind::Data) diff --git a/src/arrow_reader/column/int.rs b/src/arrow_reader/column/int.rs index b5e5a233..9183dd43 100644 --- a/src/arrow_reader/column/int.rs +++ b/src/arrow_reader/column/int.rs @@ -7,7 +7,7 @@ use crate::proto::stream::Kind; use crate::reader::decode::rle_v2::RleReaderV2; pub fn new_i64_iter(column: &Column) -> Result> { - let present = new_present_iter(column)?.try_collect::>()?; + let present = new_present_iter(column)?.collect::>>()?; let iter = column .stream(Kind::Data) diff --git a/src/arrow_reader/column/string.rs b/src/arrow_reader/column/string.rs index 7c2059c6..556a60a6 100644 --- a/src/arrow_reader/column/string.rs +++ b/src/arrow_reader/column/string.rs @@ -36,7 +36,7 @@ impl Iterator for DirectStringIterator { } pub fn new_direct_string_iter(column: &Column) -> Result> { - let present = new_present_iter(column)?.try_collect::>()?; + let present = new_present_iter(column)?.collect::>>()?; let values = column .stream(Kind::Data) @@ -57,7 +57,7 @@ pub fn new_direct_string_iter(column: &Column) -> Result Result<(NullableIterator, ArrayRef)> { - let present = new_present_iter(column)?.try_collect::>()?; + let present = new_present_iter(column)?.collect::>>()?; // DictionaryData let values = column @@ -71,9 +71,9 @@ pub fn new_arrow_dict_string_decoder(column: &Column) -> Result<(NullableIterato .transpose()? .map(|reader| Box::new(RleReaderV2::try_new(reader, false, true))) .context(error::InvalidColumnSnafu { name: &column.name })?; - let mut iter = DirectStringIterator { values, lengths }; + let iter = DirectStringIterator { values, lengths }; - let values = iter.try_collect::>()?; + let values = iter.collect::>>()?; let indexes = column .stream(Kind::Data) diff --git a/src/arrow_reader/column/timestamp.rs b/src/arrow_reader/column/timestamp.rs index 58e85d1d..be27809e 100644 --- a/src/arrow_reader/column/timestamp.rs +++ b/src/arrow_reader/column/timestamp.rs @@ -45,7 +45,7 @@ impl Iterator for TimestampIterator { } pub fn new_timestamp_iter(column: &Column) -> Result> { - let present = new_present_iter(column)?.try_collect::>()?; + let present = new_present_iter(column)?.collect::>>()?; let data = column .stream(Kind::Data) diff --git a/src/lib.rs b/src/lib.rs index 4818aaa9..d26bcbc2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,8 +1,3 @@ -#![feature(trait_upcasting)] -#![allow(incomplete_features)] -#![feature(iterator_try_collect)] -#![feature(iter_next_chunk)] - pub mod arrow_reader; pub mod async_arrow_reader; pub mod error; diff --git a/src/reader/decode/rle_v2.rs b/src/reader/decode/rle_v2.rs index 33240df0..3adf1eaa 100644 --- a/src/reader/decode/rle_v2.rs +++ b/src/reader/decode/rle_v2.rs @@ -143,8 +143,8 @@ mod test { let expected = [1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1]; let cursor = Cursor::new(data); - let mut reader = UnsignedRleReaderV2::try_new(cursor, false); - let a = reader.try_collect::>().unwrap(); + let reader = UnsignedRleReaderV2::try_new(cursor, false); + let a = reader.collect::>>().unwrap(); assert_eq!(a, expected); // direct @@ -152,8 +152,8 @@ mod test { let expected = [23713, 43806, 57005, 48879]; let cursor = Cursor::new(data); - let mut reader = UnsignedRleReaderV2::try_new(cursor, false); - let a = reader.try_collect::>().unwrap(); + let reader = UnsignedRleReaderV2::try_new(cursor, false); + let a = reader.collect::>>().unwrap(); assert_eq!(a, expected); // patched base @@ -167,32 +167,32 @@ mod test { ]; let cursor = Cursor::new(data); - let mut reader = UnsignedRleReaderV2::try_new(cursor, false); - let a = reader.try_collect::>().unwrap(); + let reader = UnsignedRleReaderV2::try_new(cursor, false); + let a = reader.collect::>>().unwrap(); assert_eq!(a, expected); let data = [196u8, 9, 2, 2, 74, 40, 166]; let expected = [2u64, 3, 5, 7, 11, 13, 17, 19, 23, 29]; let cursor = Cursor::new(data); - let mut reader = UnsignedRleReaderV2::try_new(cursor, false); - let a = reader.try_collect::>().unwrap(); + let reader = UnsignedRleReaderV2::try_new(cursor, false); + let a = reader.collect::>>().unwrap(); assert_eq!(a, expected); let data = [0xc6u8, 0x09, 0x02, 0x02, 0x22, 0x42, 0x42, 0x46]; let expected = [2u64, 3, 5, 7, 11, 13, 17, 19, 23, 29]; let cursor = Cursor::new(data); - let mut reader = UnsignedRleReaderV2::try_new(cursor, false); - let a = reader.try_collect::>().unwrap(); + let reader = UnsignedRleReaderV2::try_new(cursor, false); + let a = reader.collect::>>().unwrap(); assert_eq!(a, expected); let data = [7u8, 1]; let expected = [1u64, 1, 1, 1, 1, 1, 1, 1, 1, 1]; let cursor = Cursor::new(data); - let mut reader = UnsignedRleReaderV2::try_new(cursor, false); - let a = reader.try_collect::>().unwrap(); + let reader = UnsignedRleReaderV2::try_new(cursor, false); + let a = reader.collect::>>().unwrap(); assert_eq!(a, expected); } @@ -202,8 +202,8 @@ mod test { let data: [u8; 3] = [0x0a, 0x27, 0x10]; let cursor = Cursor::new(data); - let mut reader = UnsignedRleReaderV2::try_new(cursor, false); - let a = reader.try_collect::>().unwrap(); + let reader = UnsignedRleReaderV2::try_new(cursor, false); + let a = reader.collect::>>().unwrap(); assert_eq!(a, vec![10000, 10000, 10000, 10000, 10000]); } @@ -214,8 +214,8 @@ mod test { let data: [u8; 10] = [0x5e, 0x03, 0x5c, 0xa1, 0xab, 0x1e, 0xde, 0xad, 0xbe, 0xef]; let cursor = Cursor::new(data); - let mut reader = UnsignedRleReaderV2::try_new(cursor, false); - let a = reader.try_collect::>().unwrap(); + let reader = UnsignedRleReaderV2::try_new(cursor, false); + let a = reader.collect::>>().unwrap(); assert_eq!(a, vec![23713, 43806, 57005, 48879]); } @@ -226,8 +226,8 @@ mod test { let data = [110u8, 3, 0, 185, 66, 1, 86, 60, 1, 189, 90, 1, 125, 222]; let cursor = Cursor::new(data); - let mut reader = RleReaderV2::try_new(cursor, true, false); - let a = reader.try_collect::>().unwrap(); + let reader = RleReaderV2::try_new(cursor, true, false); + let a = reader.collect::>>().unwrap(); assert_eq!(a, vec![23713, 43806, 57005, 48879]); } @@ -241,8 +241,8 @@ mod test { let data: [u8; 8] = [0xc6, 0x09, 0x02, 0x02, 0x22, 0x42, 0x42, 0x46]; let cursor = Cursor::new(data); - let mut reader = UnsignedRleReaderV2::try_new(cursor, false); - let a = reader.try_collect::>().unwrap(); + let reader = UnsignedRleReaderV2::try_new(cursor, false); + let a = reader.collect::>>().unwrap(); assert_eq!(a, vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29]); } @@ -259,9 +259,9 @@ mod test { ]; let cursor = Cursor::new(data); - let mut reader = RleReaderV2::try_new(cursor, false, false); + let reader = RleReaderV2::try_new(cursor, false, false); let a = reader - .try_collect::>() + .collect::>>() .unwrap() .into_iter() .map(|v| v as u64) @@ -301,8 +301,8 @@ mod test { ]; let cursor = Cursor::new(data); - let mut reader = RleReaderV2::try_new(cursor, false, false); - let a = reader.try_collect::>().unwrap(); + let reader = RleReaderV2::try_new(cursor, false, false); + let a = reader.collect::>>().unwrap(); assert_eq!(a.len(), expected.len());