kou commented on code in PR #34616:
URL: https://github.com/apache/arrow/pull/34616#discussion_r1247267725
##########
cpp/src/arrow/dataset/file_parquet.cc:
##########
@@ -67,8 +66,25 @@ parquet::ReaderProperties MakeReaderProperties(
properties.disable_buffered_stream();
}
properties.set_buffer_size(parquet_scan_options->reader_properties->buffer_size());
+
+#if PARQUET_REQUIRE_ENCRYPTION
Review Comment:
```suggestion
#ifdef PARQUET_REQUIRE_ENCRYPTION
```
##########
cpp/src/arrow/dataset/file_parquet.h:
##########
@@ -136,6 +138,40 @@ class ARROW_DS_EXPORT ParquetFileFormat : public
FileFormat {
fs::FileLocator destination_locator) const override;
std::shared_ptr<FileWriteOptions> DefaultWriteOptions() override;
+
+ /// \brief A getter function to retrieve the dataset encryption configuration
+ std::shared_ptr<DatasetEncryptionConfiguration> GetDatasetEncryptionConfig()
const {
+#if PARQUET_REQUIRE_ENCRYPTION
+ return dataset_encryption_config_;
+#else
+ return NULLPTR;
+#endif
+ }
+ /// \brief A getter function to retrieve the dataset decryption configuration
+ std::shared_ptr<DatasetDecryptionConfiguration> GetDatasetDecryptionConfig()
const {
+#if PARQUET_REQUIRE_ENCRYPTION
Review Comment:
```suggestion
#ifdef PARQUET_REQUIRE_ENCRYPTION
```
##########
cpp/src/arrow/dataset/file_parquet.cc:
##########
@@ -621,11 +637,38 @@ Result<std::shared_ptr<FileWriter>>
ParquetFileFormat::MakeWriter(
auto parquet_options =
checked_pointer_cast<ParquetFileWriteOptions>(options);
- std::unique_ptr<parquet::arrow::FileWriter> parquet_writer;
- ARROW_ASSIGN_OR_RAISE(parquet_writer, parquet::arrow::FileWriter::Open(
- *schema, default_memory_pool(),
destination,
- parquet_options->writer_properties,
-
parquet_options->arrow_writer_properties));
+ std::unique_ptr<parquet::arrow::FileWriter> parquet_writer = NULLPTR;
+
+#if PARQUET_REQUIRE_ENCRYPTION
Review Comment:
```suggestion
#ifdef PARQUET_REQUIRE_ENCRYPTION
```
##########
cpp/src/arrow/dataset/file_parquet.h:
##########
@@ -136,6 +138,40 @@ class ARROW_DS_EXPORT ParquetFileFormat : public
FileFormat {
fs::FileLocator destination_locator) const override;
std::shared_ptr<FileWriteOptions> DefaultWriteOptions() override;
+
+ /// \brief A getter function to retrieve the dataset encryption configuration
+ std::shared_ptr<DatasetEncryptionConfiguration> GetDatasetEncryptionConfig()
const {
+#if PARQUET_REQUIRE_ENCRYPTION
Review Comment:
```suggestion
#ifdef PARQUET_REQUIRE_ENCRYPTION
```
##########
cpp/src/arrow/dataset/CMakeLists.txt:
##########
@@ -36,6 +36,10 @@ if(ARROW_PARQUET)
string(APPEND ARROW_DATASET_PKG_CONFIG_REQUIRES " parquet")
endif()
+if(PARQUET_REQUIRE_ENCRYPTION)
+ add_definitions(-DPARQUET_REQUIRE_ENCRYPTION=1)
+endif()
+
Review Comment:
Could you use `cpp/src/arrow/util/config.h.cmake` instead of
`add_definitions()`?
--
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]