-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[C++][Parquet] Allow use of FileDecryptionProperties after CryptoFactory is destroyed #40328
Description
Describe the enhancement requested
The CryptoFactory::GetFileDecryptionProperties method has this comment:
arrow/cpp/src/parquet/encryption/crypto_factory.h
Lines 116 to 119 in 5ce6ff4
| /// The returned FileDecryptionProperties object will use the cache inside this | |
| /// CryptoFactory object, so please keep this | |
| /// CryptoFactory object alive along with the returned | |
| /// FileDecryptionProperties object. |
I've recently been working on adding bindings to the Parquet key management tools API to ParquetSharp, a .NET Parquet library that wraps the Arrow C++ Parquet library: G-Research/ParquetSharp#426
I couldn't find a good way to keep the CryptoFactory alive as long as the FileDecryptionProperties are alive, so this means that users of the .NET library have to be aware of this requirement to avoid getting a native error from the C++ library that can't be caught as a .NET exception.
Ideally for our use case, the FileDecryptionProperties could remain alive independent of the CryptoFactory. It seems to me like this would also be better for other uses of the C++ API, by making the API simpler and more robust.
I will make a PR with a proposed change to fix this.
Component(s)
C++, Parquet