Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable reading StringViewArray by default from Parquet #12092

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,21 @@ large_futures = "warn"

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin)"] }

## Temporary arrow-rs patch until 53.2.0 is released
## to get change in https://github.com/apache/arrow-rs/pull/6539
## See https://github.com/alamb/arrow-rs/pull/53 for details

[patch.crates-io]
arrow = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
arrow-array = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
arrow-buffer = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
arrow-cast = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
arrow-data = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
arrow-ipc = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
arrow-schema = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
arrow-select = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
arrow-string = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
arrow-ord = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
arrow-flight = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
parquet = { git = "https://github.com/apache/arrow-rs.git", rev = "3c2e694e89b12d6b70d7b1aed3f4dcff169de2da" }
14 changes: 8 additions & 6 deletions benchmarks/src/clickbench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ impl RunOpt {
None => queries.min_query_id()..=queries.max_query_id(),
};

// configure parquet options
let mut config = self.common.config();
config
.options_mut()
.execution
.parquet
.schema_force_view_types = self.common.force_view_types;
{
let parquet_options = &mut config.options_mut().execution.parquet;
// The hits_partitioned dataset specifies string columns
// as binary due to how it was written. Force it to strings
parquet_options.binary_as_string = true;
}

let ctx = SessionContext::new_with_config(config);
self.register_hits(&ctx).await?;
Expand Down Expand Up @@ -149,7 +151,7 @@ impl RunOpt {
Ok(())
}

/// Registrs the `hits.parquet` as a table named `hits`
/// Registers the `hits.parquet` as a table named `hits`
async fn register_hits(&self, ctx: &SessionContext) -> Result<()> {
let options = Default::default();
let path = self.path.as_os_str().to_str().unwrap();
Expand Down
6 changes: 1 addition & 5 deletions benchmarks/src/imdb/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,7 @@ impl RunOpt {
.config()
.with_collect_statistics(!self.disable_statistics);
config.options_mut().optimizer.prefer_hash_join = self.prefer_hash_join;
config
.options_mut()
.execution
.parquet
.schema_force_view_types = self.common.force_view_types;

let ctx = SessionContext::new_with_config(config);

// register tables
Expand Down
7 changes: 0 additions & 7 deletions benchmarks/src/tpch/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ impl RunOpt {
.config()
.with_collect_statistics(!self.disable_statistics);
config.options_mut().optimizer.prefer_hash_join = self.prefer_hash_join;
config
.options_mut()
.execution
.parquet
.schema_force_view_types = self.common.force_view_types;
let ctx = SessionContext::new_with_config(config);

// register tables
Expand Down Expand Up @@ -345,7 +340,6 @@ mod tests {
partitions: Some(2),
batch_size: 8192,
debug: false,
force_view_types: false,
};
let opt = RunOpt {
query: Some(query),
Expand Down Expand Up @@ -379,7 +373,6 @@ mod tests {
partitions: Some(2),
batch_size: 8192,
debug: false,
force_view_types: false,
};
let opt = RunOpt {
query: Some(query),
Expand Down
5 changes: 0 additions & 5 deletions benchmarks/src/util/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ pub struct CommonOpt {
/// Activate debug mode to see more details
#[structopt(short, long)]
pub debug: bool,

/// If true, will use StringView/BinaryViewArray instead of String/BinaryArray
/// when reading ParquetFiles
#[structopt(long)]
pub force_view_types: bool,
}

impl CommonOpt {
Expand Down
Loading
Loading