Skip to content

Commit a4ec1ab

Browse files
ggershinskyrok
authored andcommitted
Rebased on /pull/6637
1 parent 38d6e69 commit a4ec1ab

File tree

23 files changed

+1665
-91
lines changed

23 files changed

+1665
-91
lines changed

parquet/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ rust-version = { workspace = true }
3030

3131
[target.'cfg(target_arch = "wasm32")'.dependencies]
3232
ahash = { version = "0.8", default-features = false, features = ["compile-time-rng"] }
33+
# See https://github.com/briansmith/ring/issues/918#issuecomment-2077788925
34+
ring = { version = "0.17", default-features = false, features = ["wasm32_unknown_unknown_js", "std"], optional = true }
3335

3436
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
3537
ahash = { version = "0.8", default-features = false, features = ["runtime-rng"] }
@@ -70,6 +72,7 @@ half = { version = "2.1", default-features = false, features = ["num-traits"] }
7072
sysinfo = { version = "0.33.0", optional = true, default-features = false, features = ["system"] }
7173
crc32fast = { version = "1.4.2", optional = true, default-features = false }
7274
simdutf8 = { version = "0.1.5", optional = true, default-features = false }
75+
ring = { version = "0.17", default-features = false, features = ["std"], optional = true }
7376

7477
[dev-dependencies]
7578
base64 = { version = "0.22", default-features = false, features = ["std"] }
@@ -125,6 +128,8 @@ sysinfo = ["dep:sysinfo"]
125128
crc = ["dep:crc32fast"]
126129
# Enable SIMD UTF-8 validation
127130
simdutf8 = ["dep:simdutf8"]
131+
# Enable Parquet modular encryption support
132+
encryption = ["dep:ring"]
128133

129134

130135
[[example]]

parquet/examples/read_with_rowgroup.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ async fn main() -> Result<()> {
3535
let mut file = File::open(&path).await.unwrap();
3636

3737
// The metadata could be cached in other places, this example only shows how to read
38-
let metadata = file.get_metadata().await?;
38+
let metadata = file
39+
.get_metadata(
40+
#[cfg(feature = "encryption")]
41+
None,
42+
)
43+
.await?;
3944

4045
for rg in metadata.row_groups() {
4146
let mut rowgroup = InMemoryRowGroup::create(rg.clone(), ProjectionMask::all());
@@ -121,6 +126,8 @@ impl RowGroups for InMemoryRowGroup {
121126
self.metadata.column(i),
122127
self.num_rows(),
123128
None,
129+
#[cfg(feature = "encryption")]
130+
None,
124131
)?);
125132

126133
Ok(Box::new(ColumnChunkIterator {

0 commit comments

Comments
 (0)