alamb commented on code in PR #3769: URL: https://github.com/apache/arrow-datafusion/pull/3769#discussion_r992715070
########## benchmarks/src/bin/parquet_filter_pushdown.rs: ########## @@ -0,0 +1,462 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use arrow::array::{ + Int32Builder, StringBuilder, StringDictionaryBuilder, TimestampNanosecondBuilder, + UInt16Builder, +}; +use arrow::datatypes::{DataType, Field, Int32Type, Schema, SchemaRef, TimeUnit}; +use arrow::record_batch::RecordBatch; +use arrow::util::pretty; +use datafusion::common::Result; +use datafusion::datasource::listing::{ListingTableUrl, PartitionedFile}; +use datafusion::datasource::object_store::ObjectStoreUrl; +use datafusion::execution::context::ExecutionProps; +use datafusion::logical_expr::{lit, or, Expr}; +use datafusion::logical_plan::ToDFSchema; +use datafusion::physical_expr::create_physical_expr; +use datafusion::physical_plan::collect; +use datafusion::physical_plan::file_format::{ + FileScanConfig, ParquetExec, ParquetScanOptions, +}; +use datafusion::physical_plan::filter::FilterExec; +use datafusion::prelude::{col, combine_filters, SessionConfig, SessionContext}; +use object_store::path::Path; +use object_store::ObjectMeta; +use parquet::arrow::ArrowWriter; +use rand::rngs::StdRng; +use rand::{Rng, SeedableRng}; +use std::fs::File; +use std::ops::Range; +use std::path::PathBuf; +use std::sync::Arc; +use std::time::Instant; +use structopt::StructOpt; + +#[cfg(feature = "snmalloc")] +#[global_allocator] +static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc; + +#[derive(Debug, StructOpt)] +#[structopt(name = "Benchmarks", about = "Apache Arrow Rust Benchmarks.")] +struct Opt { + /// Activate debug mode to see query results + #[structopt(short, long)] + debug: bool, + + /// Number of iterations of each test run + #[structopt(short = "i", long = "iterations", default_value = "3")] + iterations: usize, + + /// Number of partitions to process in parallel + #[structopt(long = "partitions", default_value = "2")] + partitions: usize, + + /// Path to folder where access log file will be generated + #[structopt(parse(from_os_str), required = true, short = "p", long = "path")] + path: PathBuf, + + /// Batch size when reading Parquet files + #[structopt(short = "s", long = "batch-size", default_value = "8192")] Review Comment: in fact when you run the example in debug mode it asserts on exactly this problem: ```shell cargo run --bin parquet_filter_pushdown -- --path ./data --\|alamb@aal-dev:~/arrow-datafusion$ scale-factor 1.0 ... Running `target/debug/parquet_filter_pushdown --path ./data --scale-factor 1.0` |error[E0433]: failed to resolve: use of undeclared type `WriterProperties` thread 'main' panicked at 'Argument short must be unique | --> benchmarks/src/bin/parquet_filter_pushdown.rs:235:17 | | -s is already in use', /home/alamb/.cargo/registry/src/github.com-1ecc6299db9ec823/cla\|235 | let props = WriterProperties::builder() p-2.34.0/src/app/parser.rs:190:13 | | ^^^^^^^^^^^^^^^^ not found in this scope note: run with `RUST_BACKTRACE=1` environment variable to display a ba ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
