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

PARQUET-1126: Write unencrypted Parquet files without Hadoop #1376

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dlvenable
Copy link

If you want to write an unencrypted Parquet file without Hadoop, the existing code will use Hadoop to try to get encryption properties.

if (encryptionProperties == null) {
String path = file == null ? null : file.getPath();
Configuration hadoopConf = ConfigurationUtil.createHadoopConfiguration(conf);
encryptionProperties = ParquetOutputFormat.createEncryptionProperties(
hadoopConf, path == null ? null : new Path(path), writeContext);
}

However, if you have these null, we really didn't need to go through Hadoop. Also, it calls a helper method in ParquetOutputFormat. This class inherits from Hadoop's FileOutputFormat. So calling this method at all, requires Hadoop classes. To resolve this, I moved this helper into a package-protected EncryptionPropertiesHelper class.

Make sure you have checked all steps below.

Jira

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
testLoadEncPropertiesFactoryParquetConfiguration

Commits

  • My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines
    from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Style

  • My contribution adheres to the code style guidelines and Spotless passes.
    • To apply the necessary changes, run mvn spotless:apply -Pvector-plugins

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain Javadoc that explain what it does

… Hadoop in the classpath. Relates to PARQUET-1126.
@wgtmac wgtmac changed the title Write unencrypted Parquet files without Hadoop PARQUET-1126 PARQUET-1126: Write unencrypted Parquet files without Hadoop Jun 19, 2024

Configuration hadoopConf = ConfigurationUtil.createHadoopConfiguration(fileParquetConfig);
URI path = tempFilePath == null ? null : tempFilePath.toUri();
return createEncryptionProperties(
Copy link
Contributor

Choose a reason for hiding this comment

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

this will trigger a second loading of the factory class. Can we replace ll40-41 with the l52 code?

Copy link
Author

Choose a reason for hiding this comment

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

@ggershinsky , Thank you for taking a look at the PR. This is a good point. I corrected it in the latest commit.

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.

None yet

2 participants