From c2218f8be80e2159fcdc6f0cc239d2ab6491d8fe Mon Sep 17 00:00:00 2001 From: Ruihang Xia Date: Sat, 1 Jun 2024 22:03:00 +0800 Subject: [PATCH] build(deps): bump datafusion 20240528 (#4061) * build(deps): bump datafusion 20240528 Signed-off-by: Ruihang Xia * another update Signed-off-by: Ruihang Xia * update expected sqlness result Signed-off-by: Ruihang Xia * fix first/last value Signed-off-by: Ruihang Xia * reformat comment Signed-off-by: Ruihang Xia * fix remaining errors Signed-off-by: Ruihang Xia * revert toml format Signed-off-by: Ruihang Xia * fix pyo3 feature Signed-off-by: Ruihang Xia * remove dead code Signed-off-by: Ruihang Xia * Apply suggestions from code review Co-authored-by: Jeremyhi * format file Signed-off-by: Ruihang Xia --------- Signed-off-by: Ruihang Xia Co-authored-by: Jeremyhi --- Cargo.lock | 1199 +++++++++-------- Cargo.toml | 20 +- benchmarks/Cargo.toml | 1 - src/common/query/src/logical_plan/udaf.rs | 6 +- src/common/query/src/logical_plan/udf.rs | 4 + src/common/query/src/signature.rs | 13 +- src/common/recordbatch/src/adapter.rs | 2 +- src/frontend/src/instance/prom_store.rs | 2 +- src/operator/src/expr_factory.rs | 8 +- src/promql/src/extension_plan/empty_metric.rs | 18 +- .../src/extension_plan/histogram_fold.rs | 16 +- .../src/extension_plan/instant_manipulate.rs | 22 +- src/promql/src/extension_plan/normalize.rs | 22 +- .../src/extension_plan/range_manipulate.rs | 22 +- .../src/extension_plan/scalar_calculate.rs | 22 +- .../src/extension_plan/series_divide.rs | 20 +- .../src/extension_plan/union_distinct_on.rs | 26 +- src/query/Cargo.toml | 1 + src/query/src/analyze.rs | 6 +- src/query/src/datafusion/planner.rs | 22 +- src/query/src/dist_plan/commutativity.rs | 1 - src/query/src/dist_plan/merge_scan.rs | 10 +- src/query/src/dist_plan/planner.rs | 2 +- src/query/src/optimizer/count_wildcard.rs | 4 +- src/query/src/optimizer/order_hint.rs | 8 +- src/query/src/optimizer/remove_duplicate.rs | 2 +- .../src/optimizer/string_normalization.rs | 2 +- src/query/src/planner.rs | 2 +- src/query/src/promql/planner.rs | 202 +-- src/query/src/range_select/plan.rs | 66 +- src/query/src/range_select/plan_rewrite.rs | 8 +- src/query/src/sql/show_create_table.rs | 12 +- .../ffi_types/pair_tests/sample_testcases.rs | 33 - src/script/src/python/pyo3/builtins.rs | 12 +- src/script/src/python/rspython/builtins.rs | 43 - .../python/rspython/builtins/testcases.ron | 64 - src/servers/src/http/handler.rs | 2 +- src/servers/src/http/header.rs | 2 +- src/servers/src/http/prometheus.rs | 6 +- src/servers/src/http/prometheus_resp.rs | 2 +- src/servers/src/prom_store.rs | 4 +- src/servers/tests/py_script/mod.rs | 1 + src/sql/src/parsers/create_parser.rs | 69 +- src/sql/src/parsers/utils.rs | 6 +- src/sql/src/statements/create.rs | 1 - src/table/src/table/scan.rs | 2 +- .../distributed/explain/join_10_tables.result | 3 +- .../explain/multi_partitions.result | 2 +- .../cases/distributed/explain/order_by.result | 4 +- .../distributed/explain/subqueries.result | 12 +- .../distributed/optimizer/order_by.result | 68 +- .../common/aggregate/distinct_order_by.result | 2 +- .../standalone/common/aggregate/sum.result | 6 +- .../standalone/common/range/calculate.result | 48 +- .../standalone/common/range/error.result | 24 +- .../common/range/special_aggr.result | 18 +- .../common/tql-explain-analyze/analyze.result | 16 +- .../common/tql-explain-analyze/explain.result | 18 +- .../types/decimal/decimal_aggregates.result | 8 +- .../standalone/optimizer/order_by.result | 68 +- 60 files changed, 1136 insertions(+), 1179 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 007f777441..35fabee98b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.83" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "anymap" @@ -224,8 +224,8 @@ dependencies = [ "datatypes", "greptime-proto", "paste", - "prost 0.12.4", - "snafu 0.8.2", + "prost 0.12.6", + "snafu 0.8.3", "tonic-build 0.9.2", ] @@ -423,8 +423,8 @@ dependencies = [ "bytes", "futures", "paste", - "prost 0.12.4", - "prost-types 0.12.4", + "prost 0.12.6", + "prost-types 0.12.6", "tokio", "tonic 0.11.0", ] @@ -617,7 +617,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -639,7 +639,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -650,7 +650,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -715,7 +715,7 @@ dependencies = [ "digest", "notify", "sha1", - "snafu 0.8.2", + "snafu 0.8.3", "sql", "tokio", ] @@ -728,7 +728,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -811,7 +811,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -883,7 +883,6 @@ dependencies = [ "arrow", "chrono", "clap 4.5.4", - "client", "common-base", "common-telemetry", "common-wal", @@ -905,7 +904,7 @@ dependencies = [ "serde", "store-api", "tokio", - "toml 0.8.12", + "toml 0.8.13", "uuid", ] @@ -948,7 +947,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -1050,7 +1049,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", "syn_derive", ] @@ -1157,9 +1156,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" [[package]] name = "byteorder" @@ -1226,7 +1225,7 @@ dependencies = [ "common-macro", "common-meta", "moka", - "snafu 0.8.2", + "snafu 0.8.3", "substrait 0.8.1", ] @@ -1277,7 +1276,7 @@ dependencies = [ "common-time", "common-version", "dashmap", - "datafusion 37.0.0", + "datafusion 38.0.0", "datatypes", "futures", "futures-util", @@ -1293,7 +1292,7 @@ dependencies = [ "prometheus", "serde_json", "session", - "snafu 0.8.2", + "snafu 0.8.3", "sql", "store-api", "table", @@ -1311,9 +1310,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", @@ -1449,9 +1448,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "a483f3cbf7cec2e153d424d0e92329d816becc6421389bd494375c6065921b9b" dependencies = [ "glob", "libc", @@ -1516,7 +1515,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -1558,12 +1557,12 @@ dependencies = [ "futures-util", "lazy_static", "moka", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus", - "prost 0.12.4", + "prost 0.12.6", "rand", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "substrait 0.17.1", "substrait 0.8.1", "tokio", @@ -1638,7 +1637,7 @@ dependencies = [ "nu-ansi-term", "plugins", "prometheus", - "prost 0.12.4", + "prost 0.12.6", "query", "rand", "regex", @@ -1649,7 +1648,7 @@ dependencies = [ "serde_json", "servers", "session", - "snafu 0.8.2", + "snafu 0.8.3", "store-api", "substrait 0.8.1", "table", @@ -1657,7 +1656,7 @@ dependencies = [ "tempfile", "tikv-jemallocator", "tokio", - "toml 0.8.12", + "toml 0.8.13", "tracing-appender", ] @@ -1705,8 +1704,8 @@ dependencies = [ "common-macro", "paste", "serde", - "snafu 0.8.2", - "toml 0.8.12", + "snafu 0.8.3", + "toml 0.8.13", "zeroize", ] @@ -1717,7 +1716,7 @@ dependencies = [ "chrono", "common-error", "common-macro", - "snafu 0.8.2", + "snafu 0.8.3", "tokio", ] @@ -1737,11 +1736,11 @@ dependencies = [ "num_cpus", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "sysinfo", "temp-env", "tempfile", - "toml 0.8.12", + "toml 0.8.13", ] [[package]] @@ -1758,7 +1757,7 @@ dependencies = [ "common-recordbatch", "common-runtime", "common-test-util", - "datafusion 37.0.0", + "datafusion 38.0.0", "datatypes", "derive_builder 0.12.0", "futures", @@ -1769,7 +1768,7 @@ dependencies = [ "paste", "regex", "serde", - "snafu 0.8.2", + "snafu 0.8.3", "strum 0.25.0", "tokio", "tokio-util", @@ -1786,14 +1785,14 @@ dependencies = [ "rust_decimal", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", ] [[package]] name = "common-error" version = "0.8.1" dependencies = [ - "snafu 0.8.2", + "snafu 0.8.3", "strum 0.25.0", ] @@ -1808,7 +1807,7 @@ dependencies = [ "common-macro", "common-query", "session", - "snafu 0.8.2", + "snafu 0.8.3", "sql", ] @@ -1829,7 +1828,7 @@ dependencies = [ "common-telemetry", "common-time", "common-version", - "datafusion 37.0.0", + "datafusion 38.0.0", "datatypes", "num", "num-traits", @@ -1839,7 +1838,7 @@ dependencies = [ "serde", "serde_json", "session", - "snafu 0.8.2", + "snafu 0.8.3", "statrs", "store-api", "table", @@ -1880,9 +1879,9 @@ dependencies = [ "datatypes", "flatbuffers", "lazy_static", - "prost 0.12.4", + "prost 0.12.6", "rand", - "snafu 0.8.2", + "snafu 0.8.3", "tokio", "tonic 0.11.0", "tower", @@ -1901,7 +1900,7 @@ dependencies = [ "common-time", "datatypes", "paste", - "snafu 0.8.2", + "snafu 0.8.3", "table", ] @@ -1914,10 +1913,10 @@ dependencies = [ "datatypes", "proc-macro2", "quote", - "snafu 0.8.2", + "snafu 0.8.3", "static_assertions", "syn 1.0.109", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -1926,7 +1925,7 @@ version = "0.8.1" dependencies = [ "common-error", "common-macro", - "snafu 0.8.2", + "snafu 0.8.3", "tempfile", "tikv-jemalloc-ctl", "tikv-jemalloc-sys", @@ -1955,7 +1954,7 @@ dependencies = [ "common-telemetry", "common-time", "common-wal", - "datafusion-common 37.0.0", + "datafusion-common 38.0.0", "datatypes", "derive_builder 0.12.0", "etcd-client", @@ -1968,7 +1967,7 @@ dependencies = [ "lazy_static", "moka", "prometheus", - "prost 0.12.4", + "prost 0.12.6", "rand", "regex", "rskafka", @@ -1976,7 +1975,7 @@ dependencies = [ "serde_json", "serde_with", "session", - "snafu 0.8.2", + "snafu 0.8.3", "store-api", "strum 0.25.0", "table", @@ -2010,7 +2009,7 @@ dependencies = [ "serde", "serde_json", "smallvec", - "snafu 0.8.2", + "snafu 0.8.3", "tokio", "uuid", ] @@ -2035,13 +2034,13 @@ dependencies = [ "common-macro", "common-recordbatch", "common-time", - "datafusion 37.0.0", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", + "datafusion 38.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", "datatypes", "serde", - "snafu 0.8.2", - "sqlparser 0.44.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=e4e496b8d62416ad50ce70a1b460c7313610cf5d)", + "snafu 0.8.3", + "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "sqlparser_derive 0.1.1", "statrs", "tokio", @@ -2055,14 +2054,14 @@ dependencies = [ "common-error", "common-macro", "common-telemetry", - "datafusion 37.0.0", - "datafusion-common 37.0.0", + "datafusion 38.0.0", + "datafusion-common 38.0.0", "datatypes", "futures", "pin-project", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "tokio", ] @@ -2078,7 +2077,7 @@ dependencies = [ "once_cell", "paste", "prometheus", - "snafu 0.8.2", + "snafu 0.8.3", "tokio", "tokio-metrics", "tokio-metrics-collector", @@ -2101,7 +2100,7 @@ dependencies = [ "opentelemetry-otlp", "opentelemetry-semantic-conventions", "opentelemetry_sdk 0.21.2", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus", "serde", "serde_json", @@ -2138,7 +2137,7 @@ dependencies = [ "rand", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", ] [[package]] @@ -2164,9 +2163,9 @@ dependencies = [ "serde", "serde_json", "serde_with", - "snafu 0.8.2", + "snafu 0.8.3", "tokio", - "toml 0.8.12", + "toml 0.8.13", ] [[package]] @@ -2344,9 +2343,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -2404,9 +2403,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -2441,9 +2440,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -2514,12 +2513,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ - "darling_core 0.20.8", - "darling_macro 0.20.8", + "darling_core 0.20.9", + "darling_macro 0.20.9", ] [[package]] @@ -2538,16 +2537,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 2.0.61", + "strsim 0.11.1", + "syn 2.0.66", ] [[package]] @@ -2563,13 +2562,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ - "darling_core 0.20.8", + "darling_core 0.20.9", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -2591,57 +2590,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" -[[package]] -name = "datafusion" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" -dependencies = [ - "ahash 0.8.11", - "arrow", - "arrow-array", - "arrow-ipc", - "arrow-schema", - "async-compression 0.4.10", - "async-trait", - "bytes", - "bzip2", - "chrono", - "dashmap", - "datafusion-common 37.0.0", - "datafusion-common-runtime 37.0.0", - "datafusion-execution 37.0.0", - "datafusion-expr 37.0.0", - "datafusion-functions 37.0.0", - "datafusion-functions-aggregate", - "datafusion-functions-array 37.0.0", - "datafusion-optimizer 37.0.0", - "datafusion-physical-expr 37.0.0", - "datafusion-physical-plan 37.0.0", - "datafusion-sql 37.0.0", - "flate2", - "futures", - "glob", - "half 2.4.1", - "hashbrown 0.14.5", - "indexmap 2.2.6", - "itertools 0.12.1", - "log", - "num_cpus", - "object_store", - "parking_lot 0.12.2", - "parquet", - "pin-project-lite", - "rand", - "sqlparser 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile", - "tokio", - "tokio-util", - "url", - "uuid", - "xz2", - "zstd 0.13.1", -] - [[package]] name = "datafusion" version = "37.1.0" @@ -2679,11 +2627,11 @@ dependencies = [ "log", "num_cpus", "object_store", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "parquet", "pin-project-lite", "rand", - "sqlparser 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sqlparser 0.44.0", "tempfile", "tokio", "tokio-util", @@ -2694,23 +2642,55 @@ dependencies = [ ] [[package]] -name = "datafusion-common" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +name = "datafusion" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ "ahash 0.8.11", "arrow", "arrow-array", - "arrow-buffer", + "arrow-ipc", "arrow-schema", + "async-compression 0.4.10", + "async-trait", + "bytes", + "bzip2", "chrono", + "dashmap", + "datafusion-common 38.0.0", + "datafusion-common-runtime 38.0.0", + "datafusion-execution 38.0.0", + "datafusion-expr 38.0.0", + "datafusion-functions 38.0.0", + "datafusion-functions-aggregate", + "datafusion-functions-array 38.0.0", + "datafusion-optimizer 38.0.0", + "datafusion-physical-expr 38.0.0", + "datafusion-physical-expr-common", + "datafusion-physical-plan 38.0.0", + "datafusion-sql 38.0.0", + "flate2", + "futures", + "glob", "half 2.4.1", - "instant", - "libc", + "hashbrown 0.14.5", + "indexmap 2.2.6", + "itertools 0.12.1", + "log", "num_cpus", "object_store", + "parking_lot 0.12.3", "parquet", - "sqlparser 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite", + "rand", + "sqlparser 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile", + "tokio", + "tokio-util", + "url", + "uuid", + "xz2", + "zstd 0.13.1", ] [[package]] @@ -2731,15 +2711,28 @@ dependencies = [ "num_cpus", "object_store", "parquet", - "sqlparser 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sqlparser 0.44.0", ] [[package]] -name = "datafusion-common-runtime" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +name = "datafusion-common" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ - "tokio", + "ahash 0.8.11", + "arrow", + "arrow-array", + "arrow-buffer", + "arrow-schema", + "chrono", + "half 2.4.1", + "hashbrown 0.14.5", + "instant", + "libc", + "num_cpus", + "object_store", + "parquet", + "sqlparser 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2752,23 +2745,11 @@ dependencies = [ ] [[package]] -name = "datafusion-execution" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +name = "datafusion-common-runtime" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ - "arrow", - "chrono", - "dashmap", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", - "futures", - "hashbrown 0.14.5", - "log", - "object_store", - "parking_lot 0.12.2", - "rand", - "tempfile", - "url", + "tokio", ] [[package]] @@ -2786,27 +2767,30 @@ dependencies = [ "hashbrown 0.14.5", "log", "object_store", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "tempfile", "url", ] [[package]] -name = "datafusion-expr" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +name = "datafusion-execution" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ - "ahash 0.8.11", "arrow", - "arrow-array", "chrono", - "datafusion-common 37.0.0", - "paste", - "serde_json", - "sqlparser 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)", - "strum 0.26.2", - "strum_macros 0.26.2", + "dashmap", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", + "futures", + "hashbrown 0.14.5", + "log", + "object_store", + "parking_lot 0.12.3", + "rand", + "tempfile", + "url", ] [[package]] @@ -2821,35 +2805,26 @@ dependencies = [ "chrono", "datafusion-common 37.1.0", "paste", - "sqlparser 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sqlparser 0.44.0", "strum 0.26.2", "strum_macros 0.26.2", ] [[package]] -name = "datafusion-functions" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +name = "datafusion-expr" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ + "ahash 0.8.11", "arrow", - "base64 0.22.1", - "blake2", - "blake3", + "arrow-array", "chrono", - "datafusion-common 37.0.0", - "datafusion-execution 37.0.0", - "datafusion-expr 37.0.0", - "datafusion-physical-expr 37.0.0", - "hashbrown 0.14.5", - "hex", - "itertools 0.12.1", - "log", - "md-5", - "rand", - "regex", - "sha2", - "unicode-segmentation", - "uuid", + "datafusion-common 38.0.0", + "paste", + "serde_json", + "sqlparser 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", + "strum 0.26.2", + "strum_macros 0.26.2", ] [[package]] @@ -2878,36 +2853,45 @@ dependencies = [ ] [[package]] -name = "datafusion-functions-aggregate" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +name = "datafusion-functions" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ "arrow", - "datafusion-common 37.0.0", - "datafusion-execution 37.0.0", - "datafusion-expr 37.0.0", - "datafusion-physical-expr-common", + "base64 0.22.1", + "blake2", + "blake3", + "chrono", + "datafusion-common 38.0.0", + "datafusion-execution 38.0.0", + "datafusion-expr 38.0.0", + "datafusion-physical-expr 38.0.0", + "hashbrown 0.14.5", + "hex", + "itertools 0.12.1", "log", - "paste", + "md-5", + "rand", + "regex", + "sha2", + "unicode-segmentation", + "uuid", ] [[package]] -name = "datafusion-functions-array" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +name = "datafusion-functions-aggregate" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ "arrow", - "arrow-array", - "arrow-buffer", - "arrow-ord", "arrow-schema", - "datafusion-common 37.0.0", - "datafusion-execution 37.0.0", - "datafusion-expr 37.0.0", - "datafusion-functions 37.0.0", - "itertools 0.12.1", + "datafusion-common 38.0.0", + "datafusion-execution 38.0.0", + "datafusion-expr 38.0.0", + "datafusion-physical-expr-common", "log", "paste", + "sqlparser 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2931,20 +2915,22 @@ dependencies = [ ] [[package]] -name = "datafusion-optimizer" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +name = "datafusion-functions-array" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ "arrow", - "async-trait", - "chrono", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", - "datafusion-physical-expr 37.0.0", - "hashbrown 0.14.5", + "arrow-array", + "arrow-buffer", + "arrow-ord", + "arrow-schema", + "datafusion-common 38.0.0", + "datafusion-execution 38.0.0", + "datafusion-expr 38.0.0", + "datafusion-functions 38.0.0", "itertools 0.12.1", "log", - "regex-syntax 0.8.3", + "paste", ] [[package]] @@ -2966,33 +2952,22 @@ dependencies = [ ] [[package]] -name = "datafusion-physical-expr" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +name = "datafusion-optimizer" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ - "ahash 0.8.11", "arrow", - "arrow-array", - "arrow-buffer", - "arrow-ord", - "arrow-schema", - "arrow-string", - "base64 0.22.1", + "async-trait", "chrono", - "datafusion-common 37.0.0", - "datafusion-execution 37.0.0", - "datafusion-expr 37.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", "datafusion-functions-aggregate", - "datafusion-physical-expr-common", - "half 2.4.1", + "datafusion-physical-expr 38.0.0", "hashbrown 0.14.5", - "hex", "indexmap 2.2.6", "itertools 0.12.1", "log", - "paste", - "petgraph", - "regex", + "regex-syntax 0.8.3", ] [[package]] @@ -3031,19 +3006,9 @@ dependencies = [ ] [[package]] -name = "datafusion-physical-expr-common" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" -dependencies = [ - "arrow", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", -] - -[[package]] -name = "datafusion-physical-plan" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +name = "datafusion-physical-expr" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ "ahash 0.8.11", "arrow", @@ -3051,26 +3016,34 @@ dependencies = [ "arrow-buffer", "arrow-ord", "arrow-schema", - "async-trait", + "arrow-string", + "base64 0.22.1", "chrono", - "datafusion-common 37.0.0", - "datafusion-common-runtime 37.0.0", - "datafusion-execution 37.0.0", - "datafusion-expr 37.0.0", + "datafusion-common 38.0.0", + "datafusion-execution 38.0.0", + "datafusion-expr 38.0.0", "datafusion-functions-aggregate", - "datafusion-physical-expr 37.0.0", "datafusion-physical-expr-common", - "futures", "half 2.4.1", "hashbrown 0.14.5", + "hex", "indexmap 2.2.6", "itertools 0.12.1", "log", - "once_cell", - "parking_lot 0.12.2", - "pin-project-lite", + "paste", + "petgraph", + "regex", +] + +[[package]] +name = "datafusion-physical-expr-common" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +dependencies = [ + "arrow", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", "rand", - "tokio", ] [[package]] @@ -3098,25 +3071,43 @@ dependencies = [ "itertools 0.12.1", "log", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project-lite", "rand", "tokio", ] [[package]] -name = "datafusion-sql" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +name = "datafusion-physical-plan" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ + "ahash 0.8.11", "arrow", "arrow-array", + "arrow-buffer", + "arrow-ord", "arrow-schema", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", + "async-trait", + "chrono", + "datafusion-common 38.0.0", + "datafusion-common-runtime 38.0.0", + "datafusion-execution 38.0.0", + "datafusion-expr 38.0.0", + "datafusion-functions-aggregate", + "datafusion-physical-expr 38.0.0", + "datafusion-physical-expr-common", + "futures", + "half 2.4.1", + "hashbrown 0.14.5", + "indexmap 2.2.6", + "itertools 0.12.1", "log", - "sqlparser 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)", - "strum 0.26.2", + "once_cell", + "parking_lot 0.12.3", + "pin-project-lite", + "rand", + "tokio", ] [[package]] @@ -3131,23 +3122,39 @@ dependencies = [ "datafusion-common 37.1.0", "datafusion-expr 37.1.0", "log", - "sqlparser 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sqlparser 0.44.0", + "strum 0.26.2", +] + +[[package]] +name = "datafusion-sql" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" +dependencies = [ + "arrow", + "arrow-array", + "arrow-schema", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", + "log", + "regex", + "sqlparser 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", "strum 0.26.2", ] [[package]] name = "datafusion-substrait" -version = "37.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=34eda15b73a9e278af8844b30ed2f1c21c10359c#34eda15b73a9e278af8844b30ed2f1c21c10359c" +version = "38.0.0" +source = "git+https://github.com/apache/datafusion.git?rev=08e19f4956d32164be6fc66eb5a4c080eb0023d1#08e19f4956d32164be6fc66eb5a4c080eb0023d1" dependencies = [ "async-recursion", "chrono", - "datafusion 37.0.0", + "datafusion 38.0.0", "itertools 0.12.1", "object_store", - "prost 0.12.4", - "prost-types 0.12.4", - "substrait 0.30.0", + "prost 0.12.6", + "prost-types 0.12.6", + "substrait 0.34.0", ] [[package]] @@ -3178,9 +3185,9 @@ dependencies = [ "common-version", "common-wal", "dashmap", - "datafusion 37.0.0", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", + "datafusion 38.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", "datatypes", "file-engine", "futures", @@ -3193,17 +3200,17 @@ dependencies = [ "mito2", "object-store", "prometheus", - "prost 0.12.4", + "prost 0.12.6", "query", "reqwest", "serde", "servers", "session", - "snafu 0.8.2", + "snafu 0.8.3", "store-api", "table", "tokio", - "toml 0.8.12", + "toml 0.8.13", "tonic 0.11.0", ] @@ -3220,7 +3227,7 @@ dependencies = [ "common-macro", "common-telemetry", "common-time", - "datafusion-common 37.0.0", + "datafusion-common 38.0.0", "enum_dispatch", "num", "num-traits", @@ -3228,7 +3235,7 @@ dependencies = [ "paste", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", ] [[package]] @@ -3291,7 +3298,7 @@ checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3302,7 +3309,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3506,9 +3513,9 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "either" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "ena" @@ -3540,7 +3547,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3552,7 +3559,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3563,11 +3570,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" dependencies = [ "serde", + "typeid", ] [[package]] @@ -3596,7 +3604,7 @@ version = "0.12.4" source = "git+https://github.com/MichaelScofield/etcd-client.git?rev=4c371e9b3ea8e0a8ee2f9cbd7ded26e54a45df3b#4c371e9b3ea8e0a8ee2f9cbd7ded26e54a45df3b" dependencies = [ "http 0.2.12", - "prost 0.12.4", + "prost 0.12.6", "tokio", "tokio-stream", "tonic 0.11.0", @@ -3706,14 +3714,14 @@ dependencies = [ "common-telemetry", "common-test-util", "common-time", - "datafusion 37.0.0", - "datafusion-expr 37.0.0", + "datafusion 38.0.0", + "datafusion-expr 38.0.0", "datatypes", "futures", "object-store", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "store-api", "table", "tokio", @@ -3743,12 +3751,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "finl_unicode" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" - [[package]] name = "fixedbitset" version = "0.4.2" @@ -3811,8 +3813,8 @@ dependencies = [ "common-runtime", "common-telemetry", "common-time", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", "datatypes", "enum-as-inner", "enum_dispatch", @@ -3824,14 +3826,14 @@ dependencies = [ "nom", "num-traits", "pretty_assertions", - "prost 0.12.4", + "prost 0.12.6", "query", "serde", "serde_json", "servers", "session", "smallvec", - "snafu 0.8.2", + "snafu 0.8.3", "store-api", "strum 0.25.0", "substrait 0.8.1", @@ -3909,21 +3911,21 @@ dependencies = [ "operator", "partition", "prometheus", - "prost 0.12.4", + "prost 0.12.6", "query", "raft-engine", "script", "serde", "servers", "session", - "snafu 0.8.2", + "snafu 0.8.3", "sql", - "sqlparser 0.44.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=e4e496b8d62416ad50ce70a1b460c7313610cf5d)", + "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "store-api", "strfmt", "table", "tokio", - "toml 0.8.12", + "toml 0.8.13", "tonic 0.11.0", "tower", "uuid", @@ -3954,7 +3956,7 @@ checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e" dependencies = [ "frunk_proc_macro_helpers", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3966,7 +3968,7 @@ dependencies = [ "frunk_core", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -3978,7 +3980,7 @@ dependencies = [ "frunk_core", "frunk_proc_macro_helpers", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -4079,7 +4081,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -4190,7 +4192,7 @@ name = "greptime-proto" version = "0.1.0" source = "git+https://github.com/GreptimeTeam/greptime-proto.git?rev=ae26136accd82fbdf8be540cd502f2e94951077e#ae26136accd82fbdf8be540cd502f2e94951077e" dependencies = [ - "prost 0.12.4", + "prost 0.12.6", "serde", "serde_json", "strum 0.25.0", @@ -4484,7 +4486,7 @@ dependencies = [ "os_info", "serde", "serde_derive", - "toml 0.8.12", + "toml 0.8.13", "uuid", ] @@ -4545,7 +4547,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -4560,7 +4562,7 @@ dependencies = [ "rust-sitter", "rust-sitter-tool", "slotmap", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -4579,7 +4581,7 @@ dependencies = [ "serde", "serde_json", "slotmap", - "syn 2.0.61", + "syn 2.0.66", "webbrowser", ] @@ -4593,7 +4595,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -4769,11 +4771,11 @@ dependencies = [ "greptime-proto", "mockall", "pin-project", - "prost 0.12.4", + "prost 0.12.6", "rand", "regex", "regex-automata 0.4.6", - "snafu 0.8.2", + "snafu 0.8.3", "tempfile", "tokio", "tokio-util", @@ -4881,9 +4883,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", "js-sys", @@ -5205,9 +5207,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.154" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libfuzzer-sys" @@ -5281,9 +5283,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.16" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" dependencies = [ "cc", "libc", @@ -5299,9 +5301,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -5348,7 +5350,7 @@ dependencies = [ "rskafka", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "store-api", "tokio", "uuid", @@ -5478,9 +5480,9 @@ dependencies = [ [[package]] name = "mac_address" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa12182b93606fff55b70a5cfe6130eaf7407c2ea4f2c2bcc8b113b67c9928f" +checksum = "8836fae9d0d4be2c8b4efcdd79e828a2faa058a90d005abf42f91cac5493a08e" dependencies = [ "nix 0.28.0", "winapi", @@ -5633,7 +5635,7 @@ dependencies = [ "meta-srv", "rand", "serde", - "snafu 0.8.2", + "snafu 0.8.3", "tokio", "tokio-stream", "tonic 0.11.0", @@ -5677,21 +5679,21 @@ dependencies = [ "itertools 0.10.5", "lazy_static", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus", - "prost 0.12.4", + "prost 0.12.6", "rand", "regex", "serde", "serde_json", "servers", "session", - "snafu 0.8.2", + "snafu 0.8.3", "store-api", "table", "tokio", "tokio-stream", - "toml 0.8.12", + "toml 0.8.13", "tonic 0.11.0", "tower", "tracing", @@ -5707,7 +5709,7 @@ source = "git+https://github.com/GreptimeTeam/greptime-meter.git?rev=80b72716dcd dependencies = [ "anymap", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", ] [[package]] @@ -5733,7 +5735,7 @@ dependencies = [ "common-telemetry", "common-test-util", "common-time", - "datafusion 37.0.0", + "datafusion 38.0.0", "datatypes", "itertools 0.10.5", "lazy_static", @@ -5742,7 +5744,7 @@ dependencies = [ "object-store", "prometheus", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "store-api", "tokio", ] @@ -5771,9 +5773,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -5827,9 +5829,9 @@ dependencies = [ "crc32fast", "criterion", "crossbeam-utils", - "datafusion 37.0.0", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", + "datafusion 38.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", "datatypes", "futures", "humantime-serde", @@ -5844,7 +5846,7 @@ dependencies = [ "paste", "pin-project", "prometheus", - "prost 0.12.4", + "prost 0.12.6", "puffin", "rand", "regex", @@ -5852,14 +5854,14 @@ dependencies = [ "serde_json", "serde_with", "smallvec", - "snafu 0.8.2", + "snafu 0.8.3", "store-api", "strum 0.25.0", "table", "tokio", "tokio-stream", "tokio-util", - "toml 0.8.12", + "toml 0.8.13", "uuid", ] @@ -5904,7 +5906,7 @@ dependencies = [ "event-listener 5.3.0", "futures-util", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "quanta", "rustc_version", "smallvec", @@ -5947,14 +5949,14 @@ version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56b0d8a0db9bf6d2213e11f2c701cb91387b0614361625ab7b9743b41aa4938f" dependencies = [ - "darling 0.20.8", + "darling 0.20.9", "heck 0.4.1", "num-bigint", "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", "termcolor", "thiserror", ] @@ -5965,14 +5967,14 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afe0450cc9344afff34915f8328600ab5ae19260802a334d0f72d2d5bdda3bfe" dependencies = [ - "darling 0.20.8", + "darling 0.20.9", "heck 0.4.1", "num-bigint", "proc-macro-crate 3.1.0", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", "termcolor", "thiserror", ] @@ -6055,9 +6057,9 @@ dependencies = [ [[package]] name = "mysql_common" -version = "0.32.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ccdc1fe2bb3ef97e07ba4397327ed45509a1e2e499e2f8265243879cbc7313c" +checksum = "d1e52cf194ab414202ead9dfda216d2a9ec59cc97ac024ba499ca686d82f040d" dependencies = [ "base64 0.21.7", "bigdecimal", @@ -6301,7 +6303,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -6458,7 +6460,7 @@ dependencies = [ "futures", "humantime", "itertools 0.12.1", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "percent-encoding", "snafu 0.7.5", "tokio", @@ -6531,7 +6533,7 @@ dependencies = [ "async-trait", "byteorder", "chrono", - "mysql_common 0.32.2", + "mysql_common 0.32.3", "nom", "pin-project-lite", "tokio", @@ -6614,7 +6616,7 @@ checksum = "3a8fddc9b68f5b80dae9d6f510b88e02396f006ad48cac349411fbecc80caae4" dependencies = [ "opentelemetry 0.22.0", "opentelemetry_sdk 0.22.1", - "prost 0.12.4", + "prost 0.12.6", "tonic 0.11.0", ] @@ -6692,9 +6694,9 @@ dependencies = [ "common-telemetry", "common-test-util", "common-time", - "datafusion 37.0.0", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", + "datafusion 38.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", "datatypes", "file-engine", "futures", @@ -6713,9 +6715,9 @@ dependencies = [ "serde_json", "servers", "session", - "snafu 0.8.2", + "snafu 0.8.3", "sql", - "sqlparser 0.44.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=e4e496b8d62416ad50ce70a1b460c7313610cf5d)", + "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "store-api", "substrait 0.8.1", "table", @@ -6878,9 +6880,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core 0.9.10", @@ -6970,15 +6972,15 @@ dependencies = [ "common-macro", "common-meta", "common-query", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", "datatypes", "itertools 0.10.5", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "sql", - "sqlparser 0.44.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=e4e496b8d62416ad50ce70a1b460c7313610cf5d)", + "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "store-api", "table", ] @@ -7082,7 +7084,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -7197,7 +7199,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -7280,9 +7282,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plotters" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" dependencies = [ "num-traits", "plotters-backend", @@ -7293,15 +7295,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" +checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" [[package]] name = "plotters-svg" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" dependencies = [ "plotters-backend", ] @@ -7315,7 +7317,7 @@ dependencies = [ "datanode", "frontend", "meta-srv", - "snafu 0.8.2", + "snafu 0.8.3", ] [[package]] @@ -7386,10 +7388,10 @@ dependencies = [ "log", "nix 0.26.4", "once_cell", - "parking_lot 0.12.2", - "prost 0.12.4", - "prost-build 0.12.4", - "prost-derive 0.12.5", + "parking_lot 0.12.3", + "prost 0.12.6", + "prost-build 0.12.6", + "prost-derive 0.12.6", "protobuf", "sha2", "smallvec", @@ -7477,7 +7479,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -7525,9 +7527,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] @@ -7566,7 +7568,7 @@ dependencies = [ "lazy_static", "libc", "memchr", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "procfs", "protobuf", "thiserror", @@ -7595,18 +7597,18 @@ dependencies = [ "common-macro", "common-recordbatch", "common-telemetry", - "datafusion 37.0.0", - "datafusion-expr 37.0.0", + "datafusion 38.0.0", + "datafusion-expr 38.0.0", "datatypes", "futures", "greptime-proto", "lazy_static", "prometheus", "promql-parser", - "prost 0.12.4", + "prost 0.12.6", "query", "session", - "snafu 0.8.2", + "snafu 0.8.3", "tokio", ] @@ -7635,12 +7637,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.5", + "prost-derive 0.12.6", ] [[package]] @@ -7667,9 +7669,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80b776a1b2dc779f5ee0641f8ade0125bc1298dd41a9a0c16d8bd57b42d222b1" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", "heck 0.5.0", @@ -7679,10 +7681,10 @@ dependencies = [ "once_cell", "petgraph", "prettyplease 0.2.20", - "prost 0.12.4", - "prost-types 0.12.4", + "prost 0.12.6", + "prost-types 0.12.6", "regex", - "syn 2.0.61", + "syn 2.0.66", "tempfile", ] @@ -7701,15 +7703,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -7723,11 +7725,11 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.12.4", + "prost 0.12.6", ] [[package]] @@ -7803,7 +7805,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "tokio", "tokio-util", ] @@ -7833,7 +7835,7 @@ dependencies = [ "indoc", "libc", "memoffset 0.9.1", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "portable-atomic", "pyo3-build-config", "pyo3-ffi", @@ -7870,7 +7872,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -7883,7 +7885,7 @@ dependencies = [ "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -7930,13 +7932,13 @@ dependencies = [ "common-runtime", "common-telemetry", "common-time", - "datafusion 37.0.0", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", - "datafusion-functions 37.0.0", - "datafusion-optimizer 37.0.0", - "datafusion-physical-expr 37.0.0", - "datafusion-sql 37.0.0", + "datafusion 38.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", + "datafusion-functions 38.0.0", + "datafusion-optimizer 38.0.0", + "datafusion-physical-expr 38.0.0", + "datafusion-sql 38.0.0", "datatypes", "format_num", "futures", @@ -7955,12 +7957,13 @@ dependencies = [ "prometheus", "promql", "promql-parser", - "prost 0.12.4", + "prost 0.12.6", "rand", "regex", "session", - "snafu 0.8.2", + "snafu 0.8.3", "sql", + "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "statrs", "stats-cli", "store-api", @@ -8036,7 +8039,7 @@ dependencies = [ "nix 0.26.4", "num-derive", "num-traits", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus", "prometheus-static-metric", "protobuf", @@ -8186,7 +8189,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -8245,9 +8248,9 @@ dependencies = [ [[package]] name = "regress" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5f39ba4513916c1b2657b72af6ec671f091cd637992f58d0ede5cae4e5dea0" +checksum = "0eae2a1ebfecc58aff952ef8ccd364329abe627762f5bf09ff42eb9d98522479" dependencies = [ "hashbrown 0.14.5", "memchr", @@ -8507,7 +8510,7 @@ dependencies = [ "futures", "integer-encoding 4.0.0", "lz4", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project-lite", "rand", "snap", @@ -8575,7 +8578,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.61", + "syn 2.0.66", "walkdir", ] @@ -8742,7 +8745,7 @@ dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.3", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] @@ -8797,9 +8800,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.3" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -8988,7 +8991,7 @@ dependencies = [ "num_enum", "once_cell", "page_size", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "paste", "puruspe", "rand", @@ -9054,7 +9057,7 @@ dependencies = [ "num_enum", "once_cell", "optional", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "paste", "rand", "result-like", @@ -9091,9 +9094,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "rustyline" @@ -9244,9 +9247,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.19" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6e7ed6919cb46507fb01ff1654309219f62b4d603822501b0b80d42f6f21ef" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", "indexmap 1.9.3", @@ -9257,14 +9260,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.19" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185f2b7aa7e02d418e453790dde16890256bbd2bcd04b7dc5348811052b53f49" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -9295,11 +9298,11 @@ dependencies = [ "console", "criterion", "crossbeam-utils", - "datafusion 37.0.0", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", - "datafusion-functions 37.0.0", - "datafusion-physical-expr 37.0.0", + "datafusion 38.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", + "datafusion-functions 38.0.0", + "datafusion-physical-expr 38.0.0", "datatypes", "futures", "lazy_static", @@ -9322,7 +9325,7 @@ dependencies = [ "serde", "servers", "session", - "snafu 0.8.2", + "snafu 0.8.3", "sql", "table", "tokio", @@ -9365,7 +9368,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -9396,6 +9399,9 @@ name = "semver" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +dependencies = [ + "serde", +] [[package]] name = "seq-macro" @@ -9405,33 +9411,33 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.201" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.201" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] name = "serde_derive_internals" -version = "0.29.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -9464,14 +9470,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -9485,7 +9491,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -9524,10 +9530,10 @@ version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ - "darling 0.20.8", + "darling 0.20.9", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -9580,8 +9586,8 @@ dependencies = [ "common-version", "criterion", "dashmap", - "datafusion 37.0.0", - "datafusion-common 37.0.0", + "datafusion 38.0.0", + "datafusion-common 38.0.0", "datatypes", "derive_builder 0.12.0", "futures", @@ -9603,7 +9609,7 @@ dependencies = [ "openmetrics-parser", "opensrv-mysql", "opentelemetry-proto 0.5.0", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "permutation", "pgwire", "pin-project", @@ -9611,7 +9617,7 @@ dependencies = [ "pprof", "prometheus", "promql-parser", - "prost 0.12.4", + "prost 0.12.6", "query", "rand", "regex", @@ -9625,7 +9631,7 @@ dependencies = [ "serde", "serde_json", "session", - "snafu 0.8.2", + "snafu 0.8.3", "snap", "sql", "strum 0.25.0", @@ -9659,7 +9665,7 @@ dependencies = [ "common-telemetry", "common-time", "derive_builder 0.12.0", - "snafu 0.8.2", + "snafu 0.8.3", "sql", ] @@ -9823,11 +9829,11 @@ dependencies = [ [[package]] name = "snafu" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75976f4748ab44f6e5332102be424e7c2dc18daeaf7e725f2040c3ebb133512e" +checksum = "418b8136fec49956eba89be7da2847ec1909df92a9ae4178b5ff0ff092c8d95e" dependencies = [ - "snafu-derive 0.8.2", + "snafu-derive 0.8.3", ] [[package]] @@ -9844,14 +9850,14 @@ dependencies = [ [[package]] name = "snafu-derive" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b19911debfb8c2fb1107bc6cb2d61868aaf53a988449213959bb1b5b1ed95f" +checksum = "1a4812a669da00d17d8266a0439eddcacbc88b17f732f927e52eeb9d196f7fb5" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -9938,18 +9944,18 @@ dependencies = [ "common-macro", "common-query", "common-time", - "datafusion 37.0.0", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", - "datafusion-physical-expr 37.0.0", - "datafusion-sql 37.0.0", + "datafusion 38.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", + "datafusion-physical-expr 38.0.0", + "datafusion-sql 38.0.0", "datatypes", "hex", "itertools 0.10.5", "lazy_static", "regex", - "snafu 0.8.2", - "sqlparser 0.44.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=e4e496b8d62416ad50ce70a1b460c7313610cf5d)", + "snafu 0.8.3", + "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "sqlparser_derive 0.1.1", "table", ] @@ -10011,14 +10017,24 @@ dependencies = [ [[package]] name = "sqlparser" -version = "0.44.0" -source = "git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=e4e496b8d62416ad50ce70a1b460c7313610cf5d#e4e496b8d62416ad50ce70a1b460c7313610cf5d" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7bbffee862a796d67959a89859d6b1046bb5016d63e23835ad0da182777bbe0" +dependencies = [ + "log", + "sqlparser_derive 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sqlparser" +version = "0.45.0" +source = "git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7#54a267ac89c09b11c0c88934690530807185d3e7" dependencies = [ "lazy_static", "log", "regex", - "sqlparser 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sqlparser_derive 0.2.2 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=e4e496b8d62416ad50ce70a1b460c7313610cf5d)", + "sqlparser 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sqlparser_derive 0.2.2 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", ] [[package]] @@ -10040,17 +10056,17 @@ checksum = "01b2e185515564f15375f593fb966b5718bc624ba77fe49fa4616ad619690554" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] name = "sqlparser_derive" version = "0.2.2" -source = "git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=e4e496b8d62416ad50ce70a1b460c7313610cf5d#e4e496b8d62416ad50ce70a1b460c7313610cf5d" +source = "git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7#54a267ac89c09b11c0c88934690530807185d3e7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -10211,14 +10227,14 @@ dependencies = [ "common-query", "common-recordbatch", "common-wal", - "datafusion-expr 37.0.0", - "datafusion-physical-plan 37.0.0", + "datafusion-expr 38.0.0", + "datafusion-physical-plan 38.0.0", "datatypes", "derive_builder 0.12.0", "futures", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "strum 0.25.0", "tokio", ] @@ -10258,20 +10274,20 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "phf_shared 0.10.0", "precomputed-hash", ] [[package]] name = "stringprep" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ - "finl_unicode", "unicode-bidi", "unicode-normalization", + "unicode-properties", ] [[package]] @@ -10339,7 +10355,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -10352,7 +10368,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -10374,14 +10390,14 @@ dependencies = [ "common-error", "common-macro", "common-telemetry", - "datafusion 37.0.0", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", + "datafusion 38.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", "datafusion-substrait", "datatypes", "promql", - "prost 0.12.4", - "snafu 0.8.2", + "prost 0.12.6", + "snafu 0.8.3", "substrait 0.17.1", "tokio", ] @@ -10395,37 +10411,37 @@ dependencies = [ "git2", "heck 0.4.1", "prettyplease 0.2.20", - "prost 0.12.4", - "prost-build 0.12.4", - "prost-types 0.12.4", + "prost 0.12.6", + "prost-build 0.12.6", + "prost-types 0.12.6", "schemars", "semver", "serde", "serde_json", "serde_yaml", - "syn 2.0.61", + "syn 2.0.66", "typify 0.0.14", "walkdir", ] [[package]] name = "substrait" -version = "0.30.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba959c71b2a1a341a94e1f362615d7e5f1a4de9d25d82fceea8160f79f1e1dfb" +checksum = "2c7ccf682a18309d9039bc16e14d9c7ea3a461e65dfc46e2b611b401b945ef2d" dependencies = [ "heck 0.5.0", "prettyplease 0.2.20", - "prost 0.12.4", - "prost-build 0.12.4", - "prost-types 0.12.4", + "prost 0.12.6", + "prost-build 0.12.6", + "prost-types 0.12.6", "schemars", "semver", "serde", "serde_json", "serde_yaml", - "syn 2.0.61", - "typify 0.0.16", + "syn 2.0.66", + "typify 0.1.0", "walkdir", ] @@ -10471,9 +10487,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.61" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -10508,7 +10524,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -10570,10 +10586,10 @@ dependencies = [ "common-telemetry", "common-test-util", "common-time", - "datafusion 37.0.0", - "datafusion-common 37.0.0", - "datafusion-expr 37.0.0", - "datafusion-physical-expr 37.0.0", + "datafusion 38.0.0", + "datafusion-common 38.0.0", + "datafusion-expr 38.0.0", + "datafusion-physical-expr 38.0.0", "datatypes", "derive_builder 0.12.0", "futures", @@ -10584,7 +10600,7 @@ dependencies = [ "paste", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "store-api", "tokio", "tokio-util", @@ -10614,7 +10630,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96374855068f47402c3121c6eed88d29cb1de8f3ab27090e273e420bdabcf050" dependencies = [ - "parking_lot 0.12.2", + "parking_lot 0.12.3", ] [[package]] @@ -10689,9 +10705,9 @@ dependencies = [ "reqwest", "serde", "serde_json", - "snafu 0.8.2", + "snafu 0.8.3", "sql", - "sqlparser 0.44.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=e4e496b8d62416ad50ce70a1b460c7313610cf5d)", + "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "sqlx", "tinytemplate", "tokio", @@ -10726,8 +10742,8 @@ dependencies = [ "common-telemetry", "common-test-util", "common-wal", - "datafusion 37.0.0", - "datafusion-expr 37.0.0", + "datafusion 38.0.0", + "datafusion-expr 38.0.0", "datanode", "datatypes", "dotenv", @@ -10745,7 +10761,7 @@ dependencies = [ "operator", "partition", "paste", - "prost 0.12.4", + "prost 0.12.6", "query", "rand", "rstest", @@ -10754,7 +10770,7 @@ dependencies = [ "serde_json", "servers", "session", - "snafu 0.8.2", + "snafu 0.8.3", "sql", "sqlx", "store-api", @@ -10794,22 +10810,22 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -10970,7 +10986,7 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", "socket2 0.5.7", @@ -10997,7 +11013,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -11019,7 +11035,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d767da47381602cc481653456823b3ebb600e83d5dd4e0293da9b5566c6c00f0" dependencies = [ "lazy_static", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus", "tokio", "tokio-metrics", @@ -11038,7 +11054,7 @@ dependencies = [ "futures-channel", "futures-util", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "percent-encoding", "phf", "pin-project-lite", @@ -11148,21 +11164,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.12", + "toml_edit 0.22.13", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] @@ -11191,9 +11207,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ "indexmap 2.2.6", "serde", @@ -11249,7 +11265,7 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost 0.12.4", + "prost 0.12.6", "rustls-pemfile 2.1.2", "rustls-pki-types", "tokio", @@ -11283,9 +11299,9 @@ checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" dependencies = [ "prettyplease 0.2.20", "proc-macro2", - "prost-build 0.12.4", + "prost-build 0.12.6", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -11296,9 +11312,9 @@ checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" dependencies = [ "prettyplease 0.2.20", "proc-macro2", - "prost-build 0.12.4", + "prost-build 0.12.6", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -11307,8 +11323,8 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "548c227bd5c0fae5925812c4ec6c66ffcfced23ea370cb823f4d18f0fc1cb6a7" dependencies = [ - "prost 0.12.4", - "prost-types 0.12.4", + "prost 0.12.6", + "prost-types 0.12.6", "tokio", "tokio-stream", "tonic 0.11.0", @@ -11409,7 +11425,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -11620,6 +11636,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "typeid" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "059d83cc991e7a42fc37bd50941885db0888e34209f8cfd9aab07ddec03bc9cf" + [[package]] name = "typenum" version = "1.17.0" @@ -11647,7 +11669,7 @@ checksum = "ac73887f47b9312552aa90ef477927ff014d63d1920ca8037c6c1951eab64bb1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -11662,12 +11684,12 @@ dependencies = [ [[package]] name = "typify" -version = "0.0.16" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c61e9db210bbff218e6535c664b37ec47da449169b98e7866d0580d0db75529" +checksum = "adb6beec125971dda80a086f90b4a70f60f222990ce4d63ad0fc140492f53444" dependencies = [ - "typify-impl 0.0.16", - "typify-macro 0.0.16", + "typify-impl 0.1.0", + "typify-macro 0.1.0", ] [[package]] @@ -11683,25 +11705,27 @@ dependencies = [ "regress 0.7.1", "schemars", "serde_json", - "syn 2.0.61", + "syn 2.0.66", "thiserror", "unicode-ident", ] [[package]] name = "typify-impl" -version = "0.0.16" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95e32f38493804f88e2dc7a5412eccd872ea5452b4db9b0a77de4df180f2a87e" +checksum = "93bbb24e990654aff858d80fee8114f4322f7d7a1b1ecb45129e2fcb0d0ad5ae" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "log", "proc-macro2", "quote", - "regress 0.8.0", + "regress 0.9.1", "schemars", + "semver", + "serde", "serde_json", - "syn 2.0.61", + "syn 2.0.66", "thiserror", "unicode-ident", ] @@ -11718,24 +11742,25 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream", - "syn 2.0.61", + "syn 2.0.66", "typify-impl 0.0.14", ] [[package]] name = "typify-macro" -version = "0.0.16" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc09508b72f63d521d68e42c7f172c7416d67986df44b3c7d1f7f9963948ed32" +checksum = "f8e6491896e955692d68361c68db2b263e3bec317ec0b684e0e2fa882fb6e31e" dependencies = [ "proc-macro2", "quote", "schemars", + "semver", "serde", "serde_json", "serde_tokenstream", - "syn 2.0.61", - "typify-impl 0.0.16", + "syn 2.0.66", + "typify-impl 0.1.0", ] [[package]] @@ -11911,6 +11936,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" + [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -12017,7 +12048,7 @@ checksum = "9881bea7cbe687e36c9ab3b778c36cd0487402e270304e8b1296d5085303c1a2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] @@ -12132,7 +12163,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -12166,7 +12197,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -12296,9 +12327,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.17" +version = "0.7.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0e39d2c603fdc0504b12b458cf1f34e0b937ed2f4f2dc20796e3e86f34e11f" +checksum = "cd8dc749a1b03f3c255a3064a4f5c0ee5ed09b7c6bc6d4525d31f779cd74d7fc" dependencies = [ "bytemuck", "safe_arch", @@ -12720,14 +12751,14 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -12740,7 +12771,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.66", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 734d2438b0..01e17e5a8c 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/arrow-datafusion.git", rev = "34eda15b73a9e278af8844b30ed2f1c21c10359c" } -datafusion-common = { git = "https://github.com/apache/arrow-datafusion.git", rev = "34eda15b73a9e278af8844b30ed2f1c21c10359c" } -datafusion-expr = { git = "https://github.com/apache/arrow-datafusion.git", rev = "34eda15b73a9e278af8844b30ed2f1c21c10359c" } -datafusion-functions = { git = "https://github.com/apache/arrow-datafusion.git", rev = "34eda15b73a9e278af8844b30ed2f1c21c10359c" } -datafusion-optimizer = { git = "https://github.com/apache/arrow-datafusion.git", rev = "34eda15b73a9e278af8844b30ed2f1c21c10359c" } -datafusion-physical-expr = { git = "https://github.com/apache/arrow-datafusion.git", rev = "34eda15b73a9e278af8844b30ed2f1c21c10359c" } -datafusion-physical-plan = { git = "https://github.com/apache/arrow-datafusion.git", rev = "34eda15b73a9e278af8844b30ed2f1c21c10359c" } -datafusion-sql = { git = "https://github.com/apache/arrow-datafusion.git", rev = "34eda15b73a9e278af8844b30ed2f1c21c10359c" } -datafusion-substrait = { git = "https://github.com/apache/arrow-datafusion.git", rev = "34eda15b73a9e278af8844b30ed2f1c21c10359c" } +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" } derive_builder = "0.12" dotenv = "0.15" # TODO(LFC): Wait for https://github.com/etcdv3/etcd-client/pull/76 @@ -162,7 +162,7 @@ smallvec = { version = "1", features = ["serde"] } snafu = "0.8" sysinfo = "0.30" # on branch v0.44.x -sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "e4e496b8d62416ad50ce70a1b460c7313610cf5d", features = [ +sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "54a267ac89c09b11c0c88934690530807185d3e7", features = [ "visitor", ] } strum = { version = "0.25", features = ["derive"] } diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index dc5bf8ba97..1ce91acaf7 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -12,7 +12,6 @@ api.workspace = true arrow.workspace = true chrono.workspace = true clap.workspace = true -client = { workspace = true, features = ["testing"] } common-base.workspace = true common-telemetry.workspace = true common-wal.workspace = true diff --git a/src/common/query/src/logical_plan/udaf.rs b/src/common/query/src/logical_plan/udaf.rs index f2abcb673b..298dbf1874 100644 --- a/src/common/query/src/logical_plan/udaf.rs +++ b/src/common/query/src/logical_plan/udaf.rs @@ -22,7 +22,7 @@ use std::sync::Arc; use datafusion::arrow::datatypes::Field; use datafusion_common::Result; -use datafusion_expr::function::AccumulatorArgs; +use datafusion_expr::function::{AccumulatorArgs, StateFieldsArgs}; use datafusion_expr::{ Accumulator, AccumulatorFactoryFunction, AggregateUDF as DfAggregateUdf, AggregateUDFImpl, }; @@ -129,13 +129,13 @@ impl AggregateUDFImpl for DfUdafAdapter { (self.accumulator)(acc_args) } - fn state_fields(&self, name: &str, _: ArrowDataType, _: Vec) -> Result> { + fn state_fields(&self, args: StateFieldsArgs) -> Result> { let state_types = self.creator.state_types()?; let fields = state_types .into_iter() .enumerate() .map(|(i, t)| { - let name = format!("{name}_{i}"); + let name = format!("{}_{i}", args.name); Field::new(name, t.as_arrow_type(), true) }) .collect::>(); diff --git a/src/common/query/src/logical_plan/udf.rs b/src/common/query/src/logical_plan/udf.rs index 79714479c3..276f753e77 100644 --- a/src/common/query/src/logical_plan/udf.rs +++ b/src/common/query/src/logical_plan/udf.rs @@ -108,6 +108,10 @@ impl ScalarUDFImpl for DfUdfAdapter { fn invoke(&self, args: &[DfColumnarValue]) -> datafusion_common::Result { (self.fun)(args) } + + fn invoke_no_args(&self, number_rows: usize) -> datafusion_common::Result { + Ok((self.fun)(&[])?.into_array(number_rows)?.into()) + } } impl From for DfScalarUDF { diff --git a/src/common/query/src/signature.rs b/src/common/query/src/signature.rs index a234990bf6..13eaf49e2b 100644 --- a/src/common/query/src/signature.rs +++ b/src/common/query/src/signature.rs @@ -27,10 +27,6 @@ pub enum TypeSignature { /// arbitrary number of arguments of an common type out of a list of valid types // A function such as `concat` is `Variadic(vec![ConcreteDataType::String, ConcreteDataType::String])` Variadic(Vec), - /// arbitrary number of arguments of an arbitrary but equal type - // A function such as `array` is `VariadicEqual` - // The first argument decides the type used for coercion - VariadicEqual, /// One or more arguments with arbitrary types VariadicAny, /// fixed number of arguments of an arbitrary but equal type out of a list of valid types @@ -67,6 +63,7 @@ impl Signature { volatility, } } + /// variadic - Creates a variadic signature that represents an arbitrary number of arguments all from a type in common_types. pub fn variadic(common_types: Vec, volatility: Volatility) -> Self { Self { @@ -74,13 +71,6 @@ impl Signature { volatility, } } - /// variadic_equal - Creates a variadic signature that represents an arbitrary number of arguments of the same type. - pub fn variadic_equal(volatility: Volatility) -> Self { - Self { - type_signature: TypeSignature::VariadicEqual, - volatility, - } - } /// variadic_any - Creates a variadic signature that represents an arbitrary number of arguments of any type. pub fn variadic_any(volatility: Volatility) -> Self { @@ -131,7 +121,6 @@ impl From for DfTypeSignature { TypeSignature::Variadic(types) => { DfTypeSignature::Variadic(concrete_types_to_arrow_types(types)) } - TypeSignature::VariadicEqual => DfTypeSignature::VariadicEqual, TypeSignature::Uniform(n, types) => { DfTypeSignature::Uniform(n, concrete_types_to_arrow_types(types)) } diff --git a/src/common/recordbatch/src/adapter.rs b/src/common/recordbatch/src/adapter.rs index 35d32e2084..0af2c8ac33 100644 --- a/src/common/recordbatch/src/adapter.rs +++ b/src/common/recordbatch/src/adapter.rs @@ -292,7 +292,7 @@ impl ExecutionPlanVisitor for MetricCollector { // skip if no metric available let Some(metric) = plan.metrics() else { self.record_batch_metrics.plan_metrics.push(PlanMetrics { - plan: plan.name().to_string(), + plan: std::any::type_name::().to_string(), level: self.current_level, metrics: vec![], }); diff --git a/src/frontend/src/instance/prom_store.rs b/src/frontend/src/instance/prom_store.rs index 5055d5ac22..97ddd238a5 100644 --- a/src/frontend/src/instance/prom_store.rs +++ b/src/frontend/src/instance/prom_store.rs @@ -218,7 +218,7 @@ impl PromStoreProtocolHandler for Instance { let plan = output.meta.plan.clone(); query_results.push(to_query_result(&table_name, output).await?); if let Some(ref plan) = plan { - collect_plan_metrics(plan.clone(), &mut [&mut map]); + collect_plan_metrics(plan, &mut [&mut map]); } } diff --git a/src/operator/src/expr_factory.rs b/src/operator/src/expr_factory.rs index 8f9aab097f..9f3d2b1c40 100644 --- a/src/operator/src/expr_factory.rs +++ b/src/operator/src/expr_factory.rs @@ -322,11 +322,8 @@ fn find_primary_keys( let constraints_pk = constraints .iter() .filter_map(|constraint| match constraint { - TableConstraint::Unique { - name: _, - columns, - is_primary: true, - .. + TableConstraint::PrimaryKey { + name: _, columns, .. } => Some(columns.iter().map(|ident| ident.value.clone())), _ => None, }) @@ -353,7 +350,6 @@ pub fn find_time_index(constraints: &[TableConstraint]) -> Result { TableConstraint::Unique { name: Some(name), columns, - is_primary: false, .. } => { if name.value == TIME_INDEX { diff --git a/src/promql/src/extension_plan/empty_metric.rs b/src/promql/src/extension_plan/empty_metric.rs index f26337b2f6..302510e632 100644 --- a/src/promql/src/extension_plan/empty_metric.rs +++ b/src/promql/src/extension_plan/empty_metric.rs @@ -156,19 +156,19 @@ impl UserDefinedLogicalNodeCore for EmptyMetric { ) } - fn from_template(&self, expr: &[Expr], _inputs: &[LogicalPlan]) -> Self { - Self { + fn with_exprs_and_inputs( + &self, + exprs: Vec, + _inputs: Vec, + ) -> DataFusionResult { + Ok(Self { start: self.start, end: self.end, interval: self.interval, - expr: if !expr.is_empty() { - Some(expr[0].clone()) - } else { - None - }, + expr: exprs.into_iter().next(), time_index_schema: self.time_index_schema.clone(), result_schema: self.result_schema.clone(), - } + }) } } @@ -204,7 +204,7 @@ impl ExecutionPlan for EmptyMetricExec { vec![] } - fn children(&self) -> Vec> { + fn children(&self) -> Vec<&Arc> { vec![] } diff --git a/src/promql/src/extension_plan/histogram_fold.rs b/src/promql/src/extension_plan/histogram_fold.rs index 13315a22a0..561fbe7720 100644 --- a/src/promql/src/extension_plan/histogram_fold.rs +++ b/src/promql/src/extension_plan/histogram_fold.rs @@ -95,17 +95,21 @@ impl UserDefinedLogicalNodeCore for HistogramFold { ) } - fn from_template(&self, _exprs: &[Expr], inputs: &[LogicalPlan]) -> Self { - Self { + fn with_exprs_and_inputs( + &self, + _exprs: Vec, + inputs: Vec, + ) -> DataFusionResult { + Ok(Self { le_column: self.le_column.clone(), ts_column: self.ts_column.clone(), - input: inputs[0].clone(), + input: inputs.into_iter().next().unwrap(), field_column: self.field_column.clone(), quantile: self.quantile, // This method cannot return error. Otherwise we should re-calculate // the output schema output_schema: self.output_schema.clone(), - } + }) } } @@ -279,8 +283,8 @@ impl ExecutionPlan for HistogramFoldExec { vec![true; self.children().len()] } - fn children(&self) -> Vec> { - vec![self.input.clone()] + fn children(&self) -> Vec<&Arc> { + vec![&self.input] } // cannot change schema with this method diff --git a/src/promql/src/extension_plan/instant_manipulate.rs b/src/promql/src/extension_plan/instant_manipulate.rs index 6591f6db06..1ab01f04aa 100644 --- a/src/promql/src/extension_plan/instant_manipulate.rs +++ b/src/promql/src/extension_plan/instant_manipulate.rs @@ -83,18 +83,26 @@ impl UserDefinedLogicalNodeCore for InstantManipulate { ) } - fn from_template(&self, _exprs: &[Expr], inputs: &[LogicalPlan]) -> Self { - assert!(!inputs.is_empty()); + fn with_exprs_and_inputs( + &self, + _exprs: Vec, + inputs: Vec, + ) -> DataFusionResult { + if inputs.is_empty() { + return Err(DataFusionError::Internal( + "InstantManipulate should have at least one input".to_string(), + )); + } - Self { + Ok(Self { start: self.start, end: self.end, lookback_delta: self.lookback_delta, interval: self.interval, time_index_column: self.time_index_column.clone(), field_column: self.field_column.clone(), - input: inputs[0].clone(), - } + input: inputs.into_iter().next().unwrap(), + }) } } @@ -207,8 +215,8 @@ impl ExecutionPlan for InstantManipulateExec { vec![false; self.children().len()] } - fn children(&self) -> Vec> { - vec![self.input.clone()] + fn children(&self) -> Vec<&Arc> { + vec![&self.input] } fn with_new_children( diff --git a/src/promql/src/extension_plan/normalize.rs b/src/promql/src/extension_plan/normalize.rs index 70ca8da660..5abaad427c 100644 --- a/src/promql/src/extension_plan/normalize.rs +++ b/src/promql/src/extension_plan/normalize.rs @@ -81,15 +81,23 @@ impl UserDefinedLogicalNodeCore for SeriesNormalize { ) } - fn from_template(&self, _exprs: &[Expr], inputs: &[LogicalPlan]) -> Self { - assert!(!inputs.is_empty()); + fn with_exprs_and_inputs( + &self, + _exprs: Vec, + inputs: Vec, + ) -> DataFusionResult { + if inputs.is_empty() { + return Err(DataFusionError::Internal( + "SeriesNormalize should have at least one input".to_string(), + )); + } - Self { + Ok(Self { offset: self.offset, time_index_column_name: self.time_index_column_name.clone(), need_filter_out_nan: self.need_filter_out_nan, - input: inputs[0].clone(), - } + input: inputs.into_iter().next().unwrap(), + }) } } @@ -173,8 +181,8 @@ impl ExecutionPlan for SeriesNormalizeExec { self.input.properties() } - fn children(&self) -> Vec> { - vec![self.input.clone()] + fn children(&self) -> Vec<&Arc> { + vec![&self.input] } fn with_new_children( diff --git a/src/promql/src/extension_plan/range_manipulate.rs b/src/promql/src/extension_plan/range_manipulate.rs index 6f644f308b..973fa5a38e 100644 --- a/src/promql/src/extension_plan/range_manipulate.rs +++ b/src/promql/src/extension_plan/range_manipulate.rs @@ -231,19 +231,27 @@ impl UserDefinedLogicalNodeCore for RangeManipulate { ) } - fn from_template(&self, _exprs: &[Expr], inputs: &[LogicalPlan]) -> Self { - assert!(!inputs.is_empty()); + fn with_exprs_and_inputs( + &self, + _exprs: Vec, + inputs: Vec, + ) -> DataFusionResult { + if inputs.is_empty() { + return Err(DataFusionError::Internal( + "RangeManipulate should have at least one input".to_string(), + )); + } - Self { + Ok(Self { start: self.start, end: self.end, interval: self.interval, range: self.range, time_index: self.time_index.clone(), field_columns: self.field_columns.clone(), - input: inputs[0].clone(), + input: inputs.into_iter().next().unwrap(), output_schema: self.output_schema.clone(), - } + }) } } @@ -280,8 +288,8 @@ impl ExecutionPlan for RangeManipulateExec { vec![true; self.children().len()] } - fn children(&self) -> Vec> { - vec![self.input.clone()] + fn children(&self) -> Vec<&Arc> { + vec![&self.input] } fn required_input_distribution(&self) -> Vec { diff --git a/src/promql/src/extension_plan/scalar_calculate.rs b/src/promql/src/extension_plan/scalar_calculate.rs index c2abd3f639..6383631c30 100644 --- a/src/promql/src/extension_plan/scalar_calculate.rs +++ b/src/promql/src/extension_plan/scalar_calculate.rs @@ -215,18 +215,26 @@ impl UserDefinedLogicalNodeCore for ScalarCalculate { write!(f, "ScalarCalculate: tags={:?}", self.tag_columns) } - fn from_template(&self, _expr: &[Expr], inputs: &[LogicalPlan]) -> Self { - assert!(!inputs.is_empty()); - ScalarCalculate { + fn with_exprs_and_inputs( + &self, + exprs: Vec, + inputs: Vec, + ) -> DataFusionResult { + if !exprs.is_empty() { + return Err(DataFusionError::Internal( + "ScalarCalculate should not have any expressions".to_string(), + )); + } + Ok(ScalarCalculate { start: self.start, end: self.end, interval: self.interval, time_index: self.time_index.clone(), tag_columns: self.tag_columns.clone(), field_column: self.field_column.clone(), - input: inputs[0].clone(), + input: inputs.into_iter().next().unwrap(), output_schema: self.output_schema.clone(), - } + }) } } @@ -264,8 +272,8 @@ impl ExecutionPlan for ScalarCalculateExec { vec![Distribution::SinglePartition] } - fn children(&self) -> Vec> { - vec![self.input.clone()] + fn children(&self) -> Vec<&Arc> { + vec![&self.input] } fn with_new_children( diff --git a/src/promql/src/extension_plan/series_divide.rs b/src/promql/src/extension_plan/series_divide.rs index d0524b5d53..6dc531a8cb 100644 --- a/src/promql/src/extension_plan/series_divide.rs +++ b/src/promql/src/extension_plan/series_divide.rs @@ -67,13 +67,21 @@ impl UserDefinedLogicalNodeCore for SeriesDivide { write!(f, "PromSeriesDivide: tags={:?}", self.tag_columns) } - fn from_template(&self, _exprs: &[Expr], inputs: &[LogicalPlan]) -> Self { - assert!(!inputs.is_empty()); + fn with_exprs_and_inputs( + &self, + _exprs: Vec, + inputs: Vec, + ) -> DataFusionResult { + if inputs.is_empty() { + return Err(datafusion::error::DataFusionError::Internal( + "SeriesDivide must have at least one input".to_string(), + )); + } - Self { + Ok(Self { tag_columns: self.tag_columns.clone(), input: inputs[0].clone(), - } + }) } } @@ -160,8 +168,8 @@ impl ExecutionPlan for SeriesDivideExec { vec![true; self.children().len()] } - fn children(&self) -> Vec> { - vec![self.input.clone()] + fn children(&self) -> Vec<&Arc> { + vec![&self.input] } fn with_new_children( diff --git a/src/promql/src/extension_plan/union_distinct_on.rs b/src/promql/src/extension_plan/union_distinct_on.rs index 78a2cc913d..2da0fd54fa 100644 --- a/src/promql/src/extension_plan/union_distinct_on.rs +++ b/src/promql/src/extension_plan/union_distinct_on.rs @@ -135,18 +135,28 @@ impl UserDefinedLogicalNodeCore for UnionDistinctOn { ) } - fn from_template(&self, _exprs: &[Expr], inputs: &[LogicalPlan]) -> Self { - assert_eq!(inputs.len(), 2); + fn with_exprs_and_inputs( + &self, + _exprs: Vec, + inputs: Vec, + ) -> DataFusionResult { + if inputs.len() != 2 { + return Err(DataFusionError::Internal( + "UnionDistinctOn must have exactly 2 inputs".to_string(), + )); + } - let left = inputs[0].clone(); - let right = inputs[1].clone(); - Self { + let mut inputs = inputs.into_iter(); + let left = inputs.next().unwrap(); + let right = inputs.next().unwrap(); + + Ok(Self { left, right, compare_keys: self.compare_keys.clone(), ts_col: self.ts_col.clone(), output_schema: self.output_schema.clone(), - } + }) } } @@ -181,8 +191,8 @@ impl ExecutionPlan for UnionDistinctOnExec { self.properties.as_ref() } - fn children(&self) -> Vec> { - vec![self.left.clone(), self.right.clone()] + fn children(&self) -> Vec<&Arc> { + vec![&self.left, &self.right] } fn with_new_children( diff --git a/src/query/Cargo.toml b/src/query/Cargo.toml index 00bfa6621a..eed0d5a339 100644 --- a/src/query/Cargo.toml +++ b/src/query/Cargo.toml @@ -58,6 +58,7 @@ regex.workspace = true session.workspace = true snafu.workspace = true sql.workspace = true +sqlparser.workspace = true store-api.workspace = true substrait.workspace = true table.workspace = true diff --git a/src/query/src/analyze.rs b/src/query/src/analyze.rs index a5c40b5bb3..b0158fd087 100644 --- a/src/query/src/analyze.rs +++ b/src/query/src/analyze.rs @@ -97,8 +97,8 @@ impl ExecutionPlan for DistAnalyzeExec { &self.properties } - fn children(&self) -> Vec> { - vec![self.input.clone()] + fn children(&self) -> Vec<&Arc> { + vec![&self.input] } /// AnalyzeExec is handled specially so this value is ignored @@ -210,7 +210,7 @@ fn create_output_batch( builder.append_metric(0, 0, stage_0_metrics); // Find merge scan and append its sub_stage_metrics - input.apply(&mut |plan| { + input.apply(|plan| { if let Some(merge_scan) = plan.as_any().downcast_ref::() { let sub_stage_metrics = merge_scan.sub_stage_metrics(); for (node, metric) in sub_stage_metrics.into_iter().enumerate() { diff --git a/src/query/src/datafusion/planner.rs b/src/query/src/datafusion/planner.rs index 0e98247398..65e78f1301 100644 --- a/src/query/src/datafusion/planner.rs +++ b/src/query/src/datafusion/planner.rs @@ -23,13 +23,12 @@ use common_query::logical_plan::create_aggregate_function; use datafusion::catalog::TableReference; use datafusion::error::Result as DfResult; use datafusion::execution::context::SessionState; -use datafusion::physical_plan::udf::ScalarUDF; use datafusion::sql::planner::ContextProvider; use datafusion::variable::VarType; use datafusion_common::config::ConfigOptions; use datafusion_common::DataFusionError; use datafusion_expr::var_provider::is_system_variables; -use datafusion_expr::{AggregateUDF, TableSource, WindowUDF}; +use datafusion_expr::{AggregateUDF, ScalarUDF, TableSource, WindowUDF}; use datafusion_sql::parser::Statement as DfStatement; use session::context::QueryContextRef; use snafu::ResultExt; @@ -128,11 +127,14 @@ impl ContextProvider for DfContextProviderAdapter { } fn get_aggregate_meta(&self, name: &str) -> Option> { - self.engine_state.aggregate_function(name).map(|func| { - Arc::new( - create_aggregate_function(func.name(), func.args_count(), func.create()).into(), - ) - }) + self.engine_state.aggregate_function(name).map_or_else( + || self.session_state.aggregate_functions().get(name).cloned(), + |func| { + Some(Arc::new( + create_aggregate_function(func.name(), func.args_count(), func.create()).into(), + )) + }, + ) } fn get_window_meta(&self, _name: &str) -> Option> { @@ -161,17 +163,17 @@ impl ContextProvider for DfContextProviderAdapter { self.session_state.config_options() } - fn udfs_names(&self) -> Vec { + fn udf_names(&self) -> Vec { // TODO(LFC): Impl it. vec![] } - fn udafs_names(&self) -> Vec { + fn udaf_names(&self) -> Vec { // TODO(LFC): Impl it. vec![] } - fn udwfs_names(&self) -> Vec { + fn udwf_names(&self) -> Vec { // TODO(LFC): Impl it. vec![] } diff --git a/src/query/src/dist_plan/commutativity.rs b/src/query/src/dist_plan/commutativity.rs index f59dc57268..618b98b349 100644 --- a/src/query/src/dist_plan/commutativity.rs +++ b/src/query/src/dist_plan/commutativity.rs @@ -149,7 +149,6 @@ impl Categorizer { | Expr::SimilarTo(_) | Expr::IsUnknown(_) | Expr::IsNotUnknown(_) - | Expr::GetIndexedField(_) | Expr::Case(_) | Expr::Cast(_) | Expr::TryCast(_) diff --git a/src/query/src/dist_plan/merge_scan.rs b/src/query/src/dist_plan/merge_scan.rs index 1af2516d23..23d7fbb832 100644 --- a/src/query/src/dist_plan/merge_scan.rs +++ b/src/query/src/dist_plan/merge_scan.rs @@ -86,8 +86,12 @@ impl UserDefinedLogicalNodeCore for MergeScanLogicalPlan { write!(f, "MergeScan [is_placeholder={}]", self.is_placeholder) } - fn from_template(&self, _exprs: &[datafusion_expr::Expr], _inputs: &[LogicalPlan]) -> Self { - self.clone() + fn with_exprs_and_inputs( + &self, + _exprs: Vec, + _inputs: Vec, + ) -> Result { + Ok(self.clone()) } } @@ -306,7 +310,7 @@ impl ExecutionPlan for MergeScanExec { &self.properties } - fn children(&self) -> Vec> { + fn children(&self) -> Vec<&Arc> { vec![] } diff --git a/src/query/src/dist_plan/planner.rs b/src/query/src/dist_plan/planner.rs index 4bb0cccc02..c3d8b00eaf 100644 --- a/src/query/src/dist_plan/planner.rs +++ b/src/query/src/dist_plan/planner.rs @@ -171,7 +171,7 @@ struct TableNameExtractor { pub table_name: Option, } -impl TreeNodeVisitor for TableNameExtractor { +impl TreeNodeVisitor<'_> for TableNameExtractor { type Node = LogicalPlan; fn f_down(&mut self, node: &Self::Node) -> Result { diff --git a/src/query/src/optimizer/count_wildcard.rs b/src/query/src/optimizer/count_wildcard.rs index b8a491003b..ccea20cb91 100644 --- a/src/query/src/optimizer/count_wildcard.rs +++ b/src/query/src/optimizer/count_wildcard.rs @@ -57,7 +57,7 @@ impl CountWildcardToTimeIndexRule { }; plan.map_expressions(|expr| { let original_name = name_preserver.save(&expr)?; - let transformed_expr = expr.transform_up_mut(&mut |expr| match expr { + let transformed_expr = expr.transform_up(|expr| match expr { Expr::WindowFunction(mut window_function) if Self::is_count_star_window_aggregate(&window_function) => { @@ -135,7 +135,7 @@ struct TimeIndexFinder { table_alias: Option, } -impl TreeNodeVisitor for TimeIndexFinder { +impl TreeNodeVisitor<'_> for TimeIndexFinder { type Node = LogicalPlan; fn f_down(&mut self, node: &Self::Node) -> DataFusionResult { diff --git a/src/query/src/optimizer/order_hint.rs b/src/query/src/optimizer/order_hint.rs index e2bf9105bb..55bf314b48 100644 --- a/src/query/src/optimizer/order_hint.rs +++ b/src/query/src/optimizer/order_hint.rs @@ -75,9 +75,9 @@ impl OrderHintRule { { let mut opts = Vec::with_capacity(order_expr.len()); for sort in order_expr { - let name = match sort.expr.try_into_col() { - Ok(col) => col.name, - Err(_) => return Ok(Transformed::no(plan)), + let name = match sort.expr.try_as_col() { + Some(col) => col.name.clone(), + None => return Ok(Transformed::no(plan)), }; opts.push(OrderOption { name, @@ -108,7 +108,7 @@ struct OrderHintVisitor { order_expr: Option>, } -impl TreeNodeVisitor for OrderHintVisitor { +impl TreeNodeVisitor<'_> for OrderHintVisitor { type Node = LogicalPlan; fn f_down(&mut self, node: &Self::Node) -> DataFusionResult { diff --git a/src/query/src/optimizer/remove_duplicate.rs b/src/query/src/optimizer/remove_duplicate.rs index 8d3215ac41..7f3ba29668 100644 --- a/src/query/src/optimizer/remove_duplicate.rs +++ b/src/query/src/optimizer/remove_duplicate.rs @@ -50,7 +50,7 @@ impl PhysicalOptimizerRule for RemoveDuplicate { impl RemoveDuplicate { fn do_optimize(plan: Arc) -> DfResult> { let result = plan - .transform_down_mut(&mut |plan| { + .transform_down(|plan| { if plan.as_any().is::() || plan.as_any().is::() { diff --git a/src/query/src/optimizer/string_normalization.rs b/src/query/src/optimizer/string_normalization.rs index 56fb36c3df..1a755f33a2 100644 --- a/src/query/src/optimizer/string_normalization.rs +++ b/src/query/src/optimizer/string_normalization.rs @@ -26,7 +26,7 @@ pub struct StringNormalizationRule; impl AnalyzerRule for StringNormalizationRule { fn analyze(&self, plan: LogicalPlan, _config: &ConfigOptions) -> Result { - plan.transform(&|plan| { + plan.transform(|plan| { let mut converter = StringNormalizationConverter; let inputs = plan.inputs().into_iter().cloned().collect::>(); let expr = plan diff --git a/src/query/src/planner.rs b/src/query/src/planner.rs index 9643e63ef4..7155f22510 100644 --- a/src/query/src/planner.rs +++ b/src/query/src/planner.rs @@ -149,7 +149,7 @@ impl DfLogicalPlanner { &query_ctx, )?), ); - PromPlanner::stmt_to_plan(table_provider, stmt) + PromPlanner::stmt_to_plan(table_provider, stmt, &self.session_state) .await .map(LogicalPlan::DfPlan) .map_err(BoxedError::new) diff --git a/src/query/src/promql/planner.rs b/src/query/src/promql/planner.rs index 9d9fd66a31..2a0a16a200 100644 --- a/src/query/src/promql/planner.rs +++ b/src/query/src/promql/planner.rs @@ -13,7 +13,6 @@ // limitations under the License. use std::collections::{BTreeSet, HashSet, VecDeque}; -use std::str::FromStr; use std::sync::Arc; use std::time::UNIX_EPOCH; @@ -22,13 +21,14 @@ use catalog::table_source::DfTableSourceProvider; use common_query::prelude::GREPTIME_VALUE; use datafusion::common::{DFSchemaRef, Result as DfResult}; use datafusion::datasource::DefaultTableSource; +use datafusion::execution::context::SessionState; use datafusion::logical_expr::expr::{ AggregateFunction, AggregateFunctionDefinition, Alias, ScalarFunction, }; use datafusion::logical_expr::expr_rewriter::normalize_cols; use datafusion::logical_expr::{ - AggregateFunction as AggregateFunctionEnum, BinaryExpr, BuiltinScalarFunction, Cast, Extension, - LogicalPlan, LogicalPlanBuilder, Operator, ScalarFunctionDefinition, ScalarUDF as ScalarUdfDef, + AggregateFunction as AggregateFunctionEnum, BinaryExpr, Cast, Extension, LogicalPlan, + LogicalPlanBuilder, Operator, ScalarUDF as ScalarUdfDef, }; use datafusion::prelude as df_prelude; use datafusion::prelude::{Column, Expr as DfExpr, JoinType}; @@ -151,17 +151,22 @@ impl PromPlanner { pub async fn stmt_to_plan( table_provider: DfTableSourceProvider, stmt: EvalStmt, + session_state: &SessionState, ) -> Result { let mut planner = Self { table_provider, ctx: PromPlannerContext::from_eval_stmt(&stmt), }; - planner.prom_expr_to_plan(stmt.expr).await + planner.prom_expr_to_plan(stmt.expr, session_state).await } #[async_recursion] - pub async fn prom_expr_to_plan(&mut self, prom_expr: PromExpr) -> Result { + pub async fn prom_expr_to_plan( + &mut self, + prom_expr: PromExpr, + session_state: &SessionState, + ) -> Result { let res = match &prom_expr { PromExpr::Aggregate(AggregateExpr { op, @@ -170,7 +175,7 @@ impl PromPlanner { param: _param, modifier, }) => { - let input = self.prom_expr_to_plan(*expr.clone()).await?; + let input = self.prom_expr_to_plan(*expr.clone(), session_state).await?; // calculate columns to group by // Need to append time index column into group by columns @@ -194,7 +199,7 @@ impl PromPlanner { } PromExpr::Unary(UnaryExpr { expr }) => { // Unary Expr in PromQL implys the `-` operator - let input = self.prom_expr_to_plan(*expr.clone()).await?; + let input = self.prom_expr_to_plan(*expr.clone(), session_state).await?; self.projection_for_each_field_column(input, |col| { Ok(DfExpr::Negative(Box::new(DfExpr::Column(col.into())))) })? @@ -250,7 +255,7 @@ impl PromPlanner { } // lhs is a literal, rhs is a column (Some(mut expr), None) => { - let input = self.prom_expr_to_plan(*rhs.clone()).await?; + let input = self.prom_expr_to_plan(*rhs.clone(), session_state).await?; // check if the literal is a special time expr if let Some(time_expr) = Self::try_build_special_time_expr( lhs, @@ -279,7 +284,7 @@ impl PromPlanner { } // lhs is a column, rhs is a literal (None, Some(mut expr)) => { - let input = self.prom_expr_to_plan(*lhs.clone()).await?; + let input = self.prom_expr_to_plan(*lhs.clone(), session_state).await?; // check if the literal is a special time expr if let Some(time_expr) = Self::try_build_special_time_expr( rhs, @@ -308,14 +313,16 @@ impl PromPlanner { } // both are columns. join them on time index (None, None) => { - let left_input = self.prom_expr_to_plan(*lhs.clone()).await?; + let left_input = + self.prom_expr_to_plan(*lhs.clone(), session_state).await?; let left_field_columns = self.ctx.field_columns.clone(); let mut left_table_ref = self .table_ref() .unwrap_or_else(|_| TableReference::bare("")); let left_context = self.ctx.clone(); - let right_input = self.prom_expr_to_plan(*rhs.clone()).await?; + let right_input = + self.prom_expr_to_plan(*rhs.clone(), session_state).await?; let right_field_columns = self.ctx.field_columns.clone(); let mut right_table_ref = self .table_ref() @@ -399,7 +406,9 @@ impl PromPlanner { } } } - PromExpr::Paren(ParenExpr { expr }) => self.prom_expr_to_plan(*expr.clone()).await?, + PromExpr::Paren(ParenExpr { expr }) => { + self.prom_expr_to_plan(*expr.clone(), session_state).await? + } PromExpr::Subquery(SubqueryExpr { .. }) => UnsupportedExprSnafu { name: "Prom Subquery", } @@ -510,16 +519,18 @@ impl PromPlanner { PromExpr::Call(Call { func, args }) => { // some special functions that are not expression but a plan match func.name { - SPECIAL_HISTOGRAM_QUANTILE => return self.create_histogram_plan(args).await, + SPECIAL_HISTOGRAM_QUANTILE => { + return self.create_histogram_plan(args, session_state).await + } SPECIAL_VECTOR_FUNCTION => return self.create_vector_plan(args).await, - SCALAR_FUNCTION => return self.create_scalar_plan(args).await, + SCALAR_FUNCTION => return self.create_scalar_plan(args, session_state).await, _ => {} } // transform function arguments let args = self.create_function_args(&args.args)?; let input = if let Some(prom_expr) = args.input { - self.prom_expr_to_plan(prom_expr).await? + self.prom_expr_to_plan(prom_expr, session_state).await? } else { self.ctx.time_index_column = Some(SPECIAL_TIME_FUNCTION.to_string()); self.ctx.reset_table_name_and_schema(); @@ -537,7 +548,8 @@ impl PromPlanner { ), }) }; - let mut func_exprs = self.create_function_expr(func, args.literals)?; + let mut func_exprs = + self.create_function_expr(func, args.literals, session_state)?; func_exprs.insert(0, self.create_time_index_column_expr()?); func_exprs.extend_from_slice(&self.create_tag_column_exprs()?); @@ -551,7 +563,9 @@ impl PromPlanner { } PromExpr::Extension(promql_parser::parser::ast::Extension { expr }) => { let children = expr.children(); - let plan = self.prom_expr_to_plan(children[0].clone()).await?; + let plan = self + .prom_expr_to_plan(children[0].clone(), session_state) + .await?; // Wrapper for the explanation/analyze of the existing plan // https://docs.rs/datafusion-expr/latest/datafusion_expr/logical_plan/builder/struct.LogicalPlanBuilder.html#method.explain // if `analyze` is true, runs the actual plan and produces @@ -1063,6 +1077,7 @@ impl PromPlanner { &mut self, func: &Function, other_input_exprs: Vec, + session_state: &SessionState, ) -> Result> { // TODO(ruihang): check function args list let mut other_input_exprs: VecDeque = other_input_exprs.into(); @@ -1071,30 +1086,30 @@ impl PromPlanner { let field_column_pos = 0; let mut exprs = Vec::with_capacity(self.ctx.field_columns.len()); let scalar_func = match func.name { - "increase" => ScalarFunc::ExtrapolateUdf(Increase::scalar_udf( + "increase" => ScalarFunc::ExtrapolateUdf(Arc::new(Increase::scalar_udf( self.ctx.range.context(ExpectRangeSelectorSnafu)?, - )), - "rate" => ScalarFunc::ExtrapolateUdf(Rate::scalar_udf( + ))), + "rate" => ScalarFunc::ExtrapolateUdf(Arc::new(Rate::scalar_udf( self.ctx.range.context(ExpectRangeSelectorSnafu)?, - )), - "delta" => ScalarFunc::ExtrapolateUdf(Delta::scalar_udf( + ))), + "delta" => ScalarFunc::ExtrapolateUdf(Arc::new(Delta::scalar_udf( self.ctx.range.context(ExpectRangeSelectorSnafu)?, - )), - "idelta" => ScalarFunc::Udf(IDelta::::scalar_udf()), - "irate" => ScalarFunc::Udf(IDelta::::scalar_udf()), - "resets" => ScalarFunc::Udf(Resets::scalar_udf()), - "changes" => ScalarFunc::Udf(Changes::scalar_udf()), - "deriv" => ScalarFunc::Udf(Deriv::scalar_udf()), - "avg_over_time" => ScalarFunc::Udf(AvgOverTime::scalar_udf()), - "min_over_time" => ScalarFunc::Udf(MinOverTime::scalar_udf()), - "max_over_time" => ScalarFunc::Udf(MaxOverTime::scalar_udf()), - "sum_over_time" => ScalarFunc::Udf(SumOverTime::scalar_udf()), - "count_over_time" => ScalarFunc::Udf(CountOverTime::scalar_udf()), - "last_over_time" => ScalarFunc::Udf(LastOverTime::scalar_udf()), - "absent_over_time" => ScalarFunc::Udf(AbsentOverTime::scalar_udf()), - "present_over_time" => ScalarFunc::Udf(PresentOverTime::scalar_udf()), - "stddev_over_time" => ScalarFunc::Udf(StddevOverTime::scalar_udf()), - "stdvar_over_time" => ScalarFunc::Udf(StdvarOverTime::scalar_udf()), + ))), + "idelta" => ScalarFunc::Udf(Arc::new(IDelta::::scalar_udf())), + "irate" => ScalarFunc::Udf(Arc::new(IDelta::::scalar_udf())), + "resets" => ScalarFunc::Udf(Arc::new(Resets::scalar_udf())), + "changes" => ScalarFunc::Udf(Arc::new(Changes::scalar_udf())), + "deriv" => ScalarFunc::Udf(Arc::new(Deriv::scalar_udf())), + "avg_over_time" => ScalarFunc::Udf(Arc::new(AvgOverTime::scalar_udf())), + "min_over_time" => ScalarFunc::Udf(Arc::new(MinOverTime::scalar_udf())), + "max_over_time" => ScalarFunc::Udf(Arc::new(MaxOverTime::scalar_udf())), + "sum_over_time" => ScalarFunc::Udf(Arc::new(SumOverTime::scalar_udf())), + "count_over_time" => ScalarFunc::Udf(Arc::new(CountOverTime::scalar_udf())), + "last_over_time" => ScalarFunc::Udf(Arc::new(LastOverTime::scalar_udf())), + "absent_over_time" => ScalarFunc::Udf(Arc::new(AbsentOverTime::scalar_udf())), + "present_over_time" => ScalarFunc::Udf(Arc::new(PresentOverTime::scalar_udf())), + "stddev_over_time" => ScalarFunc::Udf(Arc::new(StddevOverTime::scalar_udf())), + "stdvar_over_time" => ScalarFunc::Udf(Arc::new(StdvarOverTime::scalar_udf())), "quantile_over_time" => { let quantile_expr = match other_input_exprs.pop_front() { Some(DfExpr::Literal(ScalarValue::Float64(Some(quantile)))) => quantile, @@ -1103,7 +1118,7 @@ impl PromPlanner { } .fail()?, }; - ScalarFunc::Udf(QuantileOverTime::scalar_udf(quantile_expr)) + ScalarFunc::Udf(Arc::new(QuantileOverTime::scalar_udf(quantile_expr))) } "predict_linear" => { let t_expr = match other_input_exprs.pop_front() { @@ -1114,7 +1129,7 @@ impl PromPlanner { } .fail()?, }; - ScalarFunc::Udf(PredictLinear::scalar_udf(t_expr)) + ScalarFunc::Udf(Arc::new(PredictLinear::scalar_udf(t_expr))) } "holt_winters" => { let sf_exp = match other_input_exprs.pop_front() { @@ -1134,7 +1149,7 @@ impl PromPlanner { } .fail()?, }; - ScalarFunc::Udf(HoltWinters::scalar_udf(sf_exp, tf_exp)) + ScalarFunc::Udf(Arc::new(HoltWinters::scalar_udf(sf_exp, tf_exp))) } "time" => { exprs.push(build_special_time_expr( @@ -1201,9 +1216,7 @@ impl PromPlanner { right: Box::new(interval_1day_lit_expr), }); let date_trunc_expr = DfExpr::ScalarFunction(ScalarFunction { - func_def: ScalarFunctionDefinition::UDF( - datafusion_functions::datetime::date_trunc(), - ), + func: datafusion_functions::datetime::date_trunc(), args: vec![month_lit_expr, self.create_time_index_column_expr()?], }); let date_trunc_plus_interval_expr = DfExpr::BinaryExpr(BinaryExpr { @@ -1212,9 +1225,7 @@ impl PromPlanner { right: Box::new(the_1month_minus_1day_expr), }); let date_part_expr = DfExpr::ScalarFunction(ScalarFunction { - func_def: ScalarFunctionDefinition::UDF( - datafusion_functions::datetime::date_part(), - ), + func: datafusion_functions::datetime::date_part(), args: vec![day_lit_expr, date_trunc_plus_interval_expr], }); @@ -1222,8 +1233,8 @@ impl PromPlanner { ScalarFunc::GeneratedExpr } _ => { - if let Ok(f) = BuiltinScalarFunction::from_str(func.name) { - ScalarFunc::DataFusionBuiltin(f) + if let Some(f) = session_state.scalar_functions().get(func.name) { + ScalarFunc::DataFusionBuiltin(f.clone()) } else if let Some(f) = datafusion_functions::math::functions() .iter() .find(|f| f.name() == func.name) @@ -1242,28 +1253,25 @@ impl PromPlanner { let col_expr = DfExpr::Column(Column::from_name(value)); match scalar_func.clone() { - ScalarFunc::DataFusionBuiltin(fun) => { + ScalarFunc::DataFusionBuiltin(func) => { other_input_exprs.insert(field_column_pos, col_expr); let fn_expr = DfExpr::ScalarFunction(ScalarFunction { - func_def: ScalarFunctionDefinition::BuiltIn(fun), + func, args: other_input_exprs.clone().into(), }); exprs.push(fn_expr); let _ = other_input_exprs.remove(field_column_pos); } - ScalarFunc::DataFusionUdf(f) => { + ScalarFunc::DataFusionUdf(func) => { let args = itertools::chain!( other_input_exprs.iter().take(field_column_pos).cloned(), std::iter::once(col_expr), other_input_exprs.iter().skip(field_column_pos).cloned() ) .collect_vec(); - exprs.push(DfExpr::ScalarFunction(ScalarFunction { - func_def: ScalarFunctionDefinition::UDF(f), - args, - })) + exprs.push(DfExpr::ScalarFunction(ScalarFunction { func, args })) } - ScalarFunc::Udf(fun) => { + ScalarFunc::Udf(func) => { let ts_range_expr = DfExpr::Column(Column::from_name( RangeManipulate::build_timestamp_range_name( self.ctx.time_index_column.as_ref().unwrap(), @@ -1272,14 +1280,14 @@ impl PromPlanner { other_input_exprs.insert(field_column_pos, ts_range_expr); other_input_exprs.insert(field_column_pos + 1, col_expr); let fn_expr = DfExpr::ScalarFunction(ScalarFunction { - func_def: ScalarFunctionDefinition::UDF(Arc::new(fun)), + func, args: other_input_exprs.clone().into(), }); exprs.push(fn_expr); let _ = other_input_exprs.remove(field_column_pos + 1); let _ = other_input_exprs.remove(field_column_pos); } - ScalarFunc::ExtrapolateUdf(fun) => { + ScalarFunc::ExtrapolateUdf(func) => { let ts_range_expr = DfExpr::Column(Column::from_name( RangeManipulate::build_timestamp_range_name( self.ctx.time_index_column.as_ref().unwrap(), @@ -1290,7 +1298,7 @@ impl PromPlanner { other_input_exprs .insert(field_column_pos + 2, self.create_time_index_column_expr()?); let fn_expr = DfExpr::ScalarFunction(ScalarFunction { - func_def: ScalarFunctionDefinition::UDF(Arc::new(fun)), + func, args: other_input_exprs.clone().into(), }); exprs.push(fn_expr); @@ -1418,7 +1426,11 @@ impl PromPlanner { } /// Create a [SPECIAL_HISTOGRAM_QUANTILE] plan. - async fn create_histogram_plan(&mut self, args: &PromFunctionArgs) -> Result { + async fn create_histogram_plan( + &mut self, + args: &PromFunctionArgs, + session_state: &SessionState, + ) -> Result { if args.args.len() != 2 { return FunctionInvalidArgumentSnafu { fn_name: SPECIAL_HISTOGRAM_QUANTILE.to_string(), @@ -1431,7 +1443,7 @@ impl PromPlanner { } })?; let input = args.args[1].as_ref().clone(); - let input_plan = self.prom_expr_to_plan(input).await?; + let input_plan = self.prom_expr_to_plan(input, session_state).await?; if !self.ctx.has_le_tag() { return ColumnNotFoundSnafu { @@ -1505,7 +1517,11 @@ impl PromPlanner { } /// Create a [SCALAR_FUNCTION] plan - async fn create_scalar_plan(&mut self, args: &PromFunctionArgs) -> Result { + async fn create_scalar_plan( + &mut self, + args: &PromFunctionArgs, + session_state: &SessionState, + ) -> Result { ensure!( args.len() == 1, FunctionInvalidArgumentSnafu { @@ -1513,7 +1529,7 @@ impl PromPlanner { } ); let input = self - .prom_expr_to_plan(args.args[0].as_ref().clone()) + .prom_expr_to_plan(args.args[0].as_ref().clone(), session_state) .await?; ensure!( self.ctx.field_columns.len() == 1, @@ -1653,16 +1669,13 @@ impl PromPlanner { token::T_LTE => Ok(Box::new(|lhs, rhs| Ok(lhs.lt_eq(rhs)))), token::T_POW => Ok(Box::new(|lhs, rhs| { Ok(DfExpr::ScalarFunction(ScalarFunction { - func_def: ScalarFunctionDefinition::UDF(datafusion_functions::math::power()), + func: datafusion_functions::math::power(), args: vec![lhs, rhs], })) })), token::T_ATAN2 => Ok(Box::new(|lhs, rhs| { Ok(DfExpr::ScalarFunction(ScalarFunction { - // func_def: ScalarFunctionDefinition::BuiltIn(BuiltinScalarFunction::Atan2), - func_def: datafusion_expr::ScalarFunctionDefinition::UDF( - datafusion_functions::math::atan2(), - ), + func: datafusion_functions::math::atan2(), args: vec![lhs, rhs], })) })), @@ -2153,7 +2166,7 @@ impl PromPlanner { })?, ); let fn_expr = DfExpr::ScalarFunction(ScalarFunction { - func_def: ScalarFunctionDefinition::UDF(datafusion_functions::datetime::date_part()), + func: datafusion_functions::datetime::date_part(), args: vec![lit_expr, input_expr], }); Ok(fn_expr) @@ -2168,13 +2181,13 @@ struct FunctionArgs { #[derive(Debug, Clone)] enum ScalarFunc { - DataFusionBuiltin(BuiltinScalarFunction), + DataFusionBuiltin(Arc), /// The UDF that is defined by Datafusion itself. DataFusionUdf(Arc), - Udf(ScalarUdfDef), + Udf(Arc), // todo(ruihang): maybe merge with Udf later /// UDF that require extra information like range length to be evaluated. - ExtrapolateUdf(ScalarUdfDef), + ExtrapolateUdf(Arc), /// Func that doesn't require input, like `time()`. GeneratedExpr, } @@ -2187,8 +2200,10 @@ mod test { use catalog::RegisterTableRequest; use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME}; use common_query::test_util::DummyDecoder; + use datafusion::execution::runtime_env::RuntimeEnv; use datatypes::prelude::ConcreteDataType; use datatypes::schema::{ColumnSchema, Schema}; + use df_prelude::SessionConfig; use promql_parser::label::Labels; use promql_parser::parser; use session::context::QueryContext; @@ -2197,6 +2212,10 @@ mod test { use super::*; + fn build_session_state() -> SessionState { + SessionState::new_with_config_rt(SessionConfig::new(), Arc::new(RuntimeEnv::default())) + } + async fn build_test_table_provider( table_name_tuples: &[(String, String)], num_tag: usize, @@ -2295,7 +2314,7 @@ mod test { 1, ) .await; - let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt) + let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt, &build_session_state()) .await .unwrap(); @@ -2505,9 +2524,10 @@ mod test { 2, ) .await; - let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt.clone()) - .await - .unwrap(); + let plan = + PromPlanner::stmt_to_plan(table_provider, eval_stmt.clone(), &build_session_state()) + .await + .unwrap(); let expected_no_without = String::from( "Sort: some_metric.tag_1 ASC NULLS LAST, some_metric.timestamp ASC NULLS LAST [tag_1:Utf8, timestamp:Timestamp(Millisecond, None), TEMPLATE(some_metric.field_0):Float64;N, TEMPLATE(some_metric.field_1):Float64;N]\ \n Aggregate: groupBy=[[some_metric.tag_1, some_metric.timestamp]], aggr=[[TEMPLATE(some_metric.field_0), TEMPLATE(some_metric.field_1)]] [tag_1:Utf8, timestamp:Timestamp(Millisecond, None), TEMPLATE(some_metric.field_0):Float64;N, TEMPLATE(some_metric.field_1):Float64;N]\ @@ -2535,7 +2555,7 @@ mod test { 2, ) .await; - let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt) + let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt, &build_session_state()) .await .unwrap(); let expected_without = String::from( @@ -2660,7 +2680,7 @@ mod test { 1, ) .await; - let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt) + let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt, &build_session_state()) .await .unwrap(); @@ -2710,7 +2730,7 @@ mod test { 1, ) .await; - let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt) + let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt, &build_session_state()) .await .unwrap(); @@ -2954,9 +2974,13 @@ mod test { 3, ) .await; - let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt.clone()) - .await - .unwrap(); + let plan = PromPlanner::stmt_to_plan( + table_provider, + eval_stmt.clone(), + &build_session_state(), + ) + .await + .unwrap(); let mut fields = plan.schema().field_names(); let mut expected = case.1.into_iter().map(String::from).collect::>(); fields.sort(); @@ -2978,7 +3002,12 @@ mod test { 3, ) .await; - let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt.clone()).await; + let plan = PromPlanner::stmt_to_plan( + table_provider, + eval_stmt.clone(), + &build_session_state(), + ) + .await; assert!(plan.is_err(), "case: {:?}", case); } } @@ -3030,7 +3059,8 @@ mod test { ) .await; - let plan = PromPlanner::stmt_to_plan(table_provider, eval_stmt).await; + let plan = + PromPlanner::stmt_to_plan(table_provider, eval_stmt, &build_session_state()).await; assert!(plan.is_err(), "query: {:?}", query); } } @@ -3096,6 +3126,7 @@ mod test { interval: Duration::from_secs(5), lookback_delta: Duration::from_secs(1), }, + &build_session_state(), ) .await .unwrap(); @@ -3124,6 +3155,7 @@ mod test { interval: Duration::from_secs(5), lookback_delta: Duration::from_secs(1), }, + &build_session_state(), ) .await .unwrap(); diff --git a/src/query/src/range_select/plan.rs b/src/query/src/range_select/plan.rs index 5ba9b22488..7bed19406d 100644 --- a/src/query/src/range_select/plan.rs +++ b/src/query/src/range_select/plan.rs @@ -496,8 +496,9 @@ impl RangeSelect { DFSchema::new_with_metadata(by_fields, input.schema().metadata().clone()) .context(DataFusionSnafu)?, ); - // If the results of project plan can be obtained directly from range plan without any additional calculations, no project plan is required. - // We can simply project the final output of the range plan to produce the final result. + // If the results of project plan can be obtained directly from range plan without any additional + // calculations, no project plan is required. We can simply project the final output of the range + // plan to produce the final result. let schema_project = projection_expr .iter() .map(|project_expr| { @@ -506,7 +507,12 @@ impl RangeSelect { .index_of_column_by_name(column.relation.as_ref(), &column.name) .ok_or(()) } else { - Err(()) + let (qualifier, field) = project_expr + .to_field(input.schema().as_ref()) + .map_err(|_| ())?; + schema_before_project + .index_of_column_by_name(qualifier.as_ref(), field.name()) + .ok_or(()) } }) .collect::, ()>>() @@ -584,9 +590,22 @@ impl UserDefinedLogicalNodeCore for RangeSelect { ) } - fn from_template(&self, exprs: &[Expr], inputs: &[LogicalPlan]) -> Self { - assert!(!inputs.is_empty()); - assert!(exprs.len() == self.range_expr.len() + self.by.len() + 1); + fn with_exprs_and_inputs( + &self, + exprs: Vec, + inputs: Vec, + ) -> DataFusionResult { + if inputs.is_empty() { + return Err(DataFusionError::Plan( + "RangeSelect: inputs is empty".to_string(), + )); + } + if exprs.len() != self.range_expr.len() + self.by.len() + 1 { + return Err(DataFusionError::Plan( + "RangeSelect: exprs length not match".to_string(), + )); + } + let range_expr = exprs .iter() .zip(self.range_expr.iter()) @@ -601,7 +620,7 @@ impl UserDefinedLogicalNodeCore for RangeSelect { .collect(); let time_expr = exprs[self.range_expr.len()].clone(); let by = exprs[self.range_expr.len() + 1..].to_vec(); - Self { + Ok(Self { align: self.align, align_to: self.align_to, range_expr, @@ -613,7 +632,7 @@ impl UserDefinedLogicalNodeCore for RangeSelect { by_schema: self.by_schema.clone(), schema_project: self.schema_project.clone(), schema_before_project: self.schema_before_project.clone(), - } + }) } } @@ -674,24 +693,11 @@ impl RangeSelect { }; let expr = match &range_expr { - Expr::AggregateFunction( - aggr @ datafusion_expr::expr::AggregateFunction { - func_def: - AggregateFunctionDefinition::BuiltIn(AggregateFunction::FirstValue), - .. - }, - ) - | Expr::AggregateFunction( - aggr @ datafusion_expr::expr::AggregateFunction { - func_def: - AggregateFunctionDefinition::BuiltIn(AggregateFunction::LastValue), - .. - }, - ) => { - let is_last_value_func = matches!( - aggr.func_def, - AggregateFunctionDefinition::BuiltIn(AggregateFunction::LastValue) - ); + Expr::AggregateFunction(aggr) + if (aggr.func_def.name() == "last_value" + || aggr.func_def.name() == "first_value") => + { + let is_last_value_func = aggr.func_def.name() == "last_value"; // Because we only need to find the first_value/last_value, // the complexity of sorting the entire batch is O(nlogn). @@ -795,10 +801,8 @@ impl RangeSelect { &input_schema, name, false, + false, ), - f => Err(DataFusionError::NotImplemented(format!( - "Range function from {f:?}" - ))), } } _ => Err(DataFusionError::Plan(format!( @@ -930,8 +934,8 @@ impl ExecutionPlan for RangeSelectExec { &self.cache } - fn children(&self) -> Vec> { - vec![self.input.clone()] + fn children(&self) -> Vec<&Arc> { + vec![&self.input] } fn with_new_children( diff --git a/src/query/src/range_select/plan_rewrite.rs b/src/query/src/range_select/plan_rewrite.rs index 087fa2c901..785e9ae2b4 100644 --- a/src/query/src/range_select/plan_rewrite.rs +++ b/src/query/src/range_select/plan_rewrite.rs @@ -510,7 +510,7 @@ impl RangePlanRewriter { fn have_range_in_exprs(exprs: &[Expr]) -> bool { exprs.iter().any(|expr| { let mut find_range = false; - let _ = expr.apply(&mut |expr| { + let _ = expr.apply(|expr| { Ok(match expr { Expr::ScalarFunction(func) if func.name() == "range_fn" => { find_range = true; @@ -525,7 +525,7 @@ fn have_range_in_exprs(exprs: &[Expr]) -> bool { fn interval_only_in_expr(expr: &Expr) -> bool { let mut all_interval = true; - let _ = expr.apply(&mut |expr| { + let _ = expr.apply(|expr| { if !matches!( expr, Expr::Literal(ScalarValue::IntervalDayTime(_)) @@ -651,8 +651,8 @@ mod test { let query = r#"SELECT (covar(field_0 + field_1, field_1)/4) RANGE '5m' FROM test ALIGN '1h';"#; let expected = String::from( - "Projection: COVAR(test.field_0 + test.field_1,test.field_1) RANGE 5m / Int64(4) [COVAR(test.field_0 + test.field_1,test.field_1) RANGE 5m / Int64(4):Float64;N]\ - \n RangeSelect: range_exprs=[COVAR(test.field_0 + test.field_1,test.field_1) RANGE 5m], align=3600000ms, align_to=0ms, align_by=[test.tag_0, test.tag_1, test.tag_2, test.tag_3, test.tag_4], time_index=timestamp [COVAR(test.field_0 + test.field_1,test.field_1) RANGE 5m:Float64;N, timestamp:Timestamp(Millisecond, None), tag_0:Utf8, tag_1:Utf8, tag_2:Utf8, tag_3:Utf8, tag_4:Utf8]\ + "Projection: covar_samp(test.field_0 + test.field_1,test.field_1) RANGE 5m / Int64(4) [covar_samp(test.field_0 + test.field_1,test.field_1) RANGE 5m / Int64(4):Float64;N]\ + \n RangeSelect: range_exprs=[covar_samp(test.field_0 + test.field_1,test.field_1) RANGE 5m], align=3600000ms, align_to=0ms, align_by=[test.tag_0, test.tag_1, test.tag_2, test.tag_3, test.tag_4], time_index=timestamp [covar_samp(test.field_0 + test.field_1,test.field_1) RANGE 5m:Float64;N, timestamp:Timestamp(Millisecond, None), tag_0:Utf8, tag_1:Utf8, tag_2:Utf8, tag_3:Utf8, tag_4:Utf8]\ \n TableScan: test [tag_0:Utf8, tag_1:Utf8, tag_2:Utf8, tag_3:Utf8, tag_4:Utf8, timestamp:Timestamp(Millisecond, None), field_0:Float64;N, field_1:Float64;N, field_2:Float64;N, field_3:Float64;N, field_4:Float64;N]" ); query_plan_compare(query, expected).await; diff --git a/src/query/src/sql/show_create_table.rs b/src/query/src/sql/show_create_table.rs index 8002ef0d8e..74150465f1 100644 --- a/src/query/src/sql/show_create_table.rs +++ b/src/query/src/sql/show_create_table.rs @@ -24,6 +24,7 @@ use sql::dialect::GreptimeDbDialect; use sql::parser::ParserContext; use sql::statements::create::{CreateTable, TIME_INDEX}; use sql::statements::{self, OptionMap}; +use sqlparser::ast::KeyOrIndexDisplay; use store_api::metric_engine_consts::{is_metric_engine, is_metric_engine_internal_column}; use table::metadata::{TableInfoRef, TableMeta}; use table::requests::{FILE_TABLE_META_KEY, TTL_KEY, WRITE_BUFFER_SIZE_KEY}; @@ -108,8 +109,11 @@ fn create_table_constraints( constraints.push(TableConstraint::Unique { name: Some(TIME_INDEX.into()), columns: vec![Ident::with_quote(quote_style, column_name)], - is_primary: false, characteristics: None, + index_name: None, + index_type_display: KeyOrIndexDisplay::None, + index_type: None, + index_options: vec![], }); } if !table_meta.primary_key_indices.is_empty() { @@ -124,11 +128,13 @@ fn create_table_constraints( } }) .collect(); - constraints.push(TableConstraint::Unique { + constraints.push(TableConstraint::PrimaryKey { name: None, columns, - is_primary: true, characteristics: None, + index_name: None, + index_type: None, + index_options: vec![], }); } diff --git a/src/script/src/python/ffi_types/pair_tests/sample_testcases.rs b/src/script/src/python/ffi_types/pair_tests/sample_testcases.rs index f83aa2bf18..3088faa4f4 100644 --- a/src/script/src/python/ffi_types/pair_tests/sample_testcases.rs +++ b/src/script/src/python/ffi_types/pair_tests/sample_testcases.rs @@ -1054,15 +1054,6 @@ ret"# .to_string(), expect: vector!(Float64Vector, [0.0, consts::LOG10_2, 0.47712125471966244,]), }, - CodeBlockTestCase { - input: ronish! {}, - script: r#" -from greptime import * -ret = 0.0<=random(3)<=1.0 -ret"# - .to_string(), - expect: vector!(BooleanVector, &[true, true, true]), - }, CodeBlockTestCase { input: ronish! { "values": vector!(Int64Vector, [1, 2, 2, 3]) @@ -1130,30 +1121,6 @@ ret"# .to_string(), expect: vector!(Int64Vector, [10]), }, - CodeBlockTestCase { - input: ronish! { - "a": vector!(Float64Vector, [1.0, 2.0, 3.0]), - "b": vector!(Float64Vector, [1.0, 0.0, -1.0]) - }, - script: r#" -from greptime import * -ret = vector([covariance(a, b)]) -ret"# - .to_string(), - expect: vector!(Float64Vector, [-1.0]), - }, - CodeBlockTestCase { - input: ronish! { - "a": vector!(Float64Vector, [1.0, 2.0, 3.0]), - "b": vector!(Float64Vector, [1.0, 0.0, -1.0]) - }, - script: r#" -from greptime import * -ret = vector([covariance_pop(a, b)]) -ret"# - .to_string(), - expect: vector!(Float64Vector, [-0.6666666666666666]), - }, CodeBlockTestCase { input: ronish! { "a": vector!(Float64Vector, [1.0, 2.0, 3.0]), diff --git a/src/script/src/python/pyo3/builtins.rs b/src/script/src/python/pyo3/builtins.rs index bc8f23107a..129675b761 100644 --- a/src/script/src/python/pyo3/builtins.rs +++ b/src/script/src/python/pyo3/builtins.rs @@ -100,14 +100,14 @@ pub(crate) fn greptime_builtins(_py: Python<'_>, m: &PyModule) -> PyResult<()> { log10, random, approx_distinct, - median, + // median, approx_percentile_cont, array_agg, avg, correlation, count, - covariance, - covariance_pop, + // covariance, + // covariance_pop, max, min, stddev, @@ -351,7 +351,7 @@ fn approx_distinct(py: Python<'_>, v0: &PyVector) -> PyResult { */ bind_aggr_expr!(approx_distinct, ApproxDistinct,[v0], v0, expr0=>0); -bind_aggr_expr!(median, Median,[v0], v0, expr0=>0); +// bind_aggr_expr!(median, Median,[v0], v0, expr0=>0); #[pyfunction] fn approx_percentile_cont(py: Python<'_>, values: &PyVector, percent: f64) -> PyResult { @@ -391,9 +391,9 @@ bind_aggr_expr!(correlation, Correlation,[v0, v1], v0, expr0=>0, expr1=>1); bind_aggr_expr!(count, Count,[v0], v0, expr0=>0); -bind_aggr_expr!(covariance, Covariance,[v0, v1], v0, expr0=>0, expr1=>1); +// bind_aggr_expr!(covariance, Covariance,[v0, v1], v0, expr0=>0, expr1=>1); -bind_aggr_expr!(covariance_pop, CovariancePop,[v0, v1], v0, expr0=>0, expr1=>1); +// bind_aggr_expr!(covariance_pop, CovariancePop,[v0, v1], v0, expr0=>0, expr1=>1); bind_aggr_expr!(max, Max,[v0], v0, expr0=>0); diff --git a/src/script/src/python/rspython/builtins.rs b/src/script/src/python/rspython/builtins.rs index e08337f76b..db7d52b7ac 100644 --- a/src/script/src/python/rspython/builtins.rs +++ b/src/script/src/python/rspython/builtins.rs @@ -619,17 +619,6 @@ pub(crate) mod greptime_builtin { ); } - #[pyfunction] - fn median(values: PyVectorRef, vm: &VirtualMachine) -> PyResult { - bind_aggr_fn!( - Median, - vm, - &[values.to_arrow_array()], - values.arrow_data_type(), - expr0 - ); - } - /// Not implement in datafusion /// TODO(discord9): use greptime's own impl instead /* @@ -722,38 +711,6 @@ pub(crate) mod greptime_builtin { ); } - #[pyfunction] - fn covariance( - arg0: PyVectorRef, - arg1: PyVectorRef, - vm: &VirtualMachine, - ) -> PyResult { - bind_aggr_fn!( - Covariance, - vm, - &[arg0.to_arrow_array(), arg1.to_arrow_array()], - arg0.arrow_data_type(), - expr0, - expr1 - ); - } - - #[pyfunction] - fn covariance_pop( - arg0: PyVectorRef, - arg1: PyVectorRef, - vm: &VirtualMachine, - ) -> PyResult { - bind_aggr_fn!( - CovariancePop, - vm, - &[arg0.to_arrow_array(), arg1.to_arrow_array()], - arg0.arrow_data_type(), - expr0, - expr1 - ); - } - #[pyfunction] fn max(values: PyVectorRef, vm: &VirtualMachine) -> PyResult { bind_aggr_fn!( diff --git a/src/script/src/python/rspython/builtins/testcases.ron b/src/script/src/python/rspython/builtins/testcases.ron index b5882048e8..0b053538b4 100644 --- a/src/script/src/python/rspython/builtins/testcases.ron +++ b/src/script/src/python/rspython/builtins/testcases.ron @@ -343,17 +343,6 @@ log10(values)"#, ty: Float64 )) ), - TestCase( - input: {}, - script: r#" -from greptime import * -random(42)"#, - expect: Ok(( - value: LenFloatVec(42), - ty: Float64 - )) - ), - // UDAF(Aggerate function) // approx function is indeterministic TestCase( @@ -468,44 +457,6 @@ count(values)"#, ty: Int64 )) ), - TestCase( - input: { - "a": Var( - ty: Float64, - value: FloatVec([1.0, 2.0, 3.0]) - ), - "b": Var( - ty: Float64, - value: FloatVec([1.0, 0.0, -1.0]) - ), - }, - script: r#" -from greptime import * -covariance(a, b)"#, - expect: Ok(( - value: Float(-1.0), - ty: Float64 - )) - ), - TestCase( - input: { - "a": Var( - ty: Float64, - value: FloatVec([1.0, 2.0, 3.0]) - ), - "b": Var( - ty: Float64, - value: FloatVec([1.0, 0.0, -1.0]) - ), - }, - script: r#" -from greptime import * -covariance_pop(a, b)"#, - expect: Ok(( - value: Float(-0.6666666666666666), - ty: Float64 - )) - ), TestCase( input: { "values": Var( @@ -955,21 +906,6 @@ clip(values, lower, upper)"#, }, script: r#" from greptime import * -median(values)"#, - expect: Ok(( - ty: Float64, - value: Float(1.25) - )) - ), - TestCase( - input: { - "values": Var( - ty: Float64, - value: FloatVec([-1.0, 2.0, 2.0, 0.5]) - ) - }, - script: r#" -from greptime import * diff(values)"#, expect: Ok(( ty: Float64, diff --git a/src/servers/src/http/handler.rs b/src/servers/src/http/handler.rs index fa8fe98e4c..79f60639d2 100644 --- a/src/servers/src/http/handler.rs +++ b/src/servers/src/http/handler.rs @@ -168,7 +168,7 @@ pub async fn from_output( let mut result_map = HashMap::new(); let mut tmp = vec![&mut merge_map, &mut result_map]; - collect_plan_metrics(physical_plan, &mut tmp); + collect_plan_metrics(&physical_plan, &mut tmp); let re = result_map .into_iter() .map(|(k, v)| (k, Value::from(v))) diff --git a/src/servers/src/http/header.rs b/src/servers/src/http/header.rs index b9beb54887..f9ff1485ef 100644 --- a/src/servers/src/http/header.rs +++ b/src/servers/src/http/header.rs @@ -126,7 +126,7 @@ fn collect_into_maps(name: &str, value: u64, maps: &mut [&mut HashMap, maps: &mut [&mut HashMap]) { +pub fn collect_plan_metrics(plan: &Arc, maps: &mut [&mut HashMap]) { if let Some(m) = plan.metrics() { m.iter().for_each(|m| match m.value() { MetricValue::Count { name, count } => { diff --git a/src/servers/src/http/prometheus.rs b/src/servers/src/http/prometheus.rs index 210e180a28..cb15887047 100644 --- a/src/servers/src/http/prometheus.rs +++ b/src/servers/src/http/prometheus.rs @@ -460,7 +460,7 @@ async fn retrieve_series_from_query_result( }?; if let Some(ref plan) = result.meta.plan { - collect_plan_metrics(plan.clone(), &mut [metrics]); + collect_plan_metrics(plan, &mut [metrics]); } Ok(()) } @@ -486,7 +486,7 @@ async fn retrieve_labels_name_from_query_result( .fail(), }?; if let Some(ref plan) = result.meta.plan { - collect_plan_metrics(plan.clone(), &mut [metrics]); + collect_plan_metrics(plan, &mut [metrics]); } Ok(()) } @@ -830,7 +830,7 @@ async fn retrieve_label_values( }?; if let Some(ref plan) = result.meta.plan { - collect_plan_metrics(plan.clone(), &mut [metrics]); + collect_plan_metrics(plan, &mut [metrics]); } Ok(()) diff --git a/src/servers/src/http/prometheus_resp.rs b/src/servers/src/http/prometheus_resp.rs index c4da273df5..a5a8bdba91 100644 --- a/src/servers/src/http/prometheus_resp.rs +++ b/src/servers/src/http/prometheus_resp.rs @@ -132,7 +132,7 @@ impl PrometheusJsonResponse { if let Some(physical_plan) = result.meta.plan { let mut result_map = HashMap::new(); let mut tmp = vec![&mut result_map]; - collect_plan_metrics(physical_plan, &mut tmp); + collect_plan_metrics(&physical_plan, &mut tmp); let re = result_map .into_iter() diff --git a/src/servers/src/prom_store.rs b/src/servers/src/prom_store.rs index fc08b921a0..d548a843b5 100644 --- a/src/servers/src/prom_store.rs +++ b/src/servers/src/prom_store.rs @@ -107,11 +107,11 @@ pub fn query_to_plan(dataframe: DataFrame, q: &Query) -> Result { } // Case sensitive regexp match MatcherType::Re => { - conditions.push(regexp_match(col(name), lit(value)).is_not_null()); + conditions.push(regexp_match(col(name), lit(value), None).is_not_null()); } // Case sensitive regexp not match MatcherType::Nre => { - conditions.push(regexp_match(col(name), lit(value)).is_null()); + conditions.push(regexp_match(col(name), lit(value), None).is_null()); } } } diff --git a/src/servers/tests/py_script/mod.rs b/src/servers/tests/py_script/mod.rs index e5682220e5..fe1ac75c8d 100644 --- a/src/servers/tests/py_script/mod.rs +++ b/src/servers/tests/py_script/mod.rs @@ -28,6 +28,7 @@ use table::test_util::MemTable; use crate::create_testing_instance; +#[ignore = "rust-python backend is not active support at present"] #[tokio::test] async fn test_insert_py_udf_and_query() -> Result<()> { let catalog = "greptime"; diff --git a/src/sql/src/parsers/create_parser.rs b/src/sql/src/parsers/create_parser.rs index 8dc3f0c662..6cc2ff97ce 100644 --- a/src/sql/src/parsers/create_parser.rs +++ b/src/sql/src/parsers/create_parser.rs @@ -19,7 +19,7 @@ use datafusion_common::ScalarValue; use datatypes::arrow::datatypes::{DataType as ArrowDataType, IntervalUnit}; use itertools::Itertools; use snafu::{ensure, OptionExt, ResultExt}; -use sqlparser::ast::{ColumnOption, ColumnOptionDef, DataType, Expr}; +use sqlparser::ast::{ColumnOption, ColumnOptionDef, DataType, Expr, KeyOrIndexDisplay}; use sqlparser::dialect::keywords::Keyword; use sqlparser::keywords::ALL_KEYWORDS; use sqlparser::parser::IsOptional::Mandatory; @@ -483,8 +483,11 @@ impl<'a> ParserContext<'a> { value: column.name.value.clone(), quote_style: None, }], - is_primary: false, characteristics: None, + index_name: None, + index_type_display: KeyOrIndexDisplay::None, + index_type: None, + index_options: vec![], }; constraints.push(constraint); } @@ -653,10 +656,12 @@ impl<'a> ParserContext<'a> { .into_iter() .map(Self::canonicalize_identifier) .collect(); - Ok(Some(TableConstraint::Unique { + Ok(Some(TableConstraint::PrimaryKey { name, + index_name: None, + index_type: None, columns, - is_primary: true, + index_options: vec![], characteristics: None, })) } @@ -696,8 +701,11 @@ impl<'a> ParserContext<'a> { quote_style: None, }), columns, - is_primary: false, characteristics: None, + index_name: None, + index_type_display: KeyOrIndexDisplay::None, + index_type: None, + index_options: vec![], })) } unexpected => { @@ -741,7 +749,6 @@ fn validate_time_index(columns: &[ColumnDef], constraints: &[TableConstraint]) - if let TableConstraint::Unique { name: Some(ident), columns, - is_primary: false, .. } = c { @@ -1035,20 +1042,11 @@ mod tests { assert_column_def(&columns[3], "memory", "FLOAT64"); let constraints = &c.constraints; - assert_matches!( - &constraints[0], - TableConstraint::Unique { - is_primary: false, + assert!(matches!(&constraints[0], TableConstraint::Unique { + name: Some(name), .. - } - ); - assert_matches!( - &constraints[1], - TableConstraint::Unique { - is_primary: true, - .. - } - ); + } if name.value == TIME_INDEX)); + assert_matches!(&constraints[1], TableConstraint::PrimaryKey { .. }); } _ => unreachable!(), } @@ -1354,16 +1352,10 @@ ENGINE=mito"; assert_eq!(c.constraints.len(), 2); let tc = c.constraints[0].clone(); match tc { - TableConstraint::Unique { - name, - columns, - is_primary, - .. - } => { + TableConstraint::Unique { name, columns, .. } => { assert_eq!(name.unwrap().to_string(), "__time_index"); assert_eq!(columns.len(), 1); assert_eq!(&columns[0].value, "ts"); - assert!(!is_primary); } _ => panic!("should be time index constraint"), }; @@ -1561,16 +1553,10 @@ ENGINE=mito"; if let Statement::CreateTable(c) = &result[0] { let tc = c.constraints[0].clone(); match tc { - TableConstraint::Unique { - name, - columns, - is_primary, - .. - } => { + TableConstraint::Unique { name, columns, .. } => { assert_eq!(name.unwrap().to_string(), "__time_index"); assert_eq!(columns.len(), 1); assert_eq!(&columns[0].value, "ts"); - assert!(!is_primary); } _ => panic!("should be time index constraint"), } @@ -1677,20 +1663,11 @@ ENGINE=mito"; assert_column_def(&columns[3], "memory", "FLOAT64"); let constraints = &c.constraints; - assert_matches!( - &constraints[0], - TableConstraint::Unique { - is_primary: false, + assert!(matches!(&constraints[0], TableConstraint::Unique { + name: Some(name), .. - } - ); - assert_matches!( - &constraints[1], - TableConstraint::Unique { - is_primary: true, - .. - } - ); + } if name.value == TIME_INDEX)); + assert_matches!(&constraints[1], TableConstraint::PrimaryKey { .. }); assert_eq!(1, c.options.len()); assert_eq!( [("ttl", "10s")].into_iter().collect::>(), diff --git a/src/sql/src/parsers/utils.rs b/src/sql/src/parsers/utils.rs index 97b317dd36..7332d3e0e8 100644 --- a/src/sql/src/parsers/utils.rs +++ b/src/sql/src/parsers/utils.rs @@ -98,15 +98,15 @@ impl ContextProvider for StubContextProvider { unimplemented!() } - fn udfs_names(&self) -> Vec { + fn udf_names(&self) -> Vec { self.state.scalar_functions().keys().cloned().collect() } - fn udafs_names(&self) -> Vec { + fn udaf_names(&self) -> Vec { self.state.aggregate_functions().keys().cloned().collect() } - fn udwfs_names(&self) -> Vec { + fn udwf_names(&self) -> Vec { self.state.window_functions().keys().cloned().collect() } } diff --git a/src/sql/src/statements/create.rs b/src/sql/src/statements/create.rs index 4259d61cc5..9bcf65c675 100644 --- a/src/sql/src/statements/create.rs +++ b/src/sql/src/statements/create.rs @@ -72,7 +72,6 @@ pub const TIME_INDEX: &str = "__time_index"; pub fn is_time_index(constraint: &TableConstraint) -> bool { matches!(constraint, TableConstraint::Unique { name: Some(name), - is_primary: false, .. } if name.value == TIME_INDEX) } diff --git a/src/table/src/table/scan.rs b/src/table/src/table/scan.rs index c612ff3746..a68e0221ce 100644 --- a/src/table/src/table/scan.rs +++ b/src/table/src/table/scan.rs @@ -84,7 +84,7 @@ impl ExecutionPlan for RegionScanExec { &self.properties } - fn children(&self) -> Vec> { + fn children(&self) -> Vec<&Arc> { vec![] } diff --git a/tests/cases/distributed/explain/join_10_tables.result b/tests/cases/distributed/explain/join_10_tables.result index f44fc41fa7..172d43aa1d 100644 --- a/tests/cases/distributed/explain/join_10_tables.result +++ b/tests/cases/distributed/explain/join_10_tables.result @@ -75,7 +75,6 @@ limit 1; +-+-+ | logical_plan_| Limit: skip=0, fetch=1_| |_|_Sort: t_1.ts DESC NULLS FIRST, fetch=1_| -|_|_Projection: t_1.ts, t_1.vin, t_1.val, t_2.ts, t_2.vin, t_2.val, t_3.ts, t_3.vin, t_3.val, t_4.ts, t_4.vin, t_4.val, t_5.ts, t_5.vin, t_5.val, t_6.ts, t_6.vin, t_6.val, t_7.ts, t_7.vin, t_7.val, t_8.ts, t_8.vin, t_8.val, t_9.ts, t_9.vin, t_9.val, t_10.ts, t_10.vin, t_10.val | |_|_Inner Join: t_9.ts = t_10.ts, t_9.vin = t_10.vin_| |_|_Inner Join: t_8.ts = t_9.ts, t_8.vin = t_9.vin_| |_|_Inner Join: t_7.ts = t_8.ts, t_7.vin = t_8.vin_| @@ -99,7 +98,7 @@ limit 1; |_|_MergeScan [is_placeholder=false]_| | physical_plan | GlobalLimitExec: skip=0, fetch=1_| |_|_SortPreservingMergeExec: [ts@0 DESC], fetch=1_| -|_|_SortExec: TopK(fetch=1), expr=[ts@0 DESC]_| +|_|_SortExec: TopK(fetch=1), expr=[ts@0 DESC], preserve_partitioning=[true]_| |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| diff --git a/tests/cases/distributed/explain/multi_partitions.result b/tests/cases/distributed/explain/multi_partitions.result index 1053ede24b..660a4eee30 100644 --- a/tests/cases/distributed/explain/multi_partitions.result +++ b/tests/cases/distributed/explain/multi_partitions.result @@ -27,7 +27,7 @@ explain SELECT * FROM demo WHERE ts > cast(1000000000 as timestamp) ORDER BY hos +-+-+ | logical_plan_| Sort: demo.host ASC NULLS LAST_| |_|_MergeScan [is_placeholder=false]_| -| physical_plan | SortExec: expr=[host@0 ASC NULLS LAST]_| +| physical_plan | SortExec: expr=[host@0 ASC NULLS LAST], preserve_partitioning=[false]_| |_|_MergeScanExec: REDACTED |_|_| +-+-+ diff --git a/tests/cases/distributed/explain/order_by.result b/tests/cases/distributed/explain/order_by.result index 4d08b3e861..221ac05fcd 100644 --- a/tests/cases/distributed/explain/order_by.result +++ b/tests/cases/distributed/explain/order_by.result @@ -16,7 +16,7 @@ EXPLAIN SELECT DISTINCT i%2 FROM integers ORDER BY 1; |_|_Aggregate: groupBy=[[integers.i % Int64(2)]], aggr=[[]]_| |_|_MergeScan [is_placeholder=false]_| | physical_plan | SortPreservingMergeExec: [integers.i % Int64(2)@0 ASC NULLS LAST]_| -|_|_SortExec: expr=[integers.i % Int64(2)@0 ASC NULLS LAST]_| +|_|_SortExec: expr=[integers.i % Int64(2)@0 ASC NULLS LAST], preserve_partitioning=[true]_| |_|_AggregateExec: mode=FinalPartitioned, gby=[integers.i % Int64(2)@0 as integers.i % Int64(2)], aggr=[] | |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED @@ -63,7 +63,7 @@ EXPLAIN SELECT DISTINCT a, b FROM test ORDER BY a, b; |_|_Aggregate: groupBy=[[test.a, test.b]], aggr=[[]]_| |_|_MergeScan [is_placeholder=false]_| | physical_plan | SortPreservingMergeExec: [a@0 ASC NULLS LAST,b@1 ASC NULLS LAST]_| -|_|_SortExec: expr=[a@0 ASC NULLS LAST,b@1 ASC NULLS LAST]_| +|_|_SortExec: expr=[a@0 ASC NULLS LAST,b@1 ASC NULLS LAST], preserve_partitioning=[true] | |_|_AggregateExec: mode=FinalPartitioned, gby=[a@0 as a, b@1 as b], aggr=[]_| |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_RepartitionExec: partitioning=REDACTED diff --git a/tests/cases/distributed/explain/subqueries.result b/tests/cases/distributed/explain/subqueries.result index ad31923c97..f0e41496a4 100644 --- a/tests/cases/distributed/explain/subqueries.result +++ b/tests/cases/distributed/explain/subqueries.result @@ -13,14 +13,12 @@ EXPLAIN SELECT * FROM integers WHERE i IN ((SELECT i FROM integers)) ORDER BY i; | plan_type_| plan_| +-+-+ | logical_plan_| Sort: integers.i ASC NULLS LAST_| -|_|_Projection: integers.i, integers.j_| |_|_LeftSemi Join: integers.i = __correlated_sq_1.i_| |_|_MergeScan [is_placeholder=false]_| |_|_SubqueryAlias: __correlated_sq_1_| -|_|_Projection: integers.i_| |_|_MergeScan [is_placeholder=false]_| | physical_plan | SortPreservingMergeExec: [i@0 ASC NULLS LAST]_| -|_|_SortExec: expr=[i@0 ASC NULLS LAST]_| +|_|_SortExec: expr=[i@0 ASC NULLS LAST], preserve_partitioning=[true]_| |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| @@ -43,7 +41,6 @@ EXPLAIN SELECT * FROM integers i1 WHERE EXISTS(SELECT i FROM integers WHERE i=i1 | plan_type_| plan_| +-+-+ | logical_plan_| Sort: i1.i ASC NULLS LAST_| -|_|_Projection: i1.i, i1.j_| |_|_LeftSemi Join: i1.i = __correlated_sq_1.i_| |_|_SubqueryAlias: i1_| |_|_MergeScan [is_placeholder=false]_| @@ -51,7 +48,7 @@ EXPLAIN SELECT * FROM integers i1 WHERE EXISTS(SELECT i FROM integers WHERE i=i1 |_|_Projection: integers.i_| |_|_MergeScan [is_placeholder=false]_| | physical_plan | SortPreservingMergeExec: [i@0 ASC NULLS LAST]_| -|_|_SortExec: expr=[i@0 ASC NULLS LAST]_| +|_|_SortExec: expr=[i@0 ASC NULLS LAST], preserve_partitioning=[true]_| |_|_CoalesceBatchesExec: target_batch_size=8192_| |_|_REDACTED |_|_CoalesceBatchesExec: target_batch_size=8192_| @@ -92,7 +89,7 @@ order by t.i desc; |_|_Projection:_| |_|_MergeScan [is_placeholder=false]_| | physical_plan | SortPreservingMergeExec: [i@0 DESC]_| -|_|_SortExec: expr=[i@0 DESC]_| +|_|_SortExec: expr=[i@0 DESC], preserve_partitioning=[true]_| |_|_CrossJoinExec_| |_|_CoalescePartitionsExec_| |_|_CoalesceBatchesExec: target_batch_size=8192_| @@ -117,8 +114,7 @@ EXPLAIN INSERT INTO other SELECT i, 2 FROM integers WHERE i=(SELECT MAX(i) FROM | | Projection: integers.i | | | MergeScan [is_placeholder=false] | | | SubqueryAlias: __scalar_sq_1 | -| | Projection: MAX(integers.i) | -| | MergeScan [is_placeholder=false] | +| | MergeScan [is_placeholder=false] | +--------------+-------------------------------------------------------------------+ drop table other; diff --git a/tests/cases/distributed/optimizer/order_by.result b/tests/cases/distributed/optimizer/order_by.result index 5c03ac107c..c5c8b09adf 100644 --- a/tests/cases/distributed/optimizer/order_by.result +++ b/tests/cases/distributed/optimizer/order_by.result @@ -12,50 +12,50 @@ explain select * from numbers; -- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number desc; -+---------------+-------------------------------------------------------+ -| plan_type | plan | -+---------------+-------------------------------------------------------+ -| logical_plan | MergeScan [is_placeholder=false] | -| physical_plan | SortExec: expr=[number@0 DESC] | -| | SinglePartitionScanner: | -| | | -+---------------+-------------------------------------------------------+ ++---------------+---------------------------------------------------------------+ +| plan_type | plan | ++---------------+---------------------------------------------------------------+ +| logical_plan | MergeScan [is_placeholder=false] | +| physical_plan | SortExec: expr=[number@0 DESC], preserve_partitioning=[false] | +| | SinglePartitionScanner: | +| | | ++---------------+---------------------------------------------------------------+ -- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number asc; -+---------------+-------------------------------------------------------+ -| plan_type | plan | -+---------------+-------------------------------------------------------+ -| logical_plan | MergeScan [is_placeholder=false] | -| physical_plan | SortExec: expr=[number@0 ASC NULLS LAST] | -| | SinglePartitionScanner: | -| | | -+---------------+-------------------------------------------------------+ ++---------------+-------------------------------------------------------------------------+ +| plan_type | plan | ++---------------+-------------------------------------------------------------------------+ +| logical_plan | MergeScan [is_placeholder=false] | +| physical_plan | SortExec: expr=[number@0 ASC NULLS LAST], preserve_partitioning=[false] | +| | SinglePartitionScanner: | +| | | ++---------------+-------------------------------------------------------------------------+ -- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number desc limit 10; -+---------------+---------------------------------------------------------+ -| plan_type | plan | -+---------------+---------------------------------------------------------+ -| logical_plan | MergeScan [is_placeholder=false] | -| physical_plan | GlobalLimitExec: skip=0, fetch=10 | -| | SortExec: TopK(fetch=10), expr=[number@0 DESC] | -| | SinglePartitionScanner: | -| | | -+---------------+---------------------------------------------------------+ ++---------------+---------------------------------------------------------------------------------+ +| plan_type | plan | ++---------------+---------------------------------------------------------------------------------+ +| logical_plan | MergeScan [is_placeholder=false] | +| physical_plan | GlobalLimitExec: skip=0, fetch=10 | +| | SortExec: TopK(fetch=10), expr=[number@0 DESC], preserve_partitioning=[false] | +| | SinglePartitionScanner: | +| | | ++---------------+---------------------------------------------------------------------------------+ -- SQLNESS REPLACE (peers.*) REDACTED explain select * from numbers order by number asc limit 10; -+---------------+------------------------------------------------------------+ -| plan_type | plan | -+---------------+------------------------------------------------------------+ -| logical_plan | MergeScan [is_placeholder=false] | -| physical_plan | GlobalLimitExec: skip=0, fetch=10 | -| | SortExec: TopK(fetch=10), expr=[number@0 ASC NULLS LAST] | -| | SinglePartitionScanner: | -| | | -+---------------+------------------------------------------------------------+ ++---------------+-------------------------------------------------------------------------------------------+ +| plan_type | plan | ++---------------+-------------------------------------------------------------------------------------------+ +| logical_plan | MergeScan [is_placeholder=false] | +| physical_plan | GlobalLimitExec: skip=0, fetch=10 | +| | SortExec: TopK(fetch=10), expr=[number@0 ASC NULLS LAST], preserve_partitioning=[false] | +| | SinglePartitionScanner: | +| | | ++---------------+-------------------------------------------------------------------------------------------+ diff --git a/tests/cases/standalone/common/aggregate/distinct_order_by.result b/tests/cases/standalone/common/aggregate/distinct_order_by.result index 29028359e0..38efd531ef 100644 --- a/tests/cases/standalone/common/aggregate/distinct_order_by.result +++ b/tests/cases/standalone/common/aggregate/distinct_order_by.result @@ -25,7 +25,7 @@ SELECT DISTINCT i%2 FROM integers ORDER BY 1; -- +-----------------------+ SELECT DISTINCT i % 2 FROM integers WHERE i<3 ORDER BY i; -Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: For SELECT DISTINCT, ORDER BY expressions i must appear in select list +Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: For SELECT DISTINCT, ORDER BY expressions integers.i must appear in select list SELECT DISTINCT ON (1) i % 2, i FROM integers WHERE i<3 ORDER BY i; diff --git a/tests/cases/standalone/common/aggregate/sum.result b/tests/cases/standalone/common/aggregate/sum.result index 4c54f1bef8..5221e27761 100644 --- a/tests/cases/standalone/common/aggregate/sum.result +++ b/tests/cases/standalone/common/aggregate/sum.result @@ -24,7 +24,11 @@ SELECT SUM(-1) FROM numbers; SELECT SUM(-1) FROM numbers WHERE number=-1; -Error: 3001(EngineExecuteQuery), DataFusion error: Cast error: Can't cast value -1 to type UInt32 ++----------------+ +| SUM(Int64(-1)) | ++----------------+ +| | ++----------------+ SELECT SUM(-1) FROM numbers WHERE number>10000 limit 1000; diff --git a/tests/cases/standalone/common/range/calculate.result b/tests/cases/standalone/common/range/calculate.result index 97d527968b..50030a29ee 100644 --- a/tests/cases/standalone/common/range/calculate.result +++ b/tests/cases/standalone/common/range/calculate.result @@ -23,18 +23,18 @@ Affected Rows: 10 -- Test range expr calculate SELECT ts, host, covar(val::DOUBLE, val::DOUBLE) RANGE '20s' FROM host ALIGN '10s' ORDER BY host, ts; -+---------------------+-------+------------------------------------+ -| ts | host | COVAR(host.val,host.val) RANGE 20s | -+---------------------+-------+------------------------------------+ -| 1969-12-31T23:59:50 | host1 | | -| 1970-01-01T00:00:00 | host1 | 0.5 | -| 1970-01-01T00:00:10 | host1 | 0.5 | -| 1970-01-01T00:00:20 | host1 | | -| 1969-12-31T23:59:50 | host2 | | -| 1970-01-01T00:00:00 | host2 | 0.5 | -| 1970-01-01T00:00:10 | host2 | 0.5 | -| 1970-01-01T00:00:20 | host2 | | -+---------------------+-------+------------------------------------+ ++---------------------+-------+-----------------------------------------+ +| ts | host | covar_samp(host.val,host.val) RANGE 20s | ++---------------------+-------+-----------------------------------------+ +| 1969-12-31T23:59:50 | host1 | | +| 1970-01-01T00:00:00 | host1 | 0.5 | +| 1970-01-01T00:00:10 | host1 | 0.5 | +| 1970-01-01T00:00:20 | host1 | | +| 1969-12-31T23:59:50 | host2 | | +| 1970-01-01T00:00:00 | host2 | 0.5 | +| 1970-01-01T00:00:10 | host2 | 0.5 | +| 1970-01-01T00:00:20 | host2 | | ++---------------------+-------+-----------------------------------------+ SELECT ts, host, 2 * min(val) RANGE '5s' FROM host ALIGN '5s' ORDER BY host, ts; @@ -139,18 +139,18 @@ SELECT ts, host, (min(val) + max(val)) RANGE '20s' + 1.0 FROM host ALIGN '10s' O SELECT ts, host, covar(ceil(val::DOUBLE), floor(val::DOUBLE)) RANGE '20s' FROM host ALIGN '10s' ORDER BY host, ts; -+---------------------+-------+-------------------------------------------------+ -| ts | host | COVAR(ceil(host.val),floor(host.val)) RANGE 20s | -+---------------------+-------+-------------------------------------------------+ -| 1969-12-31T23:59:50 | host1 | | -| 1970-01-01T00:00:00 | host1 | 0.5 | -| 1970-01-01T00:00:10 | host1 | 0.5 | -| 1970-01-01T00:00:20 | host1 | | -| 1969-12-31T23:59:50 | host2 | | -| 1970-01-01T00:00:00 | host2 | 0.5 | -| 1970-01-01T00:00:10 | host2 | 0.5 | -| 1970-01-01T00:00:20 | host2 | | -+---------------------+-------+-------------------------------------------------+ ++---------------------+-------+------------------------------------------------------+ +| ts | host | covar_samp(ceil(host.val),floor(host.val)) RANGE 20s | ++---------------------+-------+------------------------------------------------------+ +| 1969-12-31T23:59:50 | host1 | | +| 1970-01-01T00:00:00 | host1 | 0.5 | +| 1970-01-01T00:00:10 | host1 | 0.5 | +| 1970-01-01T00:00:20 | host1 | | +| 1969-12-31T23:59:50 | host2 | | +| 1970-01-01T00:00:00 | host2 | 0.5 | +| 1970-01-01T00:00:10 | host2 | 0.5 | +| 1970-01-01T00:00:20 | host2 | | ++---------------------+-------+------------------------------------------------------+ SELECT ts, host, floor(cos(ceil(sin(min(val) RANGE '5s')))) FROM host ALIGN '5s' ORDER BY host, ts; diff --git a/tests/cases/standalone/common/range/error.result b/tests/cases/standalone/common/range/error.result index ecdaac7d78..020a9a7d4c 100644 --- a/tests/cases/standalone/common/range/error.result +++ b/tests/cases/standalone/common/range/error.result @@ -59,18 +59,18 @@ Error: 3000(PlanQuery), DataFusion error: Error during planning: Missing argumen -- 2.3 type mismatch SELECT covar(ceil(val), floor(val)) RANGE '20s' FROM host ALIGN '10s'; -+-------------------------------------------------+ -| COVAR(ceil(host.val),floor(host.val)) RANGE 20s | -+-------------------------------------------------+ -| | -| 0.5 | -| 0.5 | -| | -| | -| 0.5 | -| 0.5 | -| | -+-------------------------------------------------+ ++------------------------------------------------------+ +| covar_samp(ceil(host.val),floor(host.val)) RANGE 20s | ++------------------------------------------------------+ +| | +| 0.5 | +| 0.5 | +| | +| | +| 0.5 | +| 0.5 | +| | ++------------------------------------------------------+ -- 2.4 nest query SELECT min(max(val) RANGE '20s') RANGE '20s' FROM host ALIGN '10s'; diff --git a/tests/cases/standalone/common/range/special_aggr.result b/tests/cases/standalone/common/range/special_aggr.result index 2240d74438..449a5534c1 100644 --- a/tests/cases/standalone/common/range/special_aggr.result +++ b/tests/cases/standalone/common/range/special_aggr.result @@ -44,7 +44,7 @@ Affected Rows: 30 SELECT ts, host, first_value(val) RANGE '5s', last_value(val) RANGE '5s' FROM host ALIGN '5s' ORDER BY host, ts; +---------------------+-------+--------------------------------+-------------------------------+ -| ts | host | FIRST_VALUE(host.val) RANGE 5s | LAST_VALUE(host.val) RANGE 5s | +| ts | host | first_value(host.val) RANGE 5s | last_value(host.val) RANGE 5s | +---------------------+-------+--------------------------------+-------------------------------+ | 1970-01-01T00:00:00 | host1 | 0 | 2 | | 1970-01-01T00:00:05 | host1 | | | @@ -61,7 +61,7 @@ SELECT ts, host, first_value(val) RANGE '5s', last_value(val) RANGE '5s' FROM ho SELECT ts, host, first_value(addon ORDER BY val DESC) RANGE '5s', last_value(addon ORDER BY val DESC) RANGE '5s' FROM host ALIGN '5s' ORDER BY host, ts; +---------------------+-------+-----------------------------------------------------------------------+----------------------------------------------------------------------+ -| ts | host | FIRST_VALUE(host.addon) ORDER BY [host.val DESC NULLS FIRST] RANGE 5s | LAST_VALUE(host.addon) ORDER BY [host.val DESC NULLS FIRST] RANGE 5s | +| ts | host | first_value(host.addon) ORDER BY [host.val DESC NULLS FIRST] RANGE 5s | last_value(host.addon) ORDER BY [host.val DESC NULLS FIRST] RANGE 5s | +---------------------+-------+-----------------------------------------------------------------------+----------------------------------------------------------------------+ | 1970-01-01T00:00:00 | host1 | 3 | 1 | | 1970-01-01T00:00:05 | host1 | 4 | 4 | @@ -78,7 +78,7 @@ SELECT ts, host, first_value(addon ORDER BY val DESC) RANGE '5s', last_value(add SELECT ts, host, first_value(addon ORDER BY val DESC NULLS LAST) RANGE '5s', last_value(addon ORDER BY val DESC NULLS LAST) RANGE '5s' FROM host ALIGN '5s' ORDER BY host, ts; +---------------------+-------+----------------------------------------------------------------------+---------------------------------------------------------------------+ -| ts | host | FIRST_VALUE(host.addon) ORDER BY [host.val DESC NULLS LAST] RANGE 5s | LAST_VALUE(host.addon) ORDER BY [host.val DESC NULLS LAST] RANGE 5s | +| ts | host | first_value(host.addon) ORDER BY [host.val DESC NULLS LAST] RANGE 5s | last_value(host.addon) ORDER BY [host.val DESC NULLS LAST] RANGE 5s | +---------------------+-------+----------------------------------------------------------------------+---------------------------------------------------------------------+ | 1970-01-01T00:00:00 | host1 | 3 | 1 | | 1970-01-01T00:00:05 | host1 | 4 | 4 | @@ -95,7 +95,7 @@ SELECT ts, host, first_value(addon ORDER BY val DESC NULLS LAST) RANGE '5s', las SELECT ts, host, first_value(addon ORDER BY val ASC) RANGE '5s', last_value(addon ORDER BY val ASC) RANGE '5s' FROM host ALIGN '5s' ORDER BY host, ts; +---------------------+-------+---------------------------------------------------------------------+--------------------------------------------------------------------+ -| ts | host | FIRST_VALUE(host.addon) ORDER BY [host.val ASC NULLS LAST] RANGE 5s | LAST_VALUE(host.addon) ORDER BY [host.val ASC NULLS LAST] RANGE 5s | +| ts | host | first_value(host.addon) ORDER BY [host.val ASC NULLS LAST] RANGE 5s | last_value(host.addon) ORDER BY [host.val ASC NULLS LAST] RANGE 5s | +---------------------+-------+---------------------------------------------------------------------+--------------------------------------------------------------------+ | 1970-01-01T00:00:00 | host1 | 1 | 3 | | 1970-01-01T00:00:05 | host1 | 4 | 4 | @@ -112,7 +112,7 @@ SELECT ts, host, first_value(addon ORDER BY val ASC) RANGE '5s', last_value(addo SELECT ts, host, first_value(addon ORDER BY val ASC NULLS FIRST) RANGE '5s', last_value(addon ORDER BY val ASC NULLS FIRST) RANGE '5s' FROM host ALIGN '5s' ORDER BY host, ts; +---------------------+-------+----------------------------------------------------------------------+---------------------------------------------------------------------+ -| ts | host | FIRST_VALUE(host.addon) ORDER BY [host.val ASC NULLS FIRST] RANGE 5s | LAST_VALUE(host.addon) ORDER BY [host.val ASC NULLS FIRST] RANGE 5s | +| ts | host | first_value(host.addon) ORDER BY [host.val ASC NULLS FIRST] RANGE 5s | last_value(host.addon) ORDER BY [host.val ASC NULLS FIRST] RANGE 5s | +---------------------+-------+----------------------------------------------------------------------+---------------------------------------------------------------------+ | 1970-01-01T00:00:00 | host1 | 1 | 3 | | 1970-01-01T00:00:05 | host1 | 4 | 4 | @@ -129,7 +129,7 @@ SELECT ts, host, first_value(addon ORDER BY val ASC NULLS FIRST) RANGE '5s', las SELECT ts, host, first_value(addon ORDER BY val ASC, ts ASC) RANGE '5s', last_value(addon ORDER BY val ASC, ts ASC) RANGE '5s' FROM host ALIGN '5s' ORDER BY host, ts; +---------------------+-------+---------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ -| ts | host | FIRST_VALUE(host.addon) ORDER BY [host.val ASC NULLS LAST, host.ts ASC NULLS LAST] RANGE 5s | LAST_VALUE(host.addon) ORDER BY [host.val ASC NULLS LAST, host.ts ASC NULLS LAST] RANGE 5s | +| ts | host | first_value(host.addon) ORDER BY [host.val ASC NULLS LAST, host.ts ASC NULLS LAST] RANGE 5s | last_value(host.addon) ORDER BY [host.val ASC NULLS LAST, host.ts ASC NULLS LAST] RANGE 5s | +---------------------+-------+---------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+ | 1970-01-01T00:00:00 | host1 | 1 | 3 | | 1970-01-01T00:00:05 | host1 | 4 | 6 | @@ -231,9 +231,7 @@ 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: 3000(PlanQuery), Failed to plan SQL: Error during planning: 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(Int8/Int16/Int32/Int64/UInt8/UInt16/UInt32/UInt64/Float32/Float64) +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. DROP TABLE host; @@ -259,7 +257,7 @@ Affected Rows: 3 SELECT ts, first_value(val ORDER BY addon ASC) RANGE '5s', last_value(val ORDER BY addon ASC) RANGE '5s' FROM host ALIGN '5s'; +---------------------+---------------------------------------------------------------------+--------------------------------------------------------------------+ -| ts | FIRST_VALUE(host.val) ORDER BY [host.addon ASC NULLS LAST] RANGE 5s | LAST_VALUE(host.val) ORDER BY [host.addon ASC NULLS LAST] RANGE 5s | +| ts | first_value(host.val) ORDER BY [host.addon ASC NULLS LAST] RANGE 5s | last_value(host.val) ORDER BY [host.addon ASC NULLS LAST] RANGE 5s | +---------------------+---------------------------------------------------------------------+--------------------------------------------------------------------+ | 1970-01-01T00:00:00 | 2 | 0 | +---------------------+---------------------------------------------------------------------+--------------------------------------------------------------------+ diff --git a/tests/cases/standalone/common/tql-explain-analyze/analyze.result b/tests/cases/standalone/common/tql-explain-analyze/analyze.result index e8e388b916..e3bbc84e42 100644 --- a/tests/cases/standalone/common/tql-explain-analyze/analyze.result +++ b/tests/cases/standalone/common/tql-explain-analyze/analyze.result @@ -21,12 +21,12 @@ TQL ANALYZE (0, 10, '5s') test; | 0_| 0_|_PromInstantManipulateExec: range=[0..10000], lookback=[300000], interval=[5000], time index=[j] REDACTED |_|_|_PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false] REDACTED |_|_|_PromSeriesDivideExec: tags=["k"] REDACTED -|_|_|_SortExec: expr=[k@2 ASC NULLS LAST] REDACTED +|_|_|_SortExec: expr=[k@2 ASC NULLS LAST], preserve_partitioning=[false] REDACTED |_|_|_MergeScanExec: REDACTED |_|_|_| | 1_| 0_|_SortPreservingMergeExec: [k@2 DESC NULLS LAST,j@1 DESC NULLS LAST] REDACTED |_|_|_CoalesceBatchesExec: target_batch_size=8192 REDACTED -|_|_|_SortExec: expr=[k@2 DESC NULLS LAST,j@1 DESC NULLS LAST] REDACTED +|_|_|_SortExec: expr=[k@2 DESC NULLS LAST,j@1 DESC NULLS LAST], preserve_partitioning=[true] REDACTED |_|_|_CoalesceBatchesExec: target_batch_size=8192 REDACTED |_|_|_FilterExec: j@1 >= -300000 AND j@1 <= 310000 REDACTED |_|_|_RepartitionExec: partitioning=REDACTED @@ -50,12 +50,12 @@ TQL ANALYZE (0, 10, '1s', '2s') test; | 0_| 0_|_PromInstantManipulateExec: range=[0..10000], lookback=[2000], interval=[1000], time index=[j] REDACTED |_|_|_PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false] REDACTED |_|_|_PromSeriesDivideExec: tags=["k"] REDACTED -|_|_|_SortExec: expr=[k@2 ASC NULLS LAST] REDACTED +|_|_|_SortExec: expr=[k@2 ASC NULLS LAST], preserve_partitioning=[false] REDACTED |_|_|_MergeScanExec: REDACTED |_|_|_| | 1_| 0_|_SortPreservingMergeExec: [k@2 DESC NULLS LAST,j@1 DESC NULLS LAST] REDACTED |_|_|_CoalesceBatchesExec: target_batch_size=8192 REDACTED -|_|_|_SortExec: expr=[k@2 DESC NULLS LAST,j@1 DESC NULLS LAST] REDACTED +|_|_|_SortExec: expr=[k@2 DESC NULLS LAST,j@1 DESC NULLS LAST], preserve_partitioning=[true] REDACTED |_|_|_CoalesceBatchesExec: target_batch_size=8192 REDACTED |_|_|_FilterExec: j@1 >= -2000 AND j@1 <= 12000 REDACTED |_|_|_RepartitionExec: partitioning=REDACTED @@ -78,12 +78,12 @@ TQL ANALYZE ('1970-01-01T00:00:00'::timestamp, '1970-01-01T00:00:00'::timestamp | 0_| 0_|_PromInstantManipulateExec: range=[0..10000], lookback=[300000], interval=[5000], time index=[j] REDACTED |_|_|_PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false] REDACTED |_|_|_PromSeriesDivideExec: tags=["k"] REDACTED -|_|_|_SortExec: expr=[k@2 ASC NULLS LAST] REDACTED +|_|_|_SortExec: expr=[k@2 ASC NULLS LAST], preserve_partitioning=[false] REDACTED |_|_|_MergeScanExec: REDACTED |_|_|_| | 1_| 0_|_SortPreservingMergeExec: [k@2 DESC NULLS LAST,j@1 DESC NULLS LAST] REDACTED |_|_|_CoalesceBatchesExec: target_batch_size=8192 REDACTED -|_|_|_SortExec: expr=[k@2 DESC NULLS LAST,j@1 DESC NULLS LAST] REDACTED +|_|_|_SortExec: expr=[k@2 DESC NULLS LAST,j@1 DESC NULLS LAST], preserve_partitioning=[true] REDACTED |_|_|_CoalesceBatchesExec: target_batch_size=8192 REDACTED |_|_|_FilterExec: j@1 >= -300000 AND j@1 <= 310000 REDACTED |_|_|_RepartitionExec: partitioning=REDACTED @@ -108,12 +108,12 @@ TQL ANALYZE VERBOSE (0, 10, '5s') test; | 0_| 0_|_PromInstantManipulateExec: range=[0..10000], lookback=[300000], interval=[5000], time index=[j] REDACTED |_|_|_PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false] REDACTED |_|_|_PromSeriesDivideExec: tags=["k"] REDACTED -|_|_|_SortExec: expr=[k@2 ASC NULLS LAST] REDACTED +|_|_|_SortExec: expr=[k@2 ASC NULLS LAST], preserve_partitioning=[false] REDACTED |_|_|_MergeScanExec: REDACTED |_|_|_| | 1_| 0_|_SortPreservingMergeExec: [k@2 DESC NULLS LAST,j@1 DESC NULLS LAST] REDACTED |_|_|_CoalesceBatchesExec: target_batch_size=8192 REDACTED -|_|_|_SortExec: expr=[k@2 DESC NULLS LAST,j@1 DESC NULLS LAST] REDACTED +|_|_|_SortExec: expr=[k@2 DESC NULLS LAST,j@1 DESC NULLS LAST], preserve_partitioning=[true] REDACTED |_|_|_CoalesceBatchesExec: target_batch_size=8192 REDACTED |_|_|_FilterExec: j@1 >= -300000 AND j@1 <= 310000 REDACTED |_|_|_RepartitionExec: partitioning=REDACTED diff --git a/tests/cases/standalone/common/tql-explain-analyze/explain.result b/tests/cases/standalone/common/tql-explain-analyze/explain.result index a49624011d..c1b55e665c 100644 --- a/tests/cases/standalone/common/tql-explain-analyze/explain.result +++ b/tests/cases/standalone/common/tql-explain-analyze/explain.result @@ -22,7 +22,7 @@ TQL EXPLAIN (0, 10, '5s') test; | physical_plan | PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[300000], time index=[j] | | | PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false] | | | PromSeriesDivideExec: tags=["k"] | -| | SortExec: expr=[k@2 ASC NULLS LAST] | +| | SortExec: expr=[k@2 ASC NULLS LAST], preserve_partitioning=[false] | | | MergeScanExec: REDACTED | | | +---------------+-----------------------------------------------------------------------------------------------+ @@ -43,7 +43,7 @@ TQL EXPLAIN (0, 10, '1s', '2s') test; | physical_plan | PromInstantManipulateExec: range=[0..0], lookback=[2000], interval=[300000], time index=[j] | | | PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false] | | | PromSeriesDivideExec: tags=["k"] | -| | SortExec: expr=[k@2 ASC NULLS LAST] | +| | SortExec: expr=[k@2 ASC NULLS LAST], preserve_partitioning=[false] | | | MergeScanExec: REDACTED | | | +---------------+---------------------------------------------------------------------------------------------+ @@ -63,7 +63,7 @@ TQL EXPLAIN ('1970-01-01T00:00:00'::timestamp, '1970-01-01T00:00:00'::timestamp | physical_plan | PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[300000], time index=[j] | | | PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false] | | | PromSeriesDivideExec: tags=["k"] | -| | SortExec: expr=[k@2 ASC NULLS LAST] | +| | SortExec: expr=[k@2 ASC NULLS LAST], preserve_partitioning=[false] | | | MergeScanExec: REDACTED | | | +---------------+-----------------------------------------------------------------------------------------------+ @@ -120,6 +120,7 @@ TQL EXPLAIN VERBOSE (0, 10, '5s') test; | logical_plan after simplify_expressions_| SAME TEXT AS ABOVE_| | logical_plan after unwrap_cast_in_comparison_| SAME TEXT AS ABOVE_| | logical_plan after common_sub_expression_eliminate_| SAME TEXT AS ABOVE_| +| logical_plan after eliminate_group_by_constant_| SAME TEXT AS ABOVE_| | logical_plan after optimize_projections_| SAME TEXT AS ABOVE_| | logical_plan after OrderHintRule_| SAME TEXT AS ABOVE_| | logical_plan_| PromInstantManipulate: range=[0..0], lookback=[300000], interval=[300000], time index=[j]_| @@ -151,31 +152,32 @@ TQL EXPLAIN VERBOSE (0, 10, '5s') test; |_|_PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[300000], time index=[j]_| |_|_PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false]_| |_|_PromSeriesDivideExec: tags=["k"]_| -|_|_SortExec: expr=[k@2 ASC NULLS LAST]_| +|_|_SortExec: expr=[k@2 ASC NULLS LAST], preserve_partitioning=[false]_| |_|_MergeScanExec: REDACTED |_|_| +| physical_plan after OptimizeAggregateOrder_| SAME TEXT AS ABOVE_| | physical_plan after ProjectionPushdown_| SAME TEXT AS ABOVE_| | physical_plan after coalesce_batches_| SAME TEXT AS ABOVE_| | physical_plan after OutputRequirements_| PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[300000], time index=[j]_| |_|_PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false]_| |_|_PromSeriesDivideExec: tags=["k"]_| -|_|_SortExec: expr=[k@2 ASC NULLS LAST]_| +|_|_SortExec: expr=[k@2 ASC NULLS LAST], preserve_partitioning=[false]_| |_|_MergeScanExec: REDACTED |_|_| -| physical_plan after PipelineChecker_| SAME TEXT AS ABOVE_| | physical_plan after LimitAggregation_| SAME TEXT AS ABOVE_| | physical_plan after ProjectionPushdown_| SAME TEXT AS ABOVE_| +| physical_plan after PipelineChecker_| SAME TEXT AS ABOVE_| | physical_plan after RemoveDuplicateRule_| SAME TEXT AS ABOVE_| | physical_plan_| PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[300000], time index=[j]_| |_|_PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false]_| |_|_PromSeriesDivideExec: tags=["k"]_| -|_|_SortExec: expr=[k@2 ASC NULLS LAST]_| +|_|_SortExec: expr=[k@2 ASC NULLS LAST], preserve_partitioning=[false]_| |_|_MergeScanExec: REDACTED |_|_| | physical_plan_with_stats_| PromInstantManipulateExec: range=[0..0], lookback=[300000], interval=[300000], time index=[j], statistics=[Rows=Inexact(0), Bytes=Absent, [(Col[0]:),(Col[1]:),(Col[2]:)]] | |_|_PromSeriesNormalizeExec: offset=[0], time index=[j], filter NaN: [false], statistics=[Rows=Absent, Bytes=Absent, [(Col[0]:),(Col[1]:),(Col[2]:)]]_| |_|_PromSeriesDivideExec: tags=["k"], statistics=[Rows=Absent, Bytes=Absent, [(Col[0]:),(Col[1]:),(Col[2]:)]]_| -|_|_SortExec: expr=[k@2 ASC NULLS LAST], statistics=[Rows=Absent, Bytes=Absent, [(Col[0]:),(Col[1]:),(Col[2]:)]]_| +|_|_SortExec: expr=[k@2 ASC NULLS LAST], preserve_partitioning=[false], statistics=[Rows=Absent, Bytes=Absent, [(Col[0]:),(Col[1]:),(Col[2]:)]]_| |_|_MergeScanExec: REDACTED |_|_| +-+-+ diff --git a/tests/cases/standalone/common/types/decimal/decimal_aggregates.result b/tests/cases/standalone/common/types/decimal/decimal_aggregates.result index d246cc1d59..e5d4fda8fc 100644 --- a/tests/cases/standalone/common/types/decimal/decimal_aggregates.result +++ b/tests/cases/standalone/common/types/decimal/decimal_aggregates.result @@ -3,9 +3,9 @@ SELECT arrow_typeof(FIRST_VALUE('0.1'::DECIMAL(4,1))); +----------------------------------------+ -| arrow_typeof(FIRST_VALUE(Utf8("0.1"))) | +| arrow_typeof(first_value(Utf8("0.1"))) | +----------------------------------------+ -| Decimal128(4, 1) | +| Float64 | +----------------------------------------+ -- first_value @@ -16,9 +16,9 @@ SELECT FIRST_VALUE(NULL::DECIMAL), FIRST_VALUE('4567645908450368043562342564564938245.1'::DECIMAL(38,1))::VARCHAR; +-------------------+--------------------------+--------------------------------+------------------------------------------+--------------------------------------------------------------+ -| FIRST_VALUE(NULL) | FIRST_VALUE(Utf8("0.1")) | FIRST_VALUE(Utf8("4938245.1")) | FIRST_VALUE(Utf8("45672564564938245.1")) | FIRST_VALUE(Utf8("4567645908450368043562342564564938245.1")) | +| 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 | 45672564564938245.1 | 4567645908450368043562342564564938245.1 | +| | 0.1 | 4938245.1 | 4.567256456493825e16 | 4.567645908450368e36 | +-------------------+--------------------------+--------------------------------+------------------------------------------+--------------------------------------------------------------+ -- min diff --git a/tests/cases/standalone/optimizer/order_by.result b/tests/cases/standalone/optimizer/order_by.result index 49996d130e..b937344b77 100644 --- a/tests/cases/standalone/optimizer/order_by.result +++ b/tests/cases/standalone/optimizer/order_by.result @@ -10,47 +10,47 @@ explain select * from numbers; explain select * from numbers order by number desc; -+---------------+-------------------------------------------------------+ -| plan_type | plan | -+---------------+-------------------------------------------------------+ -| logical_plan | MergeScan [is_placeholder=false] | -| physical_plan | SortExec: expr=[number@0 DESC] | -| | SinglePartitionScanner: | -| | | -+---------------+-------------------------------------------------------+ ++---------------+---------------------------------------------------------------+ +| plan_type | plan | ++---------------+---------------------------------------------------------------+ +| logical_plan | MergeScan [is_placeholder=false] | +| physical_plan | SortExec: expr=[number@0 DESC], preserve_partitioning=[false] | +| | SinglePartitionScanner: | +| | | ++---------------+---------------------------------------------------------------+ explain select * from numbers order by number asc; -+---------------+-------------------------------------------------------+ -| plan_type | plan | -+---------------+-------------------------------------------------------+ -| logical_plan | MergeScan [is_placeholder=false] | -| physical_plan | SortExec: expr=[number@0 ASC NULLS LAST] | -| | SinglePartitionScanner: | -| | | -+---------------+-------------------------------------------------------+ ++---------------+-------------------------------------------------------------------------+ +| plan_type | plan | ++---------------+-------------------------------------------------------------------------+ +| logical_plan | MergeScan [is_placeholder=false] | +| physical_plan | SortExec: expr=[number@0 ASC NULLS LAST], preserve_partitioning=[false] | +| | SinglePartitionScanner: | +| | | ++---------------+-------------------------------------------------------------------------+ explain select * from numbers order by number desc limit 10; -+---------------+---------------------------------------------------------+ -| plan_type | plan | -+---------------+---------------------------------------------------------+ -| logical_plan | MergeScan [is_placeholder=false] | -| physical_plan | GlobalLimitExec: skip=0, fetch=10 | -| | SortExec: TopK(fetch=10), expr=[number@0 DESC] | -| | SinglePartitionScanner: | -| | | -+---------------+---------------------------------------------------------+ ++---------------+---------------------------------------------------------------------------------+ +| plan_type | plan | ++---------------+---------------------------------------------------------------------------------+ +| logical_plan | MergeScan [is_placeholder=false] | +| physical_plan | GlobalLimitExec: skip=0, fetch=10 | +| | SortExec: TopK(fetch=10), expr=[number@0 DESC], preserve_partitioning=[false] | +| | SinglePartitionScanner: | +| | | ++---------------+---------------------------------------------------------------------------------+ explain select * from numbers order by number asc limit 10; -+---------------+------------------------------------------------------------+ -| plan_type | plan | -+---------------+------------------------------------------------------------+ -| logical_plan | MergeScan [is_placeholder=false] | -| physical_plan | GlobalLimitExec: skip=0, fetch=10 | -| | SortExec: TopK(fetch=10), expr=[number@0 ASC NULLS LAST] | -| | SinglePartitionScanner: | -| | | -+---------------+------------------------------------------------------------+ ++---------------+-------------------------------------------------------------------------------------------+ +| plan_type | plan | ++---------------+-------------------------------------------------------------------------------------------+ +| logical_plan | MergeScan [is_placeholder=false] | +| physical_plan | GlobalLimitExec: skip=0, fetch=10 | +| | SortExec: TopK(fetch=10), expr=[number@0 ASC NULLS LAST], preserve_partitioning=[false] | +| | SinglePartitionScanner: | +| | | ++---------------+-------------------------------------------------------------------------------------------+