diff --git a/Cargo.lock b/Cargo.lock index 812fd52e79a90..0de3ba6b9289a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,20 +90,20 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrow-format" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a27331907748dae13980603aca25f39e4504b6e047e2cd93c4f4e5f21a80829" +checksum = "9f7da2d9660bfaebbdb0a44a33b3bd1dcb5a952fafa02c0dfc6a51ea471fef2a" dependencies = [ "flatbuffers", - "prost", - "prost-derive", + "prost 0.9.0", + "prost-derive 0.9.0", "tonic", ] [[package]] name = "arrow2" -version = "0.6.2" -source = "git+https://github.com/datafuse-extras/arrow2?rev=bd8f02b#bd8f02b91d5321f3510bfef9c2f78c0fb4b2728a" +version = "0.7.0" +source = "git+https://github.com/datafuse-extras/arrow2?rev=83d828c#83d828c37d587d6c9f4252ae26e34d1ac78f1d94" dependencies = [ "ahash", "arrow-format", @@ -1258,7 +1258,7 @@ dependencies = [ "backtrace", "common-arrow", "paste", - "prost", + "prost 0.9.0", "serde", "serde_json", "sqlparser", @@ -1280,7 +1280,7 @@ dependencies = [ "lazy_static", "log", "pretty_assertions", - "prost", + "prost 0.9.0", "serde", "serde_json", "tokio-stream", @@ -1428,7 +1428,7 @@ dependencies = [ "lazy_static", "log", "pretty_assertions", - "prost", + "prost 0.9.0", "rand 0.8.4", "serde", "serde_json", @@ -2011,7 +2011,7 @@ dependencies = [ "num_cpus", "poem", "pretty_assertions", - "prost", + "prost 0.9.0", "rand 0.8.4", "reqwest", "serde", @@ -2093,7 +2093,7 @@ dependencies = [ "paste", "poem", "pretty_assertions", - "prost", + "prost 0.9.0", "quantiles", "rand 0.8.4", "reqwest", @@ -3121,9 +3121,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes", "http", @@ -4890,9 +4890,9 @@ dependencies = [ "log", "nix 0.20.2", "parking_lot", - "prost", + "prost 0.8.0", "prost-build", - "prost-derive", + "prost-derive 0.8.0", "symbolic-demangle", "tempfile", "thiserror", @@ -5038,7 +5038,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.8.0", +] + +[[package]] +name = "prost" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +dependencies = [ + "bytes", + "prost-derive 0.9.0", ] [[package]] @@ -5053,7 +5063,7 @@ dependencies = [ "log", "multimap", "petgraph", - "prost", + "prost 0.8.0", "prost-types", "tempfile", "which 4.2.2", @@ -5072,6 +5082,19 @@ dependencies = [ "syn", ] +[[package]] +name = "prost-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "prost-types" version = "0.8.0" @@ -5079,7 +5102,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" dependencies = [ "bytes", - "prost", + "prost 0.8.0", ] [[package]] @@ -6723,9 +6746,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "796c5e1cd49905e65dd8e700d4cb1dffcbfdb4fc9d017de08c1a537afd83627c" +checksum = "24203b79cf2d68909da91178db3026e77054effba0c5d93deb870d3ca7b35afa" dependencies = [ "async-stream", "async-trait", @@ -6740,8 +6763,8 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost", - "prost-derive", + "prost 0.9.0", + "prost-derive 0.9.0", "rustls-native-certs", "tokio", "tokio-rustls", diff --git a/common/arrow/Cargo.toml b/common/arrow/Cargo.toml index 641d156d4e8ff..e40b28a45a033 100644 --- a/common/arrow/Cargo.toml +++ b/common/arrow/Cargo.toml @@ -16,8 +16,8 @@ simd = ["arrow/simd"] # Workspace dependencies # Github dependencies -arrow = { package = "arrow2", git="https://github.com/datafuse-extras/arrow2", default-features = false, rev = "bd8f02b" } -arrow-format = { version = "0.2.1", features = ["flight-data", "flight-service"]} +arrow = { package = "arrow2", git="https://github.com/datafuse-extras/arrow2", default-features = false, rev = "83d828c" } +arrow-format = { version = "0.3.0", features = ["flight-data", "flight-service"]} parquet2 = { version = "0.6", default_features = false } # Crates.io dependencies diff --git a/common/datavalues/src/arrays/ops/cast.rs b/common/datavalues/src/arrays/ops/cast.rs index 26d8930b7b4ed..e786425de60a7 100644 --- a/common/datavalues/src/arrays/ops/cast.rs +++ b/common/datavalues/src/arrays/ops/cast.rs @@ -18,6 +18,7 @@ use std::sync::Arc; use common_arrow::arrow::array::Array; use common_arrow::arrow::array::ArrayRef; use common_arrow::arrow::compute::cast; +use common_arrow::arrow::compute::cast::CastOptions; use common_exception::ErrorCode; use common_exception::Result; @@ -38,7 +39,10 @@ fn cast_ca(ca: &dyn Array, data_type: &DataType) -> Result { let arrow_type = data_type.to_arrow(); let arrow_type = get_physical_arrow_type(&arrow_type); // we enable ignore_overflow by default - let array = cast::wrapping_cast(ca, arrow_type)?; + let array = cast::cast(ca, arrow_type, CastOptions { + wrapped: true, + partial: true, + })?; let array: ArrayRef = Arc::from(array); Ok(array.into_series()) } diff --git a/common/datavalues/src/arrays/primitive/mod.rs b/common/datavalues/src/arrays/primitive/mod.rs index 1509cc29413ed..3937f30873728 100644 --- a/common/datavalues/src/arrays/primitive/mod.rs +++ b/common/datavalues/src/arrays/primitive/mod.rs @@ -22,6 +22,7 @@ use common_arrow::arrow::bitmap::Bitmap; use common_arrow::arrow::buffer::Buffer; use common_arrow::arrow::compute::arity::unary; use common_arrow::arrow::compute::cast; +use common_arrow::arrow::compute::cast::CastOptions; use common_arrow::arrow::datatypes::DataType as ArrowDataType; use common_arrow::arrow::datatypes::TimeUnit; use common_exception::ErrorCode; @@ -62,7 +63,10 @@ impl DFPrimitiveArray { pub fn from_arrow_array(array: &dyn Array) -> Self { let expected_arrow_type = T::data_type().to_arrow(); let arrow_type = get_physical_arrow_type(array.data_type()); - + let cast_options = CastOptions { + wrapped: true, + partial: true, + }; if &expected_arrow_type != arrow_type { match array.data_type() { // u32 @@ -78,17 +82,17 @@ impl DFPrimitiveArray { Self::from_arrow_array(&array) } ArrowDataType::Date32 => { - let array = cast::cast(array, &ArrowDataType::Int32) + let array = cast::cast(array, &ArrowDataType::Int32, cast_options) .expect("primitive cast should be ok"); - let array = cast::cast(array.as_ref(), &expected_arrow_type) + let array = cast::cast(array.as_ref(), &expected_arrow_type, cast_options) .expect("primitive cast should be ok"); Self::from_arrow_array(array.as_ref()) } ArrowDataType::Date64 => { - let array = cast::cast(array, &ArrowDataType::Int64) + let array = cast::cast(array, &ArrowDataType::Int64, cast_options) .expect("primitive cast should be ok"); - let array = cast::cast(array.as_ref(), &expected_arrow_type) + let array = cast::cast(array.as_ref(), &expected_arrow_type, cast_options) .expect("primitive cast should be ok"); Self::from_arrow_array(array.as_ref()) diff --git a/common/exception/Cargo.toml b/common/exception/Cargo.toml index dad06984a7e5c..3b91d69eaebd5 100644 --- a/common/exception/Cargo.toml +++ b/common/exception/Cargo.toml @@ -14,8 +14,8 @@ backtrace = "0.3.63" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "1.0.30" -tonic = "0.5.2" -prost = "0.8.0" +tonic = "0.6.0" +prost = "0.9.0" paste = "^1.0" # Github dependencies diff --git a/common/flight-rpc/Cargo.toml b/common/flight-rpc/Cargo.toml index ec81c5196bf68..abab8989a0d95 100644 --- a/common/flight-rpc/Cargo.toml +++ b/common/flight-rpc/Cargo.toml @@ -18,11 +18,11 @@ common-exception= {path = "../exception"} futures = "0.3" jwt-simple = "0.10.6" log = "0.4" -prost = "0.8.0" +prost = "0.9.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tokio-stream = "0.1" -tonic = { version = "0.5.2", features = ["transport", "codegen", "prost", "tls-roots", "tls"] } +tonic = { version = "0.6.0", features = ["transport", "codegen", "prost", "tls-roots", "tls"] } hyper = "0.14.14" lazy_static = "1.4.0" trust-dns-resolver = { version = "0.20.3", features = ["system-config"] } diff --git a/common/meta/flight/Cargo.toml b/common/meta/flight/Cargo.toml index 3db5f9ceb7c69..c0bfac016cb97 100644 --- a/common/meta/flight/Cargo.toml +++ b/common/meta/flight/Cargo.toml @@ -27,12 +27,13 @@ async-trait = "0.1" futures = "0.3" jwt-simple = "0.10.6" log = "0.4" -prost = "0.8.0" +prost = "0.9.0" +# prost-derive = "0.9.0" rand = "0.8.4" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tokio-stream = "0.1" -tonic = { version = "0.5.2", features = ["transport", "codegen", "prost", "tls-roots", "tls"] } +tonic = { version = "0.6.0", features = ["transport", "codegen", "prost", "tls-roots", "tls"] } hyper = "0.14.14" lazy_static = "1.4.0" trust-dns-resolver = { version = "0.20.3", features = ["system-config"] } diff --git a/common/tracing/Cargo.toml b/common/tracing/Cargo.toml index 0d96136f6789c..acd3779a02361 100644 --- a/common/tracing/Cargo.toml +++ b/common/tracing/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" lazy_static = "1.4.0" opentelemetry = { version = "0.16", default-features = false, features = ["trace", "rt-tokio"] } opentelemetry-jaeger = { version = "0.15", features = ["rt-tokio"] } -tonic = "0.5.2" +tonic = "0.6.0" tracing = "0.1.29" tracing-appender = "0.2.0" tracing-bunyan-formatter = "0.3.0" diff --git a/metasrv/Cargo.toml b/metasrv/Cargo.toml index 340122d694931..7bfebfbe6117a 100644 --- a/metasrv/Cargo.toml +++ b/metasrv/Cargo.toml @@ -50,7 +50,7 @@ metrics = "0.17.0" metrics-exporter-prometheus = "0.6.0" num = "0.4" num_cpus = "1.0" -prost = "0.8.0" +prost = "0.9.0" rand = "0.8.4" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -61,7 +61,7 @@ tempfile = "3.2.0" thiserror = "1.0.30" threadpool = "1.8.1" tokio-stream = "0.1" -tonic = { version = "0.5.2", features = ["tls"]} +tonic = { version = "0.6.0", features = ["tls"]} sha2 = "0.9.8" uuid = { version = "0.8", features = ["serde", "v4"] } diff --git a/query/Cargo.toml b/query/Cargo.toml index cded052d62f69..f557075f89094 100644 --- a/query/Cargo.toml +++ b/query/Cargo.toml @@ -79,7 +79,7 @@ nom = "7.1.0" num = "0.4" num_cpus = "1.0" paste = "^1.0" -prost = "0.8.0" +prost = "0.9.0" quantiles = "0.7.1" rand = "0.8.4" rusoto_core = "0.47.0" @@ -94,7 +94,7 @@ threadpool = "1.8.1" tokio-rustls = "0.22.0" tokio-stream = { version = "0.1", features = ["net"] } toml = "0.5.8" -tonic = "0.5.2" +tonic = "0.6.0" uuid = { version = "0.8", features = ["serde", "v4"] } walkdir = "2.3.2" diff --git a/query/src/api/rpc/flight_service_stream.rs b/query/src/api/rpc/flight_service_stream.rs index 8ef69bc0a7f65..3fe2e47b7990c 100644 --- a/query/src/api/rpc/flight_service_stream.rs +++ b/query/src/api/rpc/flight_service_stream.rs @@ -15,7 +15,7 @@ use std::convert::TryInto; use common_arrow::arrow::io::flight::serialize_batch; -use common_arrow::arrow::io::ipc::write::common::IpcWriteOptions; +use common_arrow::arrow::io::ipc::write::WriteOptions; use common_arrow::arrow_format::flight::data::FlightData; use common_base::tokio::macros::support::Pin; use common_base::tokio::macros::support::Poll; @@ -27,14 +27,14 @@ use tonic::Status; pub struct FlightDataStream { input: Receiver>, - options: IpcWriteOptions, + options: WriteOptions, } impl FlightDataStream { pub fn create(input: Receiver>) -> FlightDataStream { FlightDataStream { input, - options: IpcWriteOptions::default(), + options: WriteOptions { compression: None }, } } } diff --git a/tests/suites/0_stateless/02_0005_function_compare.result b/tests/suites/0_stateless/02_0005_function_compare.result index 6f434a95384ad..3269bf11b98a8 100644 --- a/tests/suites/0_stateless/02_0005_function_compare.result +++ b/tests/suites/0_stateless/02_0005_function_compare.result @@ -29,6 +29,7 @@ system 1 1 1 +1 ==compare_datetime== 1 1 diff --git a/tests/suites/0_stateless/02_0005_function_compare.sql b/tests/suites/0_stateless/02_0005_function_compare.sql index a13c06ebb380b..d2a2d94be0071 100644 --- a/tests/suites/0_stateless/02_0005_function_compare.sql +++ b/tests/suites/0_stateless/02_0005_function_compare.sql @@ -21,7 +21,7 @@ select * from numbers(10) where null and true; select '==compare_number_string=='; -- todo: partial parse case --- select '123 ab' = 123; +select '123 ab' = 123; select '123' = 123; select '7.4' = 7.4; select '7.4' > 7;