Skip to content

Fix overflow while decoding timestamp#4

Closed
cxzl25 wants to merge 3 commits intoauron-project:v0.6.0-blaze-kwaifrom
cxzl25:fix_timestamp
Closed

Fix overflow while decoding timestamp#4
cxzl25 wants to merge 3 commits intoauron-project:v0.6.0-blaze-kwaifrom
cxzl25:fix_timestamp

Conversation

@cxzl25
Copy link
Copy Markdown
Collaborator

@cxzl25 cxzl25 commented Nov 12, 2025

External error: Overflow while decoding timestamp (seconds=-62135798400, nanoseconds=0) to Nanosecond
External error: Overflow while decoding timestamp (seconds=9246153600, nanoseconds=0) to Nanosecond

@cxzl25 cxzl25 force-pushed the fix_timestamp branch 3 times, most recently from c91facb to 95aef4d Compare November 12, 2025 13:49
Comment thread src/schema.rs
DataType::Decimal {
precision, scale, ..
} => ArrowDataType::Decimal128(*precision as u8, *scale as i8), // TODO: safety of cast?
DataType::Timestamp { .. } => ArrowDataType::Timestamp(TimeUnit::Nanosecond, None),
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use Nanosecond i64 may overflow

let num_since_epoch = (nanoseconds_since_epoch / nanoseconds_in_timeunit)

Comment thread tests/basic/main.rs
assert!(reader.collect::<Result<Vec<_>, _>>().is_err());
}
// #[test]
// pub fn overflowing_timestamps_test() {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After modifying it to microsecond, overflow can be avoided.

@cxzl25 cxzl25 marked this pull request as draft November 12, 2025 14:17
@cxzl25 cxzl25 closed this Nov 17, 2025
@cxzl25
Copy link
Copy Markdown
Collaborator Author

cxzl25 commented Nov 17, 2025

Upstream orc-rust has been merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant