Skip to content

Commit

Permalink
Rebased on /pull/6637
Browse files Browse the repository at this point in the history
  • Loading branch information
rok committed Feb 10, 2025
1 parent 4b38ff5 commit 9ed8529
Show file tree
Hide file tree
Showing 23 changed files with 1,694 additions and 89 deletions.
5 changes: 5 additions & 0 deletions parquet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ rust-version = { workspace = true }

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

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

[dev-dependencies]
base64 = { version = "0.22", default-features = false, features = ["std"] }
Expand Down Expand Up @@ -123,6 +126,8 @@ sysinfo = ["dep:sysinfo"]
crc = ["dep:crc32fast"]
# Enable SIMD UTF-8 validation
simdutf8 = ["dep:simdutf8"]
# Enable Parquet modular encryption support
encryption = ["dep:ring"]


[[example]]
Expand Down
9 changes: 8 additions & 1 deletion parquet/examples/read_with_rowgroup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ async fn main() -> Result<()> {
let mut file = File::open(&path).await.unwrap();

// The metadata could be cached in other places, this example only shows how to read
let metadata = file.get_metadata().await?;
let metadata = file
.get_metadata(
#[cfg(feature = "encryption")]
None,
)
.await?;

for rg in metadata.row_groups() {
let mut rowgroup = InMemoryRowGroup::create(rg.clone(), ProjectionMask::all());
Expand Down Expand Up @@ -121,6 +126,8 @@ impl RowGroups for InMemoryRowGroup {
self.metadata.column(i),
self.num_rows(),
None,
#[cfg(feature = "encryption")]
None,
)?);

Ok(Box::new(ColumnChunkIterator {
Expand Down
Loading

0 comments on commit 9ed8529

Please sign in to comment.