Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/src/parquet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ if(PARQUET_REQUIRE_ENCRYPTION)
GIT_REPOSITORY https://github.com/protegrity/DataBatchProtectionService.git
#TODO: Change to a specific tag/commit when we have one.
#https://github.com/protegrity/arrow/issues/179
GIT_TAG 4c808b2233ed0bc04529c3b0dbf7c214c4901043
GIT_TAG 6206fb0e27556a0df9160364caa3819e4af3fe0f
Copy link
Collaborator

Choose a reason for hiding this comment

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

As a reference, can we add an inline comment to what PR is this aligned with?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not sure about this. A PR link may not give the full picture of the code that is being referenced. Let me know your thoughts.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You're right. It's ok to leave as-is. Thanks.

GIT_SHALLOW FALSE)

fetchcontent_getproperties(dbps_agent)
Expand Down
6 changes: 4 additions & 2 deletions cpp/src/parquet/encryption/external/dbpa_enum_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ const std::unordered_map<parquet::Type::type, dbps::external::Type::type>
{parquet::Type::FLOAT, dbps::external::Type::FLOAT},
{parquet::Type::DOUBLE, dbps::external::Type::DOUBLE},
{parquet::Type::BYTE_ARRAY, dbps::external::Type::BYTE_ARRAY},
{parquet::Type::FIXED_LEN_BYTE_ARRAY, dbps::external::Type::FIXED_LEN_BYTE_ARRAY},
{parquet::Type::UNDEFINED, dbps::external::Type::UNDEFINED}};
{parquet::Type::FIXED_LEN_BYTE_ARRAY, dbps::external::Type::FIXED_LEN_BYTE_ARRAY}};
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would add an inline comment to say why UNDEFINED can be excluded. Basically what we talked about, but to keep for future reference.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done.

// parquet::Type::UNDEFINED is excluded as it is not a
// Parquet type per-se, but rather a value used in exception cases.


// ------------------------------------------------------------
// arrow::Compression -> dbps::external::CompressionCodec
Expand Down
19 changes: 11 additions & 8 deletions cpp/src/parquet/encryption/external/dbpa_enum_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,16 @@ TEST_F(DBPAUtilsTest, AllValidTypeMappings) {
parquet::Type::BOOLEAN, parquet::Type::INT32,
parquet::Type::INT64, parquet::Type::INT96,
parquet::Type::FLOAT, parquet::Type::DOUBLE,
parquet::Type::BYTE_ARRAY, parquet::Type::FIXED_LEN_BYTE_ARRAY,
parquet::Type::UNDEFINED};
parquet::Type::BYTE_ARRAY, parquet::Type::FIXED_LEN_BYTE_ARRAY};

// Ensure that the map is complete.
ASSERT_EQ(valid_parquet_types.size(), parquet_type_enum_size_);
// Ensure that the map is complete (excluding UNDEFINED)
ASSERT_EQ(valid_parquet_types.size(), parquet_type_enum_size_ - 1);

for (auto parquet_type : valid_parquet_types) {
EXPECT_NO_THROW(DBPAEnumUtils::ParquetTypeToDBPA(parquet_type));
}

EXPECT_THROW(DBPAEnumUtils::ParquetTypeToDBPA(parquet::Type::UNDEFINED), std::invalid_argument);
}

TEST_F(DBPAUtilsTest, AllValidCompressionMappings) {
Expand All @@ -131,13 +132,15 @@ TEST_F(DBPAUtilsTest, MapSizeAssertions) {

// Parquet::Type::type assertions
EXPECT_EQ(parquet_type_enum_size_, 9)
<< "Expected 9 parquet type mappings (excluding UNDEFINED)";
<< "Expected 9 parquet type mappings";

EXPECT_EQ(parquet_type_enum_size_, DBPAEnumUtils::parquet_to_external_type_map.size())
// Excluding UNDEFINED
EXPECT_EQ(parquet_type_enum_size_ - 1, DBPAEnumUtils::parquet_to_external_type_map.size())
<< "Expected 9 parquet type mappings (excluding UNDEFINED)";

EXPECT_EQ(DBPAEnumUtils::parquet_to_external_type_map.size(), 9)
<< "Expected 9 parquet type mappings (excluding UNDEFINED)";
// Excluding UNDEFINED
EXPECT_EQ(DBPAEnumUtils::parquet_to_external_type_map.size(), 8)
<< "Expected 8 parquet type mappings (excluding UNDEFINED)";

// Arrow::Compression::type assertions
EXPECT_EQ(DBPAEnumUtils::arrow_to_external_compression_map.size(), 10)
Expand Down
Loading