diff --git a/ballista-examples/Cargo.toml b/ballista-examples/Cargo.toml index 338f69994bfd..d5f7d65d83ef 100644 --- a/ballista-examples/Cargo.toml +++ b/ballista-examples/Cargo.toml @@ -26,7 +26,7 @@ license = "Apache-2.0" keywords = [ "arrow", "distributed", "query", "sql" ] edition = "2021" publish = false -rust-version = "1.57" +rust-version = "1.58" [dependencies] datafusion = { path = "../datafusion" } diff --git a/ballista/rust/client/Cargo.toml b/ballista/rust/client/Cargo.toml index 7736e949d29f..b8ed26e30ea9 100644 --- a/ballista/rust/client/Cargo.toml +++ b/ballista/rust/client/Cargo.toml @@ -24,7 +24,7 @@ homepage = "https://github.com/apache/arrow-datafusion" repository = "https://github.com/apache/arrow-datafusion" authors = ["Apache Arrow "] edition = "2021" -rust-version = "1.57" +rust-version = "1.58" [dependencies] ballista-core = { path = "../core", version = "0.6.0" } diff --git a/ballista/rust/executor/src/executor.rs b/ballista/rust/executor/src/executor.rs index a7cd8ebe5e92..ff2f08faafd4 100644 --- a/ballista/rust/executor/src/executor.rs +++ b/ballista/rust/executor/src/executor.rs @@ -83,9 +83,7 @@ impl Executor { job_id, stage_id, part, - DisplayableExecutionPlan::with_metrics(&exec) - .indent() - .to_string() + DisplayableExecutionPlan::with_metrics(&exec).indent() ); Ok(partitions) diff --git a/ballista/rust/scheduler/src/planner.rs b/ballista/rust/scheduler/src/planner.rs index 3d3884fd5021..fdd143500b5f 100644 --- a/ballista/rust/scheduler/src/planner.rs +++ b/ballista/rust/scheduler/src/planner.rs @@ -293,7 +293,7 @@ mod test { .plan_query_stages(&job_uuid.to_string(), plan) .await?; for stage in &stages { - println!("{}", displayable(stage.as_ref()).indent().to_string()); + println!("{}", displayable(stage.as_ref()).indent()); } /* Expected result: @@ -407,7 +407,7 @@ order by .plan_query_stages(&job_uuid.to_string(), plan) .await?; for stage in &stages { - println!("{}", displayable(stage.as_ref()).indent().to_string()); + println!("{}", displayable(stage.as_ref()).indent()); } /* Expected result: diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index d20de3106bd3..a8def45b53e0 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -25,7 +25,7 @@ homepage = "https://github.com/apache/arrow-datafusion" repository = "https://github.com/apache/arrow-datafusion" license = "Apache-2.0" publish = false -rust-version = "1.57" +rust-version = "1.58" [features] simd = ["datafusion/simd"] diff --git a/benchmarks/src/bin/tpch.rs b/benchmarks/src/bin/tpch.rs index b676253eab2d..9563434601b0 100644 --- a/benchmarks/src/bin/tpch.rs +++ b/benchmarks/src/bin/tpch.rs @@ -546,7 +546,7 @@ async fn execute_query( if debug { println!( "=== Physical plan ===\n{}\n", - displayable(physical_plan.as_ref()).indent().to_string() + displayable(physical_plan.as_ref()).indent() ); } let runtime = ctx.state.lock().unwrap().runtime_env.clone(); @@ -554,9 +554,7 @@ async fn execute_query( if debug { println!( "=== Physical plan with metrics ===\n{}\n", - DisplayableExecutionPlan::with_metrics(physical_plan.as_ref()) - .indent() - .to_string() + DisplayableExecutionPlan::with_metrics(physical_plan.as_ref()).indent() ); pretty::print_batches(&result)?; } diff --git a/datafusion-cli/Cargo.toml b/datafusion-cli/Cargo.toml index d5347d8e0009..62f63b432aba 100644 --- a/datafusion-cli/Cargo.toml +++ b/datafusion-cli/Cargo.toml @@ -24,7 +24,7 @@ keywords = [ "arrow", "datafusion", "ballista", "query", "sql" ] license = "Apache-2.0" homepage = "https://github.com/apache/arrow-datafusion" repository = "https://github.com/apache/arrow-datafusion" -rust-version = "1.57" +rust-version = "1.58" [dependencies] clap = "2.33" diff --git a/datafusion-cli/Dockerfile b/datafusion-cli/Dockerfile index fed14188fded..cef7afa8c9da 100644 --- a/datafusion-cli/Dockerfile +++ b/datafusion-cli/Dockerfile @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -FROM rust:1.57 as builder +FROM rust:1.58 as builder COPY ./datafusion /usr/src/datafusion diff --git a/datafusion-examples/Cargo.toml b/datafusion-examples/Cargo.toml index 24d453e0b1d4..cfbba637228d 100644 --- a/datafusion-examples/Cargo.toml +++ b/datafusion-examples/Cargo.toml @@ -26,7 +26,7 @@ license = "Apache-2.0" keywords = [ "arrow", "query", "sql" ] edition = "2021" publish = false -rust-version = "1.57" +rust-version = "1.58" [[example]] name = "avro_sql" diff --git a/datafusion/Cargo.toml b/datafusion/Cargo.toml index bc37c7a0de20..d5334130dd8d 100644 --- a/datafusion/Cargo.toml +++ b/datafusion/Cargo.toml @@ -31,7 +31,7 @@ include = [ "Cargo.toml", ] edition = "2021" -rust-version = "1.57" +rust-version = "1.58" [lib] name = "datafusion" diff --git a/datafusion/src/physical_plan/expressions/rank.rs b/datafusion/src/physical_plan/expressions/rank.rs index b82e9009d8e5..4facb8b55589 100644 --- a/datafusion/src/physical_plan/expressions/rank.rs +++ b/datafusion/src/physical_plan/expressions/rank.rs @@ -39,16 +39,16 @@ pub struct Rank { #[derive(Debug, Copy, Clone)] pub(crate) enum RankType { - Rank, - DenseRank, - PercentRank, + Basic, + Dense, + Percent, } /// Create a rank window function pub fn rank(name: String) -> Rank { Rank { name, - rank_type: RankType::Rank, + rank_type: RankType::Basic, } } @@ -56,7 +56,7 @@ pub fn rank(name: String) -> Rank { pub fn dense_rank(name: String) -> Rank { Rank { name, - rank_type: RankType::DenseRank, + rank_type: RankType::Dense, } } @@ -64,7 +64,7 @@ pub fn dense_rank(name: String) -> Rank { pub fn percent_rank(name: String) -> Rank { Rank { name, - rank_type: RankType::PercentRank, + rank_type: RankType::Percent, } } @@ -77,8 +77,8 @@ impl BuiltInWindowFunctionExpr for Rank { fn field(&self) -> Result { let nullable = false; let data_type = match self.rank_type { - RankType::Rank | RankType::DenseRank => DataType::UInt64, - RankType::PercentRank => DataType::Float64, + RankType::Basic | RankType::Dense => DataType::UInt64, + RankType::Percent => DataType::Float64, }; Ok(Field::new(self.name(), data_type, nullable)) } @@ -121,7 +121,7 @@ impl PartitionEvaluator for RankEvaluator { ) -> Result { // see https://www.postgresql.org/docs/current/functions-window.html let result: ArrayRef = match self.rank_type { - RankType::DenseRank => Arc::new(UInt64Array::from_iter_values( + RankType::Dense => Arc::new(UInt64Array::from_iter_values( ranks_in_partition .iter() .zip(1u64..) @@ -130,7 +130,7 @@ impl PartitionEvaluator for RankEvaluator { iter::repeat(rank).take(len) }), )), - RankType::PercentRank => { + RankType::Percent => { // Returns the relative rank of the current row, that is (rank - 1) / (total partition rows - 1). The value thus ranges from 0 to 1 inclusive. let denominator = (partition.end - partition.start) as f64; Arc::new(Float64Array::from_iter_values( @@ -146,7 +146,7 @@ impl PartitionEvaluator for RankEvaluator { .flatten(), )) } - RankType::Rank => Arc::new(UInt64Array::from_iter_values( + RankType::Basic => Arc::new(UInt64Array::from_iter_values( ranks_in_partition .iter() .scan(1_u64, |acc, range| { diff --git a/datafusion/src/physical_plan/file_format/parquet.rs b/datafusion/src/physical_plan/file_format/parquet.rs index 78c9428e39db..73f0b8ddb639 100644 --- a/datafusion/src/physical_plan/file_format/parquet.rs +++ b/datafusion/src/physical_plan/file_format/parquet.rs @@ -320,12 +320,8 @@ macro_rules! get_min_max_values { }; let data_type = field.data_type(); - let null_scalar: ScalarValue = if let Ok(v) = data_type.try_into() { - v - } else { - // DataFusion doesn't have support for ScalarValues of the column type - return None - }; + // The result may be None, because DataFusion doesn't have support for ScalarValues of the column type + let null_scalar: ScalarValue = data_type.try_into().ok()?; let scalar_values : Vec = $self.row_group_metadata .iter() @@ -441,11 +437,8 @@ fn read_partition( break; } Some(Err(e)) => { - let err_msg = format!( - "Error reading batch from {}: {}", - partitioned_file, - e.to_string() - ); + let err_msg = + format!("Error reading batch from {}: {}", partitioned_file, e); // send error to operator send_result( &response_tx, diff --git a/datafusion/src/physical_plan/planner.rs b/datafusion/src/physical_plan/planner.rs index 1ab78b24a482..fa0c101da3ac 100644 --- a/datafusion/src/physical_plan/planner.rs +++ b/datafusion/src/physical_plan/planner.rs @@ -1627,7 +1627,7 @@ mod tests { Err(e) => assert!( e.to_string().contains(expected_error), "Error '{}' did not contain expected error '{}'", - e.to_string(), + e, expected_error ), } @@ -1674,7 +1674,7 @@ mod tests { Err(e) => assert!( e.to_string().contains(expected_error), "Error '{}' did not contain expected error '{}'", - e.to_string(), + e, expected_error ), } @@ -1733,7 +1733,7 @@ mod tests { Err(e) => assert!( e.to_string().contains(expected_error), "Error '{}' did not contain expected error '{}'", - e.to_string(), + e, expected_error ), } diff --git a/datafusion/src/scalar.rs b/datafusion/src/scalar.rs index a3f893f55eb8..e7c7db5217ea 100644 --- a/datafusion/src/scalar.rs +++ b/datafusion/src/scalar.rs @@ -1739,7 +1739,7 @@ impl fmt::Display for ScalarValue { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { ScalarValue::Decimal128(v, p, s) => { - write!(f, "{}", format!("{:?},{:?},{:?}", v, p, s))?; + write!(f, "{:?},{:?},{:?}", v, p, s)?; } ScalarValue::Boolean(e) => format_option!(f, e)?, ScalarValue::Float32(e) => format_option!(f, e)?, diff --git a/datafusion/src/test/variable.rs b/datafusion/src/test/variable.rs index fcde0e90404b..4a8bf94aa1db 100644 --- a/datafusion/src/test/variable.rs +++ b/datafusion/src/test/variable.rs @@ -35,7 +35,7 @@ impl SystemVar { impl VarProvider for SystemVar { /// get system variable value fn get_value(&self, var_names: Vec) -> Result { - let s = format!("{}-{}", "system-var".to_string(), var_names.concat()); + let s = format!("{}-{}", "system-var", var_names.concat()); Ok(ScalarValue::Utf8(Some(s))) } } @@ -54,7 +54,7 @@ impl UserDefinedVar { impl VarProvider for UserDefinedVar { /// Get user defined variable value fn get_value(&self, var_names: Vec) -> Result { - let s = format!("{}-{}", "user-defined-var".to_string(), var_names.concat()); + let s = format!("{}-{}", "user-defined-var", var_names.concat()); Ok(ScalarValue::Utf8(Some(s))) } } diff --git a/dev/docker/ballista-base.dockerfile b/dev/docker/ballista-base.dockerfile index cf845e076016..b7460ed17987 100644 --- a/dev/docker/ballista-base.dockerfile +++ b/dev/docker/ballista-base.dockerfile @@ -23,7 +23,7 @@ # Base image extends debian:buster-slim -FROM rust:1.57.0-buster AS builder +FROM rust:1.58.0-buster AS builder RUN apt update && apt -y install musl musl-dev musl-tools libssl-dev openssl