Skip to content

Commit

Permalink
Merge branch 'apache:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Asura7969 authored Nov 23, 2023
2 parents 79e7216 + 98f1bc0 commit ba51abd
Show file tree
Hide file tree
Showing 65 changed files with 5,443 additions and 2,964 deletions.
5 changes: 3 additions & 2 deletions benchmarks/src/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ impl RunOpt {
println!("Executing '{title}' (sorting by: {expr:?})");
rundata.start_new_case(title);
for i in 0..self.common.iterations {
let config =
SessionConfig::new().with_target_partitions(self.common.partitions);
let config = SessionConfig::new().with_target_partitions(
self.common.partitions.unwrap_or(num_cpus::get()),
);
let ctx = SessionContext::new_with_config(config);
let (rows, elapsed) =
exec_sort(&ctx, &expr, &test_file, self.common.debug).await?;
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/src/tpch/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl RunOpt {
}

fn partitions(&self) -> usize {
self.common.partitions
self.common.partitions.unwrap_or(num_cpus::get())
}
}

Expand Down Expand Up @@ -325,7 +325,7 @@ mod tests {
let path = get_tpch_data_path()?;
let common = CommonOpt {
iterations: 1,
partitions: 2,
partitions: Some(2),
batch_size: 8192,
debug: false,
};
Expand Down Expand Up @@ -357,7 +357,7 @@ mod tests {
let path = get_tpch_data_path()?;
let common = CommonOpt {
iterations: 1,
partitions: 2,
partitions: Some(2),
batch_size: 8192,
debug: false,
};
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/src/util/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ pub struct CommonOpt {
#[structopt(short = "i", long = "iterations", default_value = "3")]
pub iterations: usize,

/// Number of partitions to process in parallel
#[structopt(short = "n", long = "partitions", default_value = "2")]
pub partitions: usize,
/// Number of partitions to process in parallel. Defaults to number of available cores.
#[structopt(short = "n", long = "partitions")]
pub partitions: Option<usize>,

/// Batch size when reading CSV or Parquet files
#[structopt(short = "s", long = "batch-size", default_value = "8192")]
Expand All @@ -48,7 +48,7 @@ impl CommonOpt {
/// Modify the existing config appropriately
pub fn update_config(&self, config: SessionConfig) -> SessionConfig {
config
.with_target_partitions(self.partitions)
.with_target_partitions(self.partitions.unwrap_or(num_cpus::get()))
.with_batch_size(self.batch_size)
}
}
55 changes: 23 additions & 32 deletions datafusion-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions datafusion/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,22 @@ backtrace = []
pyarrow = ["pyo3", "arrow/pyarrow", "parquet"]

[dependencies]
ahash = { version = "0.8", default-features = false, features = ["runtime-rng"] }
apache-avro = { version = "0.16", default-features = false, features = ["bzip", "snappy", "xz", "zstandard"], optional = true }
ahash = { version = "0.8", default-features = false, features = [
"runtime-rng",
] }
apache-avro = { version = "0.16", default-features = false, features = [
"bzip",
"snappy",
"xz",
"zstandard",
], optional = true }
arrow = { workspace = true }
arrow-array = { workspace = true }
arrow-buffer = { workspace = true }
arrow-schema = { workspace = true }
chrono = { workspace = true }
half = { version = "2.1", default-features = false }
libc = "0.2.140"
num_cpus = { workspace = true }
object_store = { workspace = true, optional = true }
parquet = { workspace = true, optional = true, default-features = true }
Expand Down
1 change: 1 addition & 0 deletions datafusion/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub mod file_options;
pub mod format;
pub mod hash_utils;
pub mod parsers;
pub mod rounding;
pub mod scalar;
pub mod stats;
pub mod test_util;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
use std::ops::{Add, BitAnd, Sub};

use datafusion_common::Result;
use datafusion_common::ScalarValue;
use crate::Result;
use crate::ScalarValue;

// Define constants for ARM
#[cfg(all(target_arch = "aarch64", not(target_os = "windows")))]
Expand Down Expand Up @@ -162,7 +162,7 @@ impl FloatBits for f64 {
/// # Examples
///
/// ```
/// use datafusion_physical_expr::intervals::rounding::next_up;
/// use datafusion_common::rounding::next_up;
///
/// let f: f32 = 1.0;
/// let next_f = next_up(f);
Expand Down Expand Up @@ -195,7 +195,7 @@ pub fn next_up<F: FloatBits + Copy>(float: F) -> F {
/// # Examples
///
/// ```
/// use datafusion_physical_expr::intervals::rounding::next_down;
/// use datafusion_common::rounding::next_down;
///
/// let f: f32 = 1.0;
/// let next_f = next_down(f);
Expand Down
Loading

0 comments on commit ba51abd

Please sign in to comment.