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

Fix bugs related to partial aggregation pushdown refactoring #22131

Merged

Conversation

rschlussel
Copy link
Contributor

Description

Fixes bugs from the refactoring of error handling for partial aggregation pushdown #22011.

  1. Accidentally was using the orc error handling for the parquet files because the new utility class with parquet exception mapping didn't get added to the commit. This switches the error handling back to what it was before
  2. Fix a resource leak for aggregated page source factories when no error is encountered. I think this leak might have been present before the refactoring too.

Impact

Error messages should now match what they were before #22011, and there should no longer be a resource leak.

Test Plan

CI

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

accidentally used the orc exception handling during refactoring, as the
Parquet file never got added
The OrcDataSource wasn't being closed unless there was an error.
@rschlussel rschlussel requested a review from a team as a code owner March 8, 2024 19:17
{
private ParquetPageSourceFactoryUtils() {}

public static PrestoException mapToPrestoException(Exception e, Path path, HiveFileSplit fileSplit)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was copied wholesale from the code that had been in ParquetPageSourceFactory. No changes here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can probably generalize common exceptions and keep them in a all purpose PageSourceFactoryUtils

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To clarify this is the common area. This code was copied from what had previously been in ParquetPageSourceFactory. I deleted it from there in my last PR to move it to this common utility class, but accidentally didn't include this file when I pushed the changes in my last PR and didn't notice because I also had the wrong import in the code.

{
private ParquetPageSourceFactoryUtils() {}

public static PrestoException mapToPrestoException(Exception e, Path path, HiveFileSplit fileSplit)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can probably generalize common exceptions and keep them in a all purpose PageSourceFactoryUtils

@rschlussel rschlussel requested a review from ajaygeorge March 11, 2024 17:25
Copy link
Contributor

@ajaygeorge ajaygeorge left a comment

Choose a reason for hiding this comment

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

import static com.facebook.presto.hive.parquet.HdfsParquetDataSource.buildHdfsParquetDataSource;
import static com.facebook.presto.hive.parquet.ParquetPageSourceFactory.createDecryptor;
import static com.facebook.presto.hive.parquet.ParquetPageSourceFactoryUtils.mapToPrestoException;
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch

Copy link
Contributor

@ajaygeorge ajaygeorge left a comment

Choose a reason for hiding this comment

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

@rschlussel rschlussel merged commit 29cc196 into prestodb:master Mar 11, 2024
56 checks passed
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.

3 participants