Skip to content

Commit

Permalink
Implemented some of the Minor comments in apacheGH-34616
Browse files Browse the repository at this point in the history
  • Loading branch information
anjakefala committed Sep 14, 2023
1 parent 65e1e54 commit 7e1b24c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cpp/src/arrow/dataset/file_parquet.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class ARROW_DS_EXPORT ParquetFileWriteOptions : public FileWriteOptions {
/// \brief Parquet Arrow writer properties.
std::shared_ptr<parquet::ArrowWriterProperties> arrow_writer_properties;

// A configuration structure that provides per file encryption properties for a dataset
// A configuration structure that provides encryption properties for a dataset
std::shared_ptr<ParquetEncryptionConfig> parquet_encryption_config = NULLPTR;

protected:
Expand Down
6 changes: 4 additions & 2 deletions cpp/src/arrow/dataset/file_parquet_encryption_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ constexpr std::string_view kFooterKeyMasterKey = "0123456789012345";
constexpr std::string_view kFooterKeyMasterKeyId = "footer_key";
constexpr std::string_view kFooterKeyName = "footer_key";
constexpr std::string_view kColumnMasterKey = "1234567890123450";
constexpr std::string_view kColumnMasterKeysId = "col_key";
constexpr std::string_view kColumnMasterKeyId = "col_key";
constexpr std::string_view kColumnKeyMapping = "col_key: a";
constexpr std::string_view kBaseDir = "";

Expand Down Expand Up @@ -78,7 +78,7 @@ class DatasetEncryptionTest : public ::testing::Test {

// Prepare encryption properties.
std::unordered_map<std::string, std::string> key_map;
key_map.emplace(kColumnMasterKeysId, kColumnMasterKey);
key_map.emplace(kColumnMasterKeyId, kColumnMasterKey);
key_map.emplace(kFooterKeyMasterKeyId, kFooterKeyMasterKey);

crypto_factory = std::make_shared<parquet::encryption::CryptoFactory>();
Expand Down Expand Up @@ -177,6 +177,8 @@ TEST_F(DatasetEncryptionTest, WriteReadDatasetWithEncryption) {

// Verify the data was read correctly
ASSERT_OK_AND_ASSIGN(auto combined_table, read_table->CombineChunks());
// Validate the table
ASSERT_OK(combined_table->ValidateFull());
AssertTablesEqual(*combined_table, *table);
}

Expand Down
6 changes: 3 additions & 3 deletions python/examples/dataset/write_dataset_encrypted.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
# specific language governing permissions and limitations
# under the License.

import shutil
import os
from datetime import timedelta

import pyarrow as pa
import pyarrow.dataset as ds
import pyarrow.parquet.encryption as pe
from pyarrow.tests.parquet.encryption import InMemoryKmsClient
from datetime import timedelta
import shutil
import os

""" A sample to demonstrate parquet dataset encryption and decryption"""

Expand Down
4 changes: 3 additions & 1 deletion python/pyarrow/_dataset_parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ IF PARQUET_ENCRYPTION_ENABLED:
kms_connection_config : KmsConnectionConfig
Configuration for connecting to Key Management Service.
encryption_config : EncryptionConfiguration
Configuration for encryption settings.
:ref:`Configure <encryption-configuration>`_ e.g. which columns to encrypt,
length of encryption keys, Parquet Encryption Algorithm
and more.
Raises
------
Expand Down

0 comments on commit 7e1b24c

Please sign in to comment.