From cc2f7efb983fe057b4efa0cf625d7658a7b5e774 Mon Sep 17 00:00:00 2001 From: LFC <990479+MichaelScofield@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:47:17 +0800 Subject: [PATCH] chore: bump datafusion version to fix `last_value` regression (#4169) * chore: bump datafusion version to fix `last_value` regression * fix: resolve PR comments * fix ci --- Cargo.lock | 684 +++++++++++++----- Cargo.toml | 18 +- .../datasource/src/file_format/tests.rs | 6 +- src/datatypes/src/value.rs | 3 +- src/datatypes/src/vectors/helper.rs | 3 +- src/file-engine/src/query/file_stream.rs | 10 +- src/flow/src/transform/aggr.rs | 7 +- src/flow/src/transform/literal.rs | 58 +- src/query/src/promql/planner.rs | 23 +- .../common/function/expression.result | 32 + .../standalone/common/function/expression.sql | 8 + .../common/range/special_aggr.result | 6 +- .../types/decimal/decimal_aggregates.result | 4 +- .../common/types/interval/interval.result | 4 +- .../common/types/timestamp/timestamp.result | 4 +- 15 files changed, 609 insertions(+), 261 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7219c09f89ac..e2cdd67ebe03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -177,9 +177,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -532,7 +532,7 @@ dependencies = [ "memchr", "num", "regex", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -581,9 +581,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c90a406b4495d129f00461241616194cb8a032c8d1c53c657f0961d5f8e0498" +checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" dependencies = [ "brotli 6.0.0", "bzip2", @@ -600,11 +600,11 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", + "event-listener 5.3.1", "event-listener-strategy", "pin-project-lite", ] @@ -766,7 +766,7 @@ dependencies = [ "headers", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "itoa", "matchit", "memchr", @@ -829,9 +829,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -878,9 +878,9 @@ dependencies = [ [[package]] name = "bigdecimal" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9324c8014cd04590682b34f1e9448d38f0674d0f7b2dc553331016ef0e4e9ebc" +checksum = "51d712318a27c7150326677b321a5fa91b55f6d9034ffd67f20319e147d40cee" dependencies = [ "autocfg", "libm", @@ -999,19 +999,19 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe5b10e214954177fb1dc9fbd20a1a2608fe99e6c832033bdc7cea287a20d77" +checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" dependencies = [ "borsh-derive", - "cfg_aliases", + "cfg_aliases 0.2.1", ] [[package]] name = "borsh-derive" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a8646f94ab393e43e8b35a2558b1624bed28b97ee09c5d15456e3c9463f46d" +checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" dependencies = [ "once_cell", "proc-macro-crate 3.1.0", @@ -1040,7 +1040,7 @@ checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", - "brotli-decompressor 4.0.0", + "brotli-decompressor 4.0.1", ] [[package]] @@ -1055,9 +1055,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6221fe77a248b9117d431ad93761222e1cf8ff282d9d1d5d9f53d6299a1cf76" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1278,9 +1278,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" dependencies = [ "jobserver", "libc", @@ -1320,11 +1320,17 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "cfgrammar" -version = "0.13.5" +version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "163348850b1cd34fa99ef1592b5d598ea7e6752f18aff2125b67537e887edb36" +checksum = "6026d8cd82ada8bbcfe337805dd1eb6afdc9e80fa4d57e977b3a36315e0c5525" dependencies = [ "indexmap 2.2.6", "lazy_static", @@ -1438,9 +1444,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a483f3cbf7cec2e153d424d0e92329d816becc6421389bd494375c6065921b9b" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -1476,9 +1482,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", "clap_derive", @@ -1486,21 +1492,21 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.0", + "clap_lex 0.7.1", "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -1519,9 +1525,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "client" @@ -1593,7 +1599,7 @@ dependencies = [ "cache", "catalog", "chrono", - "clap 4.5.4", + "clap 4.5.7", "client", "common-base", "common-catalog", @@ -1647,7 +1653,7 @@ dependencies = [ "tempfile", "tikv-jemallocator", "tokio", - "toml 0.8.13", + "toml 0.8.14", "tracing-appender", ] @@ -1674,7 +1680,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" dependencies = [ "strum 0.26.2", - "strum_macros 0.26.2", + "strum_macros 0.26.4", "unicode-width", ] @@ -1696,7 +1702,7 @@ dependencies = [ "paste", "serde", "snafu 0.8.3", - "toml 0.8.13", + "toml 0.8.14", "zeroize", ] @@ -1731,7 +1737,7 @@ dependencies = [ "sysinfo", "temp-env", "tempfile", - "toml 0.8.13", + "toml 0.8.14", ] [[package]] @@ -1850,7 +1856,7 @@ dependencies = [ "common-telemetry", "common-test-util", "common-version", - "hyper 0.14.28", + "hyper 0.14.29", "reqwest", "serde", "tempfile", @@ -1960,7 +1966,7 @@ dependencies = [ "futures-util", "hex", "humantime-serde", - "hyper 0.14.28", + "hyper 0.14.29", "itertools 0.10.5", "lazy_static", "moka", @@ -2166,7 +2172,7 @@ dependencies = [ "serde_with", "snafu 0.8.3", "tokio", - "toml 0.8.13", + "toml 0.8.14", ] [[package]] @@ -2335,9 +2341,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32c" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" +checksum = "3a47af21622d091a8f0fb295b88bc886ac74efcc613efc19f5d0b21de5c89e47" dependencies = [ "rustc_version", ] @@ -2602,7 +2608,7 @@ dependencies = [ "arrow-array", "arrow-ipc", "arrow-schema", - "async-compression 0.4.10", + "async-compression 0.4.11", "async-trait", "bytes", "bzip2", @@ -2645,14 +2651,14 @@ dependencies = [ [[package]] name = "datafusion" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "ahash 0.8.11", "arrow", "arrow-array", "arrow-ipc", "arrow-schema", - "async-compression 0.4.10", + "async-compression 0.4.11", "async-trait", "bytes", "bzip2", @@ -2718,7 +2724,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "ahash 0.8.11", "arrow", @@ -2748,7 +2754,7 @@ dependencies = [ [[package]] name = "datafusion-common-runtime" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "tokio", ] @@ -2777,7 +2783,7 @@ dependencies = [ [[package]] name = "datafusion-execution" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "arrow", "chrono", @@ -2808,13 +2814,13 @@ dependencies = [ "paste", "sqlparser 0.44.0", "strum 0.26.2", - "strum_macros 0.26.2", + "strum_macros 0.26.4", ] [[package]] name = "datafusion-expr" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "ahash 0.8.11", "arrow", @@ -2825,7 +2831,7 @@ dependencies = [ "serde_json", "sqlparser 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", "strum 0.26.2", - "strum_macros 0.26.2", + "strum_macros 0.26.4", ] [[package]] @@ -2856,7 +2862,7 @@ dependencies = [ [[package]] name = "datafusion-functions" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "arrow", "base64 0.22.1", @@ -2882,8 +2888,9 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ + "ahash 0.8.11", "arrow", "arrow-schema", "datafusion-common 38.0.0", @@ -2918,7 +2925,7 @@ dependencies = [ [[package]] name = "datafusion-functions-array" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "arrow", "arrow-array", @@ -2949,26 +2956,25 @@ dependencies = [ "hashbrown 0.14.5", "itertools 0.12.1", "log", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] name = "datafusion-optimizer" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "arrow", "async-trait", "chrono", "datafusion-common 38.0.0", "datafusion-expr 38.0.0", - "datafusion-functions-aggregate", "datafusion-physical-expr 38.0.0", "hashbrown 0.14.5", "indexmap 2.2.6", "itertools 0.12.1", "log", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -3009,7 +3015,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "ahash 0.8.11", "arrow", @@ -3039,7 +3045,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr-common" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "arrow", "datafusion-common 38.0.0", @@ -3081,7 +3087,7 @@ dependencies = [ [[package]] name = "datafusion-physical-plan" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "ahash 0.8.11", "arrow", @@ -3130,7 +3136,7 @@ dependencies = [ [[package]] name = "datafusion-sql" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "arrow", "arrow-array", @@ -3146,16 +3152,16 @@ dependencies = [ [[package]] name = "datafusion-substrait" version = "38.0.0" -source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +source = "git+https://github.com/apache/datafusion.git?rev=729b356ef543ffcda6813c7b5373507a04ae0109#729b356ef543ffcda6813c7b5373507a04ae0109" dependencies = [ "async-recursion", "chrono", "datafusion 38.0.0", "itertools 0.12.1", "object_store", + "pbjson-types", "prost 0.12.6", - "prost-types 0.12.6", - "substrait 0.34.0", + "substrait 0.34.1", ] [[package]] @@ -3212,7 +3218,7 @@ dependencies = [ "substrait 0.8.2", "table", "tokio", - "toml 0.8.13", + "toml 0.8.14", "tonic 0.11.0", ] @@ -3456,6 +3462,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "dlv-list" version = "0.3.0" @@ -3632,20 +3649,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "4.0.3" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", @@ -3654,11 +3660,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 4.0.3", + "event-listener 5.3.1", "pin-project-lite", ] @@ -3943,7 +3949,7 @@ dependencies = [ "strfmt", "table", "tokio", - "toml 0.8.13", + "toml 0.8.14", "tonic 0.11.0", "tower", "uuid", @@ -4182,9 +4188,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "git2" @@ -4463,12 +4469,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", + "futures-util", "http 1.1.0", "http-body 1.0.0", "pin-project-lite", @@ -4482,9 +4488,9 @@ checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" [[package]] name = "httpdate" @@ -4504,7 +4510,7 @@ dependencies = [ "os_info", "serde", "serde_derive", - "toml 0.8.13", + "toml 0.8.14", "uuid", ] @@ -4589,7 +4595,7 @@ version = "0.6.2" source = "git+https://github.com/GreptimeTeam/hydroflow.git?branch=main#b072ee026f97f8537165e1fb247101e0ab2fb320" dependencies = [ "auto_impl", - "clap 4.5.4", + "clap 4.5.7", "data-encoding", "itertools 0.10.5", "prettyplease 0.2.20", @@ -4618,9 +4624,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", @@ -4682,7 +4688,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.28", + "hyper 0.14.29", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -4690,9 +4696,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ "bytes", "futures-channel", @@ -4731,6 +4737,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -4739,12 +4863,14 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", ] [[package]] @@ -4792,7 +4918,7 @@ dependencies = [ "prost 0.12.6", "rand", "regex", - "regex-automata 0.4.6", + "regex-automata 0.4.7", "snafu 0.8.3", "tempfile", "tokio", @@ -4971,6 +5097,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.12.1" @@ -5310,6 +5445,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -5363,9 +5504,9 @@ dependencies = [ [[package]] name = "lrlex" -version = "0.13.5" +version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ff18e1bd3ed77d7bc2800a0f8b0e922a3c7ba525505be8bab9cf45dfc4984b" +checksum = "05863fdac293d1bc74f0cd91512933a5ab67e0cb607dc78ac4984be089456b49" dependencies = [ "cfgrammar", "getopts", @@ -5374,16 +5515,16 @@ dependencies = [ "num-traits", "quote", "regex", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", "serde", "vergen", ] [[package]] name = "lrpar" -version = "0.13.5" +version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efea5a41b9988b5ae41ea9b2375a52cfa0e483f0210357209caa8d361a24a368" +checksum = "3b1ecae55cf667db308d3555e22b20bcc28eaeca0c95a09b37171673be157c71" dependencies = [ "bincode", "cactus", @@ -5403,9 +5544,9 @@ dependencies = [ [[package]] name = "lrtable" -version = "0.13.5" +version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff5668c3bfd279ed24d5b0d24568c48dc993f9beabd51f74d1865a78c1d206ab" +checksum = "d42d2752cb50a171efadda0cb6fa97432e8bf05accfff3eed320b87e80a2f69e" dependencies = [ "cfgrammar", "fnv", @@ -5426,9 +5567,9 @@ dependencies = [ [[package]] name = "lz4" -version = "1.24.0" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +checksum = "d6eab492fe7f8651add23237ea56dbf11b3c4ff762ab83d40a47f11433421f91" dependencies = [ "libc", "lz4-sys", @@ -5436,9 +5577,9 @@ dependencies = [ [[package]] name = "lz4-sys" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +checksum = "e9764018d143cc854c9f17f0b907de70f14393b1f502da6375dce70f00514eb3" dependencies = [ "cc", "libc", @@ -5563,9 +5704,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memcomparable" @@ -5698,7 +5839,7 @@ dependencies = [ "table", "tokio", "tokio-stream", - "toml 0.8.13", + "toml 0.8.14", "tonic 0.11.0", "tower", "tracing", @@ -5871,7 +6012,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "toml 0.8.13", + "toml 0.8.14", "uuid", ] @@ -5913,7 +6054,7 @@ dependencies = [ "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", - "event-listener 5.3.0", + "event-listener 5.3.1", "futures-util", "once_cell", "parking_lot 0.12.3", @@ -6085,9 +6226,9 @@ dependencies = [ [[package]] name = "mysql_common" -version = "0.32.3" +version = "0.32.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1e52cf194ab414202ead9dfda216d2a9ec59cc97ac024ba499ca686d82f040d" +checksum = "478b0ff3f7d67b79da2b96f56f334431aef65e15ba4b29dd74a4236e29582bdc" dependencies = [ "base64 0.21.7", "bigdecimal", @@ -6208,7 +6349,7 @@ checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.5.0", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.1.1", "libc", "memoffset 0.9.1", ] @@ -6436,9 +6577,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ "memchr", ] @@ -6555,7 +6696,7 @@ dependencies = [ "async-trait", "byteorder", "chrono", - "mysql_common 0.32.3", + "mysql_common 0.32.4", "nom", "pin-project-lite", "tokio", @@ -6933,7 +7074,7 @@ dependencies = [ "cfg-if", "libc", "petgraph", - "redox_syscall 0.5.1", + "redox_syscall 0.5.2", "smallvec", "thread-id", "windows-targets 0.52.5", @@ -7024,6 +7165,43 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +[[package]] +name = "pbjson" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1030c719b0ec2a2d25a5df729d6cff1acf3cc230bf766f4f97833591f7577b90" +dependencies = [ + "base64 0.21.7", + "serde", +] + +[[package]] +name = "pbjson-build" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2580e33f2292d34be285c5bc3dba5259542b083cfad6037b6d70345f24dcb735" +dependencies = [ + "heck 0.4.1", + "itertools 0.11.0", + "prost 0.12.6", + "prost-types 0.12.6", +] + +[[package]] +name = "pbjson-types" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18f596653ba4ac51bdecbb4ef6773bc7f56042dc13927910de1684ad3d32aa12" +dependencies = [ + "bytes", + "chrono", + "pbjson", + "pbjson-build", + "prost 0.12.6", + "prost-build 0.12.6", + "serde", +] + [[package]] name = "pbkdf2" version = "0.12.2" @@ -7600,9 +7778,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.84" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -8227,9 +8405,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ "bitflags 2.5.0", ] @@ -8267,14 +8445,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -8288,13 +8466,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -8305,9 +8483,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "regress" @@ -8346,9 +8524,9 @@ dependencies = [ [[package]] name = "reqsign" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01edce6b6c31a16ebc7525ac58c747a6d78bbce33e76bbebd350d6bc25b23e06" +checksum = "70fe66d4cd0b5ed9b1abbfe639bf6baeaaf509f7da2d51b31111ba945be59286" dependencies = [ "anyhow", "async-trait", @@ -8416,7 +8594,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.1", + "webpki-roots 0.26.2", "winreg 0.52.0", ] @@ -9287,9 +9465,9 @@ dependencies = [ [[package]] name = "safe_arch" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" dependencies = [ "bytemuck", ] @@ -9566,9 +9744,9 @@ dependencies = [ [[package]] name = "serde_tokenstream" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a00ffd23fd882d096f09fcaae2a9de8329a328628e86027e049ee051dc1621f" +checksum = "8790a7c3fe883e443eaa2af6f705952bc5d6e8671a220b9335c8cae92c037e74" dependencies = [ "proc-macro2", "quote", @@ -9679,7 +9857,7 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "humantime-serde", - "hyper 0.14.28", + "hyper 0.14.29", "influxdb_line_protocol", "itertools 0.10.5", "lazy_static", @@ -10046,11 +10224,10 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f" dependencies = [ - "itertools 0.12.1", "nom", "unicode_categories", ] @@ -10075,7 +10252,7 @@ name = "sqlness-runner" version = "0.8.2" dependencies = [ "async-trait", - "clap 4.5.4", + "clap 4.5.7", "client", "common-error", "common-query", @@ -10276,9 +10453,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "statrs" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d08e5e1748192713cc281da8b16924fb46be7b0c2431854eadc785823e5696e" +checksum = "b35a062dbadac17a42e0fc64c27f419b25d6fae98572eb43c8814c9e873d7721" dependencies = [ "approx", "lazy_static", @@ -10412,7 +10589,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ - "strum_macros 0.26.2", + "strum_macros 0.26.4", ] [[package]] @@ -10443,11 +10620,11 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", @@ -10509,11 +10686,14 @@ dependencies = [ [[package]] name = "substrait" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c7ccf682a18309d9039bc16e14d9c7ea3a461e65dfc46e2b611b401b945ef2d" +checksum = "04c77dec9b6c4e48ac828937bbe7cf473b0933168c5d76d51a5816ace7046be9" dependencies = [ "heck 0.5.0", + "pbjson", + "pbjson-build", + "pbjson-types", "prettyplease 0.2.20", "prost 0.12.6", "prost-build 0.12.6", @@ -10536,9 +10716,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "symbolic-common" -version = "12.8.0" +version = "12.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cccfffbc6bb3bb2d3a26cd2077f4d055f6808d266f9d4d158797a4c60510dfe" +checksum = "71297dc3e250f7dbdf8adb99e235da783d690f5819fdeb4cce39d9cfb0aca9f1" dependencies = [ "debugid", "memmap2 0.9.4", @@ -10548,9 +10728,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.8.0" +version = "12.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a99812da4020a67e76c4eb41f08c87364c14170495ff780f30dd519c221a68" +checksum = "424fa2c9bf2c862891b9cfd354a752751a6730fd838a4691e7f6c2c7957b9daf" dependencies = [ "cpp_demangle", "rustc-demangle", @@ -10616,6 +10796,17 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "sysinfo" version = "0.30.12" @@ -10810,7 +11001,7 @@ dependencies = [ "cache", "catalog", "chrono", - "clap 4.5.4", + "clap 4.5.7", "client", "cmd", "common-base", @@ -11034,6 +11225,16 @@ dependencies = [ "log", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -11061,9 +11262,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -11091,9 +11292,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", @@ -11247,14 +11448,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.13", + "toml_edit 0.22.14", ] [[package]] @@ -11290,15 +11491,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.8", + "winnow 0.6.13", ] [[package]] @@ -11316,7 +11517,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-timeout", "percent-encoding", "pin-project", @@ -11344,7 +11545,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-timeout", "percent-encoding", "pin-project", @@ -11440,7 +11641,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "async-compression 0.4.10", + "async-compression 0.4.11", "base64 0.21.7", "bitflags 2.5.0", "bytes", @@ -11698,9 +11899,9 @@ checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc" [[package]] name = "triomphe" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +checksum = "1b2cb4fbb9995eeb36ac86fadf24031ccd58f99d6b4b2d7b911db70bddb80d90" [[package]] name = "try-lock" @@ -12033,9 +12234,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -12083,9 +12284,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", "idna", @@ -12098,17 +12299,29 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + [[package]] name = "utf8-width" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -12378,9 +12591,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" dependencies = [ "rustls-pki-types", ] @@ -12410,9 +12623,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.21" +version = "0.7.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8dc749a1b03f3c255a3064a4f5c0ee5ed09b7c6bc6d4525d31f779cd74d7fc" +checksum = "8a040b111774ab63a19ef46bbc149398ab372b4ccdcfd719e9814dbd7dfd76c8" dependencies = [ "bytemuck", "safe_arch", @@ -12733,9 +12946,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] @@ -12759,6 +12972,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -12817,6 +13042,30 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.34" @@ -12837,6 +13086,27 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -12857,6 +13127,28 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "zstd" version = "0.11.2+zstd.1.5.2" diff --git a/Cargo.toml b/Cargo.toml index ec822ed4ee69..7f9608ceb5c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,15 +104,15 @@ clap = { version = "4.4", features = ["derive"] } config = "0.13.0" crossbeam-utils = "0.8" dashmap = "5.4" -datafusion = { git = "https://github.com/apache/datafusion.git", rev = "08e19f4956d32164be6fc66eb5a4c080eb0023d1" } -datafusion-common = { git = "https://github.com/apache/datafusion.git", rev = "08e19f4956d32164be6fc66eb5a4c080eb0023d1" } -datafusion-expr = { git = "https://github.com/apache/datafusion.git", rev = "08e19f4956d32164be6fc66eb5a4c080eb0023d1" } -datafusion-functions = { git = "https://github.com/apache/datafusion.git", rev = "08e19f4956d32164be6fc66eb5a4c080eb0023d1" } -datafusion-optimizer = { git = "https://github.com/apache/datafusion.git", rev = "08e19f4956d32164be6fc66eb5a4c080eb0023d1" } -datafusion-physical-expr = { git = "https://github.com/apache/datafusion.git", rev = "08e19f4956d32164be6fc66eb5a4c080eb0023d1" } -datafusion-physical-plan = { git = "https://github.com/apache/datafusion.git", rev = "08e19f4956d32164be6fc66eb5a4c080eb0023d1" } -datafusion-sql = { git = "https://github.com/apache/datafusion.git", rev = "08e19f4956d32164be6fc66eb5a4c080eb0023d1" } -datafusion-substrait = { git = "https://github.com/apache/datafusion.git", rev = "08e19f4956d32164be6fc66eb5a4c080eb0023d1" } +datafusion = { git = "https://github.com/apache/datafusion.git", rev = "729b356ef543ffcda6813c7b5373507a04ae0109" } +datafusion-common = { git = "https://github.com/apache/datafusion.git", rev = "729b356ef543ffcda6813c7b5373507a04ae0109" } +datafusion-expr = { git = "https://github.com/apache/datafusion.git", rev = "729b356ef543ffcda6813c7b5373507a04ae0109" } +datafusion-functions = { git = "https://github.com/apache/datafusion.git", rev = "729b356ef543ffcda6813c7b5373507a04ae0109" } +datafusion-optimizer = { git = "https://github.com/apache/datafusion.git", rev = "729b356ef543ffcda6813c7b5373507a04ae0109" } +datafusion-physical-expr = { git = "https://github.com/apache/datafusion.git", rev = "729b356ef543ffcda6813c7b5373507a04ae0109" } +datafusion-physical-plan = { git = "https://github.com/apache/datafusion.git", rev = "729b356ef543ffcda6813c7b5373507a04ae0109" } +datafusion-sql = { git = "https://github.com/apache/datafusion.git", rev = "729b356ef543ffcda6813c7b5373507a04ae0109" } +datafusion-substrait = { git = "https://github.com/apache/datafusion.git", rev = "729b356ef543ffcda6813c7b5373507a04ae0109" } derive_builder = "0.12" dotenv = "0.15" # TODO(LFC): Wait for https://github.com/etcdv3/etcd-client/pull/76 diff --git a/src/common/datasource/src/file_format/tests.rs b/src/common/datasource/src/file_format/tests.rs index 7be8664b7231..1ab29350e26b 100644 --- a/src/common/datasource/src/file_format/tests.rs +++ b/src/common/datasource/src/file_format/tests.rs @@ -19,7 +19,6 @@ use std::vec; use common_test_util::find_workspace_path; use datafusion::assert_batches_eq; -use datafusion::config::TableParquetOptions; use datafusion::datasource::physical_plan::{FileOpener, FileScanConfig, FileStream, ParquetExec}; use datafusion::execution::context::TaskContext; use datafusion::physical_plan::metrics::ExecutionPlanMetricsSet; @@ -167,8 +166,9 @@ async fn test_parquet_exec() { .to_string(); let base_config = scan_config(schema.clone(), None, path); - let exec = ParquetExec::new(base_config, None, None, TableParquetOptions::default()) - .with_parquet_file_reader_factory(Arc::new(DefaultParquetFileReaderFactory::new(store))); + let exec = ParquetExec::builder(base_config) + .with_parquet_file_reader_factory(Arc::new(DefaultParquetFileReaderFactory::new(store))) + .build(); let ctx = SessionContext::new(); diff --git a/src/datatypes/src/value.rs b/src/datatypes/src/value.rs index cfeff152e2b3..225420cbc27c 100644 --- a/src/datatypes/src/value.rs +++ b/src/datatypes/src/value.rs @@ -882,7 +882,8 @@ impl TryFrom for Value { | ScalarValue::FixedSizeList(_) | ScalarValue::LargeList(_) | ScalarValue::Dictionary(_, _) - | ScalarValue::Union(_, _, _) => { + | ScalarValue::Union(_, _, _) + | ScalarValue::Float16(_) => { return error::UnsupportedArrowTypeSnafu { arrow_type: v.data_type(), } diff --git a/src/datatypes/src/vectors/helper.rs b/src/datatypes/src/vectors/helper.rs index b583b20697fd..d1fc140ff0b0 100644 --- a/src/datatypes/src/vectors/helper.rs +++ b/src/datatypes/src/vectors/helper.rs @@ -239,7 +239,8 @@ impl Helper { | ScalarValue::FixedSizeList(_) | ScalarValue::LargeList(_) | ScalarValue::Dictionary(_, _) - | ScalarValue::Union(_, _, _) => { + | ScalarValue::Union(_, _, _) + | ScalarValue::Float16(_) => { return error::ConversionSnafu { from: format!("Unsupported scalar value: {value}"), } diff --git a/src/file-engine/src/query/file_stream.rs b/src/file-engine/src/query/file_stream.rs index 8f35edd34403..70b352c281f8 100644 --- a/src/file-engine/src/query/file_stream.rs +++ b/src/file-engine/src/query/file_stream.rs @@ -22,7 +22,6 @@ use common_datasource::file_format::Format; use common_recordbatch::adapter::RecordBatchStreamAdapter; use common_recordbatch::SendableRecordBatchStream; use datafusion::common::{Statistics, ToDFSchema}; -use datafusion::config::TableParquetOptions; use datafusion::datasource::listing::PartitionedFile; use datafusion::datasource::object_store::ObjectStoreUrl; use datafusion::datasource::physical_plan::{FileOpener, FileScanConfig, FileStream, ParquetExec}; @@ -198,10 +197,15 @@ fn new_parquet_stream_with_exec_plan( // TODO(ruihang): get this from upper layer let task_ctx = SessionContext::default().task_ctx(); - let parquet_exec = ParquetExec::new(scan_config, filters, None, TableParquetOptions::default()) + let mut builder = ParquetExec::builder(scan_config); + if let Some(filters) = filters { + builder = builder.with_predicate(filters); + } + let parquet_exec = builder .with_parquet_file_reader_factory(Arc::new(DefaultParquetFileReaderFactory::new( store.clone(), - ))); + ))) + .build(); let stream = parquet_exec .execute(0, task_ctx) .context(error::ParquetScanPlanSnafu)?; diff --git a/src/flow/src/transform/aggr.rs b/src/flow/src/transform/aggr.rs index 19a8ba2dfc76..f6aad8c4bbae 100644 --- a/src/flow/src/transform/aggr.rs +++ b/src/flow/src/transform/aggr.rs @@ -24,9 +24,10 @@ use hydroflow::futures::future::Map; use itertools::Itertools; use snafu::{OptionExt, ResultExt}; use substrait::variation_const::{ - DATE_32_TYPE_REF, DATE_64_TYPE_REF, DEFAULT_TYPE_REF, TIMESTAMP_MICRO_TYPE_REF, - TIMESTAMP_MILLI_TYPE_REF, TIMESTAMP_NANO_TYPE_REF, TIMESTAMP_SECOND_TYPE_REF, - UNSIGNED_INTEGER_TYPE_REF, + DATE_32_TYPE_VARIATION_REF, DATE_64_TYPE_VARIATION_REF, DEFAULT_TYPE_VARIATION_REF, + TIMESTAMP_MICRO_TYPE_VARIATION_REF, TIMESTAMP_MILLI_TYPE_VARIATION_REF, + TIMESTAMP_NANO_TYPE_VARIATION_REF, TIMESTAMP_SECOND_TYPE_VARIATION_REF, + UNSIGNED_INTEGER_TYPE_VARIATION_REF, }; use substrait_proto::proto::aggregate_function::AggregationInvocation; use substrait_proto::proto::aggregate_rel::{Grouping, Measure}; diff --git a/src/flow/src/transform/literal.rs b/src/flow/src/transform/literal.rs index d13d74393b28..9dc93d17c549 100644 --- a/src/flow/src/transform/literal.rs +++ b/src/flow/src/transform/literal.rs @@ -17,9 +17,10 @@ use common_time::{Date, Timestamp}; use datatypes::data_type::ConcreteDataType as CDT; use datatypes::value::Value; use substrait::variation_const::{ - DATE_32_TYPE_REF, DATE_64_TYPE_REF, DEFAULT_TYPE_REF, TIMESTAMP_MICRO_TYPE_REF, - TIMESTAMP_MILLI_TYPE_REF, TIMESTAMP_NANO_TYPE_REF, TIMESTAMP_SECOND_TYPE_REF, - UNSIGNED_INTEGER_TYPE_REF, + DATE_32_TYPE_VARIATION_REF, DATE_64_TYPE_VARIATION_REF, DEFAULT_TYPE_VARIATION_REF, + TIMESTAMP_MICRO_TYPE_VARIATION_REF, TIMESTAMP_MILLI_TYPE_VARIATION_REF, + TIMESTAMP_NANO_TYPE_VARIATION_REF, TIMESTAMP_SECOND_TYPE_VARIATION_REF, + UNSIGNED_INTEGER_TYPE_VARIATION_REF, }; use substrait_proto::proto::expression::literal::LiteralType; use substrait_proto::proto::expression::Literal; @@ -33,41 +34,41 @@ pub(crate) fn from_substrait_literal(lit: &Literal) -> Result<(Value, CDT), Erro let scalar_value = match &lit.literal_type { Some(LiteralType::Boolean(b)) => (Value::from(*b), CDT::boolean_datatype()), Some(LiteralType::I8(n)) => match lit.type_variation_reference { - DEFAULT_TYPE_REF => (Value::from(*n as i8), CDT::int8_datatype()), - UNSIGNED_INTEGER_TYPE_REF => (Value::from(*n as u8), CDT::uint8_datatype()), + DEFAULT_TYPE_VARIATION_REF => (Value::from(*n as i8), CDT::int8_datatype()), + UNSIGNED_INTEGER_TYPE_VARIATION_REF => (Value::from(*n as u8), CDT::uint8_datatype()), others => not_impl_err!("Unknown type variation reference {others}",)?, }, Some(LiteralType::I16(n)) => match lit.type_variation_reference { - DEFAULT_TYPE_REF => (Value::from(*n as i16), CDT::int16_datatype()), - UNSIGNED_INTEGER_TYPE_REF => (Value::from(*n as u16), CDT::uint16_datatype()), + DEFAULT_TYPE_VARIATION_REF => (Value::from(*n as i16), CDT::int16_datatype()), + UNSIGNED_INTEGER_TYPE_VARIATION_REF => (Value::from(*n as u16), CDT::uint16_datatype()), others => not_impl_err!("Unknown type variation reference {others}",)?, }, Some(LiteralType::I32(n)) => match lit.type_variation_reference { - DEFAULT_TYPE_REF => (Value::from(*n), CDT::int32_datatype()), - UNSIGNED_INTEGER_TYPE_REF => (Value::from(*n as u32), CDT::uint32_datatype()), + DEFAULT_TYPE_VARIATION_REF => (Value::from(*n), CDT::int32_datatype()), + UNSIGNED_INTEGER_TYPE_VARIATION_REF => (Value::from(*n as u32), CDT::uint32_datatype()), others => not_impl_err!("Unknown type variation reference {others}",)?, }, Some(LiteralType::I64(n)) => match lit.type_variation_reference { - DEFAULT_TYPE_REF => (Value::from(*n), CDT::int64_datatype()), - UNSIGNED_INTEGER_TYPE_REF => (Value::from(*n as u64), CDT::uint64_datatype()), + DEFAULT_TYPE_VARIATION_REF => (Value::from(*n), CDT::int64_datatype()), + UNSIGNED_INTEGER_TYPE_VARIATION_REF => (Value::from(*n as u64), CDT::uint64_datatype()), others => not_impl_err!("Unknown type variation reference {others}",)?, }, Some(LiteralType::Fp32(f)) => (Value::from(*f), CDT::float32_datatype()), Some(LiteralType::Fp64(f)) => (Value::from(*f), CDT::float64_datatype()), Some(LiteralType::Timestamp(t)) => match lit.type_variation_reference { - TIMESTAMP_SECOND_TYPE_REF => ( + TIMESTAMP_SECOND_TYPE_VARIATION_REF => ( Value::from(Timestamp::new_second(*t)), CDT::timestamp_second_datatype(), ), - TIMESTAMP_MILLI_TYPE_REF => ( + TIMESTAMP_MILLI_TYPE_VARIATION_REF => ( Value::from(Timestamp::new_millisecond(*t)), CDT::timestamp_millisecond_datatype(), ), - TIMESTAMP_MICRO_TYPE_REF => ( + TIMESTAMP_MICRO_TYPE_VARIATION_REF => ( Value::from(Timestamp::new_microsecond(*t)), CDT::timestamp_microsecond_datatype(), ), - TIMESTAMP_NANO_TYPE_REF => ( + TIMESTAMP_NANO_TYPE_VARIATION_REF => ( Value::from(Timestamp::new_nanosecond(*t)), CDT::timestamp_nanosecond_datatype(), ), @@ -115,37 +116,36 @@ pub fn from_substrait_type(null_type: &substrait_proto::proto::Type) -> Result Ok(CDT::boolean_datatype()), Kind::I8(integer) => match integer.type_variation_reference { - DEFAULT_TYPE_REF => Ok(CDT::int8_datatype()), - UNSIGNED_INTEGER_TYPE_REF => Ok(CDT::uint8_datatype()), + DEFAULT_TYPE_VARIATION_REF => Ok(CDT::int8_datatype()), + UNSIGNED_INTEGER_TYPE_VARIATION_REF => Ok(CDT::uint8_datatype()), v => not_impl_err!("Unsupported Substrait type variation {v} of type {kind:?}"), }, Kind::I16(integer) => match integer.type_variation_reference { - DEFAULT_TYPE_REF => Ok(CDT::int16_datatype()), - UNSIGNED_INTEGER_TYPE_REF => Ok(CDT::uint16_datatype()), + DEFAULT_TYPE_VARIATION_REF => Ok(CDT::int16_datatype()), + UNSIGNED_INTEGER_TYPE_VARIATION_REF => Ok(CDT::uint16_datatype()), v => not_impl_err!("Unsupported Substrait type variation {v} of type {kind:?}"), }, Kind::I32(integer) => match integer.type_variation_reference { - DEFAULT_TYPE_REF => Ok(CDT::int32_datatype()), - UNSIGNED_INTEGER_TYPE_REF => Ok(CDT::uint32_datatype()), + DEFAULT_TYPE_VARIATION_REF => Ok(CDT::int32_datatype()), + UNSIGNED_INTEGER_TYPE_VARIATION_REF => Ok(CDT::uint32_datatype()), v => not_impl_err!("Unsupported Substrait type variation {v} of type {kind:?}"), }, Kind::I64(integer) => match integer.type_variation_reference { - DEFAULT_TYPE_REF => Ok(CDT::int64_datatype()), - UNSIGNED_INTEGER_TYPE_REF => Ok(CDT::uint64_datatype()), + DEFAULT_TYPE_VARIATION_REF => Ok(CDT::int64_datatype()), + UNSIGNED_INTEGER_TYPE_VARIATION_REF => Ok(CDT::uint64_datatype()), v => not_impl_err!("Unsupported Substrait type variation {v} of type {kind:?}"), }, Kind::Fp32(_) => Ok(CDT::float32_datatype()), Kind::Fp64(_) => Ok(CDT::float64_datatype()), Kind::Timestamp(ts) => match ts.type_variation_reference { - TIMESTAMP_SECOND_TYPE_REF => Ok(CDT::timestamp_second_datatype()), - TIMESTAMP_MILLI_TYPE_REF => Ok(CDT::timestamp_millisecond_datatype()), - TIMESTAMP_MICRO_TYPE_REF => Ok(CDT::timestamp_microsecond_datatype()), - TIMESTAMP_NANO_TYPE_REF => Ok(CDT::timestamp_nanosecond_datatype()), + TIMESTAMP_SECOND_TYPE_VARIATION_REF => Ok(CDT::timestamp_second_datatype()), + TIMESTAMP_MILLI_TYPE_VARIATION_REF => Ok(CDT::timestamp_millisecond_datatype()), + TIMESTAMP_MICRO_TYPE_VARIATION_REF => Ok(CDT::timestamp_microsecond_datatype()), + TIMESTAMP_NANO_TYPE_VARIATION_REF => Ok(CDT::timestamp_nanosecond_datatype()), v => not_impl_err!("Unsupported Substrait type variation {v} of type {kind:?}"), }, Kind::Date(date) => match date.type_variation_reference { - DATE_32_TYPE_REF => Ok(CDT::date_datatype()), - DATE_64_TYPE_REF => Ok(CDT::date_datatype()), + DATE_32_TYPE_VARIATION_REF | DATE_64_TYPE_VARIATION_REF => Ok(CDT::date_datatype()), v => not_impl_err!("Unsupported Substrait type variation {v} of type {kind:?}"), }, Kind::Binary(_) => Ok(CDT::binary_datatype()), diff --git a/src/query/src/promql/planner.rs b/src/query/src/promql/planner.rs index 2a0a16a2000c..5dabffedc4d4 100644 --- a/src/query/src/promql/planner.rs +++ b/src/query/src/promql/planner.rs @@ -22,6 +22,7 @@ use common_query::prelude::GREPTIME_VALUE; use datafusion::common::{DFSchemaRef, Result as DfResult}; use datafusion::datasource::DefaultTableSource; use datafusion::execution::context::SessionState; +use datafusion::functions_aggregate::sum; use datafusion::logical_expr::expr::{ AggregateFunction, AggregateFunctionDefinition, Alias, ScalarFunction, }; @@ -1379,14 +1380,18 @@ impl PromPlanner { input_plan: &LogicalPlan, ) -> Result> { let aggr = match op.id() { - token::T_SUM => AggregateFunctionEnum::Sum, - token::T_AVG => AggregateFunctionEnum::Avg, - token::T_COUNT => AggregateFunctionEnum::Count, - token::T_MIN => AggregateFunctionEnum::Min, - token::T_MAX => AggregateFunctionEnum::Max, - token::T_GROUP => AggregateFunctionEnum::Grouping, - token::T_STDDEV => AggregateFunctionEnum::StddevPop, - token::T_STDVAR => AggregateFunctionEnum::VariancePop, + token::T_SUM => AggregateFunctionDefinition::UDF(sum::sum_udaf()), + token::T_AVG => AggregateFunctionDefinition::BuiltIn(AggregateFunctionEnum::Avg), + token::T_COUNT => AggregateFunctionDefinition::BuiltIn(AggregateFunctionEnum::Count), + token::T_MIN => AggregateFunctionDefinition::BuiltIn(AggregateFunctionEnum::Min), + token::T_MAX => AggregateFunctionDefinition::BuiltIn(AggregateFunctionEnum::Max), + token::T_GROUP => AggregateFunctionDefinition::BuiltIn(AggregateFunctionEnum::Grouping), + token::T_STDDEV => { + AggregateFunctionDefinition::BuiltIn(AggregateFunctionEnum::StddevPop) + } + token::T_STDVAR => { + AggregateFunctionDefinition::BuiltIn(AggregateFunctionEnum::VariancePop) + } token::T_TOPK | token::T_BOTTOMK | token::T_COUNT_VALUES | token::T_QUANTILE => { UnsupportedExprSnafu { name: format!("{op:?}"), @@ -1403,7 +1408,7 @@ impl PromPlanner { .iter() .map(|col| { DfExpr::AggregateFunction(AggregateFunction { - func_def: AggregateFunctionDefinition::BuiltIn(aggr.clone()), + func_def: aggr.clone(), args: vec![DfExpr::Column(Column::from_name(col))], distinct: false, filter: None, diff --git a/tests/cases/standalone/common/function/expression.result b/tests/cases/standalone/common/function/expression.result index 061b6a02dbdf..bacf9dda71f4 100644 --- a/tests/cases/standalone/common/function/expression.result +++ b/tests/cases/standalone/common/function/expression.result @@ -64,6 +64,38 @@ SELECT ISNULL('string'); | false | +------------------------+ +SELECT FIRST_VALUE(1); + ++-----------------------+ +| first_value(Int64(1)) | ++-----------------------+ +| 1 | ++-----------------------+ + +SELECT FIRST_VALUE('a'); + ++------------------------+ +| first_value(Utf8("a")) | ++------------------------+ +| a | ++------------------------+ + +SELECT LAST_VALUE(1); + ++----------------------+ +| last_value(Int64(1)) | ++----------------------+ +| 1 | ++----------------------+ + +SELECT LAST_VALUE('a'); + ++-----------------------+ +| last_value(Utf8("a")) | ++-----------------------+ +| a | ++-----------------------+ + DROP TABLE t; Affected Rows: 0 diff --git a/tests/cases/standalone/common/function/expression.sql b/tests/cases/standalone/common/function/expression.sql index 19c5b5d4e1a5..b1de90036fbe 100644 --- a/tests/cases/standalone/common/function/expression.sql +++ b/tests/cases/standalone/common/function/expression.sql @@ -16,4 +16,12 @@ SELECT ISNULL(true); SELECT ISNULL('string'); +SELECT FIRST_VALUE(1); + +SELECT FIRST_VALUE('a'); + +SELECT LAST_VALUE(1); + +SELECT LAST_VALUE('a'); + DROP TABLE t; diff --git a/tests/cases/standalone/common/range/special_aggr.result b/tests/cases/standalone/common/range/special_aggr.result index 449a5534c160..1344d3bbdbaf 100644 --- a/tests/cases/standalone/common/range/special_aggr.result +++ b/tests/cases/standalone/common/range/special_aggr.result @@ -231,7 +231,11 @@ SELECT ts, host, count(distinct *) RANGE '5s' FROM host ALIGN '5s' ORDER BY host -- Test error first_value/last_value SELECT ts, host, first_value(val, val) RANGE '5s' FROM host ALIGN '5s' ORDER BY host, ts; -Error: 3001(EngineExecuteQuery), DataFusion error: Error during planning: Coercion from [Int64, Int64] to the signature OneOf([ArraySignature(Array), Uniform(1, [Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Float32, Float64])]) failed. +Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Error during planning: Coercion from [Int64, Int64] to the signature OneOf([ArraySignature(Array), Numeric(1), Uniform(1, [Utf8])]) failed. and No function matches the given name and argument types 'first_value(Int64, Int64)'. You might need to add explicit type casts. + Candidate functions: + first_value(array) + first_value(Numeric(1)) + first_value(Utf8) DROP TABLE host; diff --git a/tests/cases/standalone/common/types/decimal/decimal_aggregates.result b/tests/cases/standalone/common/types/decimal/decimal_aggregates.result index e5d4fda8fc5e..3eab6d954129 100644 --- a/tests/cases/standalone/common/types/decimal/decimal_aggregates.result +++ b/tests/cases/standalone/common/types/decimal/decimal_aggregates.result @@ -5,7 +5,7 @@ SELECT arrow_typeof(FIRST_VALUE('0.1'::DECIMAL(4,1))); +----------------------------------------+ | arrow_typeof(first_value(Utf8("0.1"))) | +----------------------------------------+ -| Float64 | +| Decimal128(4, 1) | +----------------------------------------+ -- first_value @@ -18,7 +18,7 @@ SELECT FIRST_VALUE(NULL::DECIMAL), +-------------------+--------------------------+--------------------------------+------------------------------------------+--------------------------------------------------------------+ | first_value(NULL) | first_value(Utf8("0.1")) | first_value(Utf8("4938245.1")) | first_value(Utf8("45672564564938245.1")) | first_value(Utf8("4567645908450368043562342564564938245.1")) | +-------------------+--------------------------+--------------------------------+------------------------------------------+--------------------------------------------------------------+ -| | 0.1 | 4938245.1 | 4.567256456493825e16 | 4.567645908450368e36 | +| | 0.1 | 4938245.1 | 45672564564938245.1 | 4567645908450368043562342564564938245.1 | +-------------------+--------------------------+--------------------------------+------------------------------------------+--------------------------------------------------------------+ -- min diff --git a/tests/cases/standalone/common/types/interval/interval.result b/tests/cases/standalone/common/types/interval/interval.result index 5cce116faf18..f570ebc33e28 100644 --- a/tests/cases/standalone/common/types/interval/interval.result +++ b/tests/cases/standalone/common/types/interval/interval.result @@ -277,9 +277,9 @@ This was likely caused by a bug in DataFusion's code and we would welcome that y SELECT SUM(interval_value) from intervals; -Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: No function matches the given name and argument types 'SUM(Interval(MonthDayNano))'. You might need to add explicit type casts. +Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Execution error: User-defined coercion failed with Execution("Sum not supported for Interval(MonthDayNano)") and No function matches the given name and argument types 'SUM(Interval(MonthDayNano))'. You might need to add explicit type casts. Candidate functions: - SUM(Int8/Int16/Int32/Int64/UInt8/UInt16/UInt32/UInt64/Float32/Float64) + SUM(UserDefined) SELECT AVG(interval_value) from intervals; diff --git a/tests/cases/standalone/common/types/timestamp/timestamp.result b/tests/cases/standalone/common/types/timestamp/timestamp.result index 91bd3723037a..0b799f7fe70d 100644 --- a/tests/cases/standalone/common/types/timestamp/timestamp.result +++ b/tests/cases/standalone/common/types/timestamp/timestamp.result @@ -75,9 +75,9 @@ SELECT MAX(t) FROM timestamp; SELECT SUM(t) FROM timestamp; -Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: No function matches the given name and argument types 'SUM(Timestamp(Millisecond, None))'. You might need to add explicit type casts. +Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Execution error: User-defined coercion failed with Execution("Sum not supported for Timestamp(Millisecond, None)") and No function matches the given name and argument types 'SUM(Timestamp(Millisecond, None))'. You might need to add explicit type casts. Candidate functions: - SUM(Int8/Int16/Int32/Int64/UInt8/UInt16/UInt32/UInt64/Float32/Float64) + SUM(UserDefined) SELECT AVG(t) FROM timestamp;