Skip to content
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

Merged
merged 18 commits into from
Mar 27, 2024

Conversation

etseidl
Copy link
Contributor

@etseidl etseidl commented Mar 21, 2024

Description

Closes #15224. Now use logical type exclusively in the reader rather than the deprecated converted type.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@etseidl etseidl requested a review from a team as a code owner March 21, 2024 16:33
@etseidl etseidl requested review from mythrocks and ttnghia March 21, 2024 16:33
Copy link

copy-pr-bot bot commented Mar 21, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Mar 21, 2024
@vuule vuule self-requested a review March 22, 2024 17:08
@mythrocks mythrocks added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Mar 22, 2024
@mythrocks
Copy link
Contributor

/ok to test

Copy link
Contributor

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@vuule vuule left a 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.

cpp/src/io/parquet/page_decode.cuh Show resolved Hide resolved
cpp/src/io/parquet/reader_impl.cpp Outdated Show resolved Hide resolved
cpp/src/io/parquet/reader_impl_helpers.cpp Outdated Show resolved Hide resolved
Comment on lines +378 to 389
// 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));
}
Copy link
Contributor

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?)

Copy link
Contributor Author

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.

@vuule
Copy link
Contributor

vuule commented Mar 25, 2024

/ok to test

@vuule
Copy link
Contributor

vuule commented Mar 26, 2024

/ok to test

@vuule
Copy link
Contributor

vuule commented Mar 27, 2024

/merge

@rapids-bot rapids-bot bot merged commit a7ceede into rapidsai:branch-24.06 Mar 27, 2024
73 checks passed
@etseidl etseidl deleted the logical_types branch March 27, 2024 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Parquet reader should use LogicalType rather than ConvertedType
4 participants