-
Notifications
You must be signed in to change notification settings - Fork 915
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
Use logical types in Parquet reader #15365
Conversation
/ok to test |
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.
LGTM!
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.
Great improvement! Few small comments.
// TODO(ets): this is leftover from the original code, but will we ever output decimal as | ||
// anything but fixed point? | ||
if (logical_type.has_value() and logical_type->type == LogicalType::DECIMAL) { | ||
// if decimal but not outputting as float or decimal, then convert to no logical type | ||
if (column_type_id != type_id::FLOAT64 and | ||
not cudf::is_fixed_point(data_type{column_type_id})) { | ||
return std::make_tuple(clock_rate, thrust::nullopt); | ||
} | ||
} | ||
|
||
int8_t converted_type = converted.value_or(UNKNOWN); | ||
if (converted_type == DECIMAL && column_type_id != type_id::FLOAT64 && | ||
not cudf::is_fixed_point(data_type{column_type_id})) { | ||
converted_type = UNKNOWN; // Not converting to float64 or decimal | ||
} | ||
return std::make_tuple(type_width, clock_rate, converted_type); | ||
return std::make_tuple(clock_rate, std::move(logical_type)); | ||
} |
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.
A note from an offline discussion: we don't understand when this logic is useful (yet?)
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.
Further context: it seems in the distant past what is now handled by decimal128 was converted to FLOAT64
. This is no longer the case, so the above logic can (most likely) be safely removed and this entire function changed to return just clock_rate
.
/ok to test |
/ok to test |
/merge |
Description
Closes #15224. Now use logical type exclusively in the reader rather than the deprecated converted type.
Checklist