tolleybot commented on code in PR #34616:
URL: https://github.com/apache/arrow/pull/34616#discussion_r1254656599


##########
cpp/src/arrow/dataset/parquet_encryption_config.h:
##########
@@ -0,0 +1,70 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include "arrow/dataset/type_fwd.h"
+#include "parquet/encryption/crypto_factory.h"
+#include "parquet/encryption/encryption.h"
+#include "parquet/encryption/kms_client.h"
+
+namespace arrow {
+namespace dataset {
+
+/// core class, that translates the parameters of high level encryption
+struct ARROW_DS_EXPORT DatasetEncryptionConfiguration {
+  DatasetEncryptionConfiguration()
+      : kms_connection_config(
+            std::make_shared<parquet::encryption::KmsConnectionConfig>()) {}
+
+  void Setup(
+      std::shared_ptr<parquet::encryption::CryptoFactory> crypto_factory,
+      std::shared_ptr<parquet::encryption::KmsConnectionConfig> 
kms_connection_config,
+      std::shared_ptr<parquet::encryption::EncryptionConfiguration> 
encryption_config) {
+    this->crypto_factory = std::move(crypto_factory);
+    this->kms_connection_config = std::move(kms_connection_config);
+    this->encryption_config = std::move(encryption_config);
+  }
+
+  std::shared_ptr<parquet::encryption::CryptoFactory> crypto_factory;
+  std::shared_ptr<parquet::encryption::KmsConnectionConfig> 
kms_connection_config;
+  std::shared_ptr<parquet::encryption::EncryptionConfiguration> 
encryption_config;
+};

Review Comment:
   I recall now the reason for the existence of the Setup function. It resolves 
a compile-time issue for the Python/Cython bindings. Previously, I encountered 
an issue where simply setting the values would cause compiler issues due to 
undefined types when the PARQUET_REQUIRE_ENCRYPTION flag wasn't set to "ON".  
To alleviate these compiler errors, I introduced the Setup function, which 
resolved the issue.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to