Ted-Jiang commented on code in PR #2089:
URL: https://github.com/apache/arrow-rs/pull/2089#discussion_r922688898
##########
parquet/src/encodings/decoding.rs:
##########
@@ -791,6 +824,25 @@ impl<T: DataType> Decoder<T> for
DeltaLengthByteArrayDecoder<T> {
fn encoding(&self) -> Encoding {
Encoding::DELTA_LENGTH_BYTE_ARRAY
}
+
+ fn skip(&mut self, num_values: usize) -> Result<usize> {
+ match T::get_physical_type() {
+ Type::BYTE_ARRAY => {
+ let num_values = cmp::min(num_values, self.num_values);
+
+ let next_offset: i32 =
self.lengths[self.current_idx..self.current_idx + num_values].iter().sum();
+
+ self.current_idx += num_values;
+ self.offset += next_offset as usize;
+
+ self.num_values -= num_values;
+ Ok(num_values)
+ }
+ _ => Err(general_err!(
+ "DeltaLengthByteArrayDecoder only support ByteArrayType"
+ )),
Review Comment:
```suggestion
other_type => Err(general_err!(
"DeltaLengthByteArrayDecoder not support {}, only support
byte array", other_type
)),
```
I think print the type is easy for debugging
--
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]