-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fix bug with decoding timestamp as decimal #36
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @progval for identifying this bug
@@ -103,7 +103,7 @@ fn decimal128_decoder( | |||
let data = get_rle_reader(column, data)?; | |||
|
|||
let secondary = stripe.stream_map().get(column, Kind::Secondary); | |||
let secondary = get_rle_reader(column, secondary)?; | |||
let secondary = get_unsigned_rle_reader(column, secondary); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug was here. Secondary is unsigned stream. It's retrieved correctly for timestamp, but was mistakenly taken as signed here. See line 62 for correct behaviour.
orc-rust/src/array_decoder/timestamp.rs
Lines 53 to 72 in f934c8e
fn get_inner_timestamp_decoder<T: ArrowTimestampType + Send>( | |
column: &Column, | |
stripe: &Stripe, | |
seconds_since_unix_epoch: i64, | |
) -> Result<PrimitiveArrayDecoder<T>> { | |
let data = stripe.stream_map().get(column, Kind::Data); | |
let data = get_rle_reader(column, data)?; | |
let secondary = stripe.stream_map().get(column, Kind::Secondary); | |
let secondary = get_unsigned_rle_reader(column, secondary); | |
let present = PresentDecoder::from_stripe(stripe, column); | |
let iter = Box::new(TimestampDecoder::<T>::new( | |
seconds_since_unix_epoch, | |
data, | |
secondary, | |
)); | |
Ok(PrimitiveArrayDecoder::<T>::new(iter, present)) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Jefffrey for fixing this.
There is CI failure that not related to this PR, I will try fixing them later. |
Closes #14