You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add more examples of using Parquet encryption (#7374)
* Add encryption round-trip example
* Add examples for building FileEncryptionProperties and FileDecryptionProperties
* Add an example of using a KeyRetriever
* Apply suggestions from code review
Co-authored-by: Matthijs Brobbel <[email protected]>
---------
Co-authored-by: Matthijs Brobbel <[email protected]>
Copy file name to clipboardExpand all lines: parquet/src/encryption/encrypt.rs
+37Lines changed: 37 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,41 @@ impl EncryptionKey {
53
53
54
54
#[derive(Debug,Clone,PartialEq)]
55
55
/// Defines how data in a Parquet file should be encrypted
56
+
///
57
+
/// The `FileEncryptionProperties` should be included in the [`WriterProperties`](crate::file::properties::WriterProperties)
58
+
/// used to write a file by using [`WriterPropertiesBuilder::with_file_encryption_properties`](crate::file::properties::WriterPropertiesBuilder::with_file_encryption_properties).
59
+
///
60
+
/// # Examples
61
+
///
62
+
/// Create `FileEncryptionProperties` for a file encrypted with uniform encryption,
63
+
/// where all metadata and data are encrypted with the footer key:
64
+
/// ```
65
+
/// # use parquet::encryption::encrypt::FileEncryptionProperties;
66
+
/// let file_encryption_properties = FileEncryptionProperties::builder(b"0123456789012345".into())
67
+
/// .build()?;
68
+
/// # Ok::<(), parquet::errors::ParquetError>(())
69
+
/// ```
70
+
///
71
+
/// Create properties for a file where columns are encrypted with different keys.
72
+
/// Any columns without a key specified will be unencrypted:
73
+
/// ```
74
+
/// # use parquet::encryption::encrypt::FileEncryptionProperties;
75
+
/// let file_encryption_properties = FileEncryptionProperties::builder(b"0123456789012345".into())
0 commit comments