| 65 | namespace { |
| 66 | |
| 67 | parquet::ReaderProperties MakeReaderProperties( |
| 68 | const ParquetFileFormat& format, ParquetFragmentScanOptions* parquet_scan_options, |
| 69 | const std::string& path = "", std::shared_ptr<fs::FileSystem> filesystem = nullptr, |
| 70 | MemoryPool* pool = default_memory_pool()) { |
| 71 | // Can't mutate pool after construction |
| 72 | parquet::ReaderProperties properties(pool); |
| 73 | if (parquet_scan_options->reader_properties->is_buffered_stream_enabled()) { |
| 74 | properties.enable_buffered_stream(); |
| 75 | } else { |
| 76 | properties.disable_buffered_stream(); |
| 77 | } |
| 78 | properties.set_buffer_size(parquet_scan_options->reader_properties->buffer_size()); |
| 79 | |
| 80 | auto file_decryption_prop = |
| 81 | parquet_scan_options->reader_properties->file_decryption_properties(); |
| 82 | |
| 83 | #ifdef PARQUET_REQUIRE_ENCRYPTION |
| 84 | auto parquet_decrypt_config = parquet_scan_options->parquet_decryption_config; |
| 85 | |
| 86 | if (parquet_decrypt_config != nullptr) { |
| 87 | file_decryption_prop = |
| 88 | parquet_decrypt_config->crypto_factory->GetFileDecryptionProperties( |
| 89 | *parquet_decrypt_config->kms_connection_config, |
| 90 | *parquet_decrypt_config->decryption_config, path, filesystem); |
| 91 | } |
| 92 | #else |
| 93 | if (parquet_scan_options->parquet_decryption_config != nullptr) { |
| 94 | parquet::ParquetException::NYI("Encryption is not supported in this build."); |
| 95 | } |
| 96 | #endif |
| 97 | |
| 98 | properties.file_decryption_properties(file_decryption_prop); |
| 99 | |
| 100 | properties.set_thrift_string_size_limit( |
| 101 | parquet_scan_options->reader_properties->thrift_string_size_limit()); |
| 102 | properties.set_thrift_container_size_limit( |
| 103 | parquet_scan_options->reader_properties->thrift_container_size_limit()); |
| 104 | |
| 105 | properties.set_page_checksum_verification( |
| 106 | parquet_scan_options->reader_properties->page_checksum_verification()); |
| 107 | |
| 108 | return properties; |
| 109 | } |
| 110 | |
| 111 | parquet::ArrowReaderProperties MakeArrowReaderProperties( |
| 112 | const ParquetFileFormat& format, const parquet::FileMetaData& metadata) { |
no test coverage detected