Skip to content

Commit 473839e

Browse files
committed
Remove extra static GetParam, fix GetParam access
1 parent b0ef03f commit 473839e

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

cpp/src/arrow/dataset/file_parquet_encryption_test.cc

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ class DatasetEncryptionTestBase : public testing::TestWithParam<T> {
9393
static constexpr int kConcurrentIterations = 20;
9494
#endif
9595

96-
static const EncryptionTestParam& GetParam() {
97-
return testing::WithParamInterface<T>::GetParam();
98-
}
99-
10096
// This function creates a mock file system using the current time point, creates a
10197
// directory with the given base directory path, and writes a dataset to it using
10298
// provided Parquet file write options. The function also checks if the written files
@@ -128,7 +124,7 @@ class DatasetEncryptionTestBase : public testing::TestWithParam<T> {
128124
auto parquet_file_write_options =
129125
checked_pointer_cast<ParquetFileWriteOptions>(file_format->DefaultWriteOptions());
130126

131-
if (GetParam().use_crypto_factory) {
127+
if (this->GetParam().use_crypto_factory) {
132128
// Configure encryption keys via crypto factory.
133129
crypto_factory_ = std::make_shared<parquet::encryption::CryptoFactory>();
134130
auto kms_client_factory =
@@ -142,8 +138,8 @@ class DatasetEncryptionTestBase : public testing::TestWithParam<T> {
142138
auto encryption_config =
143139
std::make_shared<parquet::encryption::EncryptionConfiguration>(
144140
std::string(kFooterKeyName));
145-
encryption_config->uniform_encryption = GetParam().uniform_encryption;
146-
if (!GetParam().uniform_encryption) {
141+
encryption_config->uniform_encryption = this->GetParam().uniform_encryption;
142+
if (!this->GetParam().uniform_encryption) {
147143
std::stringstream column_key;
148144
column_key << kColumnMasterKeyId << ": " << ColumnName();
149145
encryption_config->column_keys = column_key.str();
@@ -159,7 +155,7 @@ class DatasetEncryptionTestBase : public testing::TestWithParam<T> {
159155
} else {
160156
// Configure encryption keys via writer options / file encryption properties.
161157
// non-uniform encryption not support by test
162-
ASSERT_TRUE(GetParam().uniform_encryption);
158+
ASSERT_TRUE(this->GetParam().uniform_encryption);
163159
auto file_encryption_properties =
164160
std::make_unique<parquet::FileEncryptionProperties::Builder>(
165161
kFooterKeyMasterKey)
@@ -173,10 +169,10 @@ class DatasetEncryptionTestBase : public testing::TestWithParam<T> {
173169
// Write dataset.
174170
auto dataset = std::make_shared<InMemoryDataset>(table_);
175171
EXPECT_OK_AND_ASSIGN(auto scanner_builder, dataset->NewScan());
176-
ARROW_EXPECT_OK(scanner_builder->UseThreads(GetParam().concurrently));
172+
ARROW_EXPECT_OK(scanner_builder->UseThreads(this->GetParam().concurrently));
177173
EXPECT_OK_AND_ASSIGN(auto scanner, scanner_builder->Finish());
178174

179-
if (GetParam().concurrently) {
175+
if (this->GetParam().concurrently) {
180176
// Have a notable number of threads to exhibit multi-threading issues
181177
ASSERT_OK_AND_ASSIGN(auto pool, arrow::internal::ThreadPool::Make(16));
182178
std::vector<Future<>> futures;
@@ -223,7 +219,7 @@ class DatasetEncryptionTestBase : public testing::TestWithParam<T> {
223219
// Set scan options.
224220
auto parquet_scan_options = std::make_shared<ParquetFragmentScanOptions>();
225221

226-
if (GetParam().use_crypto_factory) {
222+
if (this->GetParam().use_crypto_factory) {
227223
// Configure decryption keys via crypto factory.
228224
auto decryption_config =
229225
std::make_shared<parquet::encryption::DecryptionConfiguration>();
@@ -264,7 +260,7 @@ class DatasetEncryptionTestBase : public testing::TestWithParam<T> {
264260
}
265261

266262
void TestScanDataset() {
267-
if (GetParam().concurrently) {
263+
if (this->GetParam().concurrently) {
268264
// Create the dataset
269265
ASSERT_OK_AND_ASSIGN(auto dataset,
270266
OpenDataset("thread-1", crypto_factory_, key_map_));
@@ -309,7 +305,7 @@ class DatasetEncryptionTestBase : public testing::TestWithParam<T> {
309305
// Read dataset into table
310306
ARROW_ASSIGN_OR_RAISE(auto scanner_builder, dataset->NewScan());
311307
ARROW_ASSIGN_OR_RAISE(auto scanner, scanner_builder->Finish());
312-
ARROW_EXPECT_OK(scanner_builder->UseThreads(GetParam().concurrently));
308+
ARROW_EXPECT_OK(scanner_builder->UseThreads(testing::WithParamInterface<T>::GetParam().concurrently));
313309
return scanner->ToTable();
314310
}
315311

@@ -321,7 +317,7 @@ class DatasetEncryptionTestBase : public testing::TestWithParam<T> {
321317
}
322318

323319
protected:
324-
std::string base_dir_ = GetParam().concurrently ? "thread-1" : std::string(kBaseDir);
320+
std::string base_dir_ = this->GetParam().concurrently ? "thread-1" : std::string(kBaseDir);
325321
std::shared_ptr<fs::FileSystem> file_system_;
326322
std::shared_ptr<Table> table_, expected_table_;
327323
std::shared_ptr<Partitioning> partitioning_;

0 commit comments

Comments
 (0)