From bff569b3cb773b10274a6c03722089c35d11bedf Mon Sep 17 00:00:00 2001 From: DreaMer963 Date: Fri, 3 Dec 2021 11:34:32 +0800 Subject: [PATCH] Update rust vesion to 1.57 --- ballista-examples/Cargo.toml | 2 +- ballista/rust/client/Cargo.toml | 2 +- benchmarks/Cargo.toml | 2 +- datafusion-cli/Cargo.toml | 2 +- datafusion-cli/Dockerfile | 2 +- datafusion-examples/Cargo.toml | 2 +- datafusion/Cargo.toml | 2 +- datafusion/src/physical_plan/datetime_expressions.rs | 6 +++++- datafusion/src/scalar.rs | 4 ++-- datafusion/src/sql/parser.rs | 12 ++++++++---- dev/docker/ballista-base.dockerfile | 2 +- python/Cargo.toml | 2 +- 12 files changed, 24 insertions(+), 16 deletions(-) diff --git a/ballista-examples/Cargo.toml b/ballista-examples/Cargo.toml index 65cdec400e1d9..a2d2fd65656d9 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.56" +rust-version = "1.57" [dependencies] datafusion = { path = "../datafusion" } diff --git a/ballista/rust/client/Cargo.toml b/ballista/rust/client/Cargo.toml index f444689021d2f..7736e949d29f5 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.56" +rust-version = "1.57" [dependencies] ballista-core = { path = "../core", version = "0.6.0" } diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 4fc41b33a7ecf..c042778265abb 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.56" +rust-version = "1.57" [features] simd = ["datafusion/simd"] diff --git a/datafusion-cli/Cargo.toml b/datafusion-cli/Cargo.toml index 0434f090da014..27227507db4f1 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.56" +rust-version = "1.57" [dependencies] clap = "2.33" diff --git a/datafusion-cli/Dockerfile b/datafusion-cli/Dockerfile index fe177b6dcb990..fed14188fded1 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.56 as builder +FROM rust:1.57 as builder COPY ./datafusion /usr/src/datafusion diff --git a/datafusion-examples/Cargo.toml b/datafusion-examples/Cargo.toml index 3e8a6ec77f6d9..d81100f70ac75 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.56" +rust-version = "1.57" [[example]] name = "avro_sql" diff --git a/datafusion/Cargo.toml b/datafusion/Cargo.toml index fbe84e3ed0a0d..73ed9c08ae590 100644 --- a/datafusion/Cargo.toml +++ b/datafusion/Cargo.toml @@ -31,7 +31,7 @@ include = [ "Cargo.toml", ] edition = "2021" -rust-version = "1.56" +rust-version = "1.57" [lib] name = "datafusion" diff --git a/datafusion/src/physical_plan/datetime_expressions.rs b/datafusion/src/physical_plan/datetime_expressions.rs index a776c42f3e9df..d10312798d3ff 100644 --- a/datafusion/src/physical_plan/datetime_expressions.rs +++ b/datafusion/src/physical_plan/datetime_expressions.rs @@ -42,6 +42,7 @@ use arrow::{ }; use chrono::prelude::*; use chrono::Duration; +use std::borrow::Borrow; /// given a function `op` that maps a `&str` to a Result of an arrow native type, /// returns a `PrimitiveArray` after the application @@ -77,7 +78,10 @@ where })?; // first map is the iterator, second is for the `Option<_>` - array.iter().map(|x| x.map(|x| op(x)).transpose()).collect() + array + .iter() + .map(|x| x.map(op.borrow()).transpose()) + .collect() } // given an function that maps a `&str` to a arrow native type, diff --git a/datafusion/src/scalar.rs b/datafusion/src/scalar.rs index 4a5a2c34a393d..c06ccb1c81f37 100644 --- a/datafusion/src/scalar.rs +++ b/datafusion/src/scalar.rs @@ -68,7 +68,7 @@ pub enum ScalarValue { /// large binary LargeBinary(Option>), /// list of nested ScalarValue (boxed to reduce size_of(ScalarValue)) - #[allow(clippy::box_vec)] + #[allow(clippy::box_collection)] List(Option>>, Box), /// Date stored as a signed 32bit int Date32(Option), @@ -87,7 +87,7 @@ pub enum ScalarValue { /// Interval with DayTime unit IntervalDayTime(Option), /// struct of nested ScalarValue (boxed to reduce size_of(ScalarValue)) - #[allow(clippy::box_vec)] + #[allow(clippy::box_collection)] Struct(Option>>, Box>), } diff --git a/datafusion/src/sql/parser.rs b/datafusion/src/sql/parser.rs index 49ae86906c142..3352577644429 100644 --- a/datafusion/src/sql/parser.rs +++ b/datafusion/src/sql/parser.rs @@ -85,7 +85,7 @@ pub struct CreateExternalTable { #[derive(Debug, Clone, PartialEq)] pub enum Statement { /// ANSI SQL AST node - Statement(SQLStatement), + Statement(Box), /// Extension: `CREATE EXTERNAL TABLE` CreateExternalTable(CreateExternalTable), } @@ -167,13 +167,17 @@ impl<'a> DFParser<'a> { } _ => { // use the native parser - Ok(Statement::Statement(self.parser.parse_statement()?)) + Ok(Statement::Statement(Box::from( + self.parser.parse_statement()?, + ))) } } } _ => { // use the native parser - Ok(Statement::Statement(self.parser.parse_statement()?)) + Ok(Statement::Statement(Box::from( + self.parser.parse_statement()?, + ))) } } } @@ -183,7 +187,7 @@ impl<'a> DFParser<'a> { if self.parser.parse_keyword(Keyword::EXTERNAL) { self.parse_create_external_table() } else { - Ok(Statement::Statement(self.parser.parse_create()?)) + Ok(Statement::Statement(Box::from(self.parser.parse_create()?))) } } diff --git a/dev/docker/ballista-base.dockerfile b/dev/docker/ballista-base.dockerfile index df4f32c0ce998..cf845e076016d 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.56.0-buster AS builder +FROM rust:1.57.0-buster AS builder RUN apt update && apt -y install musl musl-dev musl-tools libssl-dev openssl diff --git a/python/Cargo.toml b/python/Cargo.toml index 568f3c7b35d35..974a6140644e2 100644 --- a/python/Cargo.toml +++ b/python/Cargo.toml @@ -25,7 +25,7 @@ description = "Build and run queries against data" readme = "README.md" license = "Apache-2.0" edition = "2021" -rust-version = "1.56" +rust-version = "1.57" [dependencies] tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync"] }