-
Notifications
You must be signed in to change notification settings - Fork 49
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
[WIP] updates for delta-rs #189
base: main
Are you sure you want to change the base?
Conversation
@@ -206,11 +206,19 @@ impl TryFrom<&ArrowDataType> for DataType { | |||
ArrowDataType::Binary => Ok(DataType::Primitive(PrimitiveType::Binary)), | |||
ArrowDataType::FixedSizeBinary(_) => Ok(DataType::Primitive(PrimitiveType::Binary)), | |||
ArrowDataType::LargeBinary => Ok(DataType::Primitive(PrimitiveType::Binary)), | |||
ArrowDataType::Decimal128(p, s) => Ok(DataType::decimal(*p, *s)), | |||
ArrowDataType::Decimal128(p, s) => { | |||
if p > &38 || s > &38 { |
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.
As far as I know Arrow Decimal128 can't hold larger than 38 precision/scale, so this check seems unnecessary
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.
the input can hold i8
, u8
values, which of course would be wrong, but users could construct it. since we a re fallible here, I though why not check ...
in other cases where we are currently not on a fallible code path I omitted the checks thus far, where there may be more need for it. for instance the DataType::decimal
function below does not check internally so far, but I'll check how much that bubbles up ...
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.
Interesting, I remember in pyarrow this is checked, I guess wasnt safe to assume the same behavior translates to arrow-rs ^^
@@ -62,7 +64,7 @@ impl Scalar { | |||
PrimitiveType::String => Arc::new(StringArray::new_null(num_rows)), | |||
PrimitiveType::Boolean => Arc::new(BooleanArray::new_null(num_rows)), | |||
PrimitiveType::Timestamp | PrimitiveType::TimestampNtz => { |
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.
Btw, this will create an array with timezone UTC for timestampNtz as well
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! fixed it.
Just tracking some work required to integrate kernel into delta-rs.
Specifically the serde support may not necessarily something we want to keep supporting indefinitely but right now it would require some massive refactors in delta-rs ...
also includes changes from #190