From 5901a1a73c9fd5755e6ded4903f90236f3a21f0a Mon Sep 17 00:00:00 2001 From: luofucong Date: Sat, 11 Oct 2025 20:40:44 +0800 Subject: [PATCH 1/8] chore: update datafusion to 50 Signed-off-by: luofucong --- Cargo.lock | 907 +++++++++--------- Cargo.toml | 66 +- src/catalog/Cargo.toml | 2 +- src/catalog/src/system_schema/pg_catalog.rs | 8 +- src/common/datasource/src/file_format.rs | 4 +- src/common/function/Cargo.toml | 2 +- src/common/function/src/aggrs/aggr_wrapper.rs | 17 +- .../function/src/aggrs/aggr_wrapper/tests.rs | 3 +- src/common/function/src/aggrs/count_hash.rs | 2 +- src/common/function/src/scalars/udf.rs | 15 + src/common/function/src/system/pg_catalog.rs | 2 +- src/common/macro/src/admin_fn.rs | 14 + src/datatypes/src/schema.rs | 3 +- src/datatypes/src/value.rs | 4 +- src/datatypes/src/vectors/helper.rs | 4 +- src/flow/src/df_optimizer.rs | 2 +- src/operator/src/expr_helper.rs | 17 +- src/promql/src/extension_plan/empty_metric.rs | 4 +- .../src/extension_plan/histogram_fold.rs | 9 +- .../src/extension_plan/range_manipulate.rs | 6 +- .../src/extension_plan/union_distinct_on.rs | 2 +- src/query/Cargo.toml | 1 + src/query/src/dist_plan/planner.rs | 4 +- src/query/src/optimizer/windowed_sort.rs | 7 +- src/query/src/part_sort.rs | 30 +- src/query/src/planner.rs | 13 +- src/query/src/promql/planner.rs | 1 + src/servers/Cargo.toml | 2 +- src/servers/src/postgres/handler.rs | 2 +- src/sql/src/ast.rs | 5 +- src/sql/src/parser.rs | 23 +- src/sql/src/parsers/alter_parser.rs | 6 +- src/sql/src/parsers/copy_parser.rs | 2 +- src/sql/src/parsers/create_parser.rs | 2 +- src/sql/src/parsers/cursor_parser.rs | 6 +- src/sql/src/parsers/describe_parser.rs | 2 +- src/sql/src/parsers/drop_parser.rs | 10 +- src/sql/src/parsers/explain_parser.rs | 6 +- src/sql/src/parsers/set_var_parser.rs | 34 +- src/sql/src/parsers/show_parser.rs | 12 +- src/sql/src/parsers/show_parser/trigger.rs | 2 +- src/sql/src/parsers/truncate_parser.rs | 2 +- src/sql/src/parsers/utils.rs | 2 +- src/sql/src/statements/statement.rs | 2 +- src/sql/src/util.rs | 2 +- 45 files changed, 691 insertions(+), 580 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e88493e928e..5dee778d487a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,12 +124,6 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_system_properties" version = "0.1.5" @@ -262,7 +256,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -300,9 +294,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "arrow" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c26b57282a08ae92f727497805122fec964c6245cfa0e13f0e75452eaf3bc41f" +checksum = "6e833808ff2d94ed40d9379848a950d995043c7fb3e81a30b383f4c6033821cc" dependencies = [ "arrow-arith", "arrow-array", @@ -321,9 +315,9 @@ dependencies = [ [[package]] name = "arrow-arith" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cebf38ca279120ff522f4954b81a39527425b6e9f615e6b72842f4de1ffe02b8" +checksum = "ad08897b81588f60ba983e3ca39bda2b179bdd84dced378e7df81a5313802ef8" dependencies = [ "arrow-array", "arrow-buffer", @@ -335,9 +329,9 @@ dependencies = [ [[package]] name = "arrow-array" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744109142cdf8e7b02795e240e20756c2a782ac9180d4992802954a8f871c0de" +checksum = "8548ca7c070d8db9ce7aa43f37393e4bfcf3f2d3681df278490772fd1673d08d" dependencies = [ "ahash 0.8.12", "arrow-buffer", @@ -346,15 +340,15 @@ dependencies = [ "chrono", "chrono-tz", "half", - "hashbrown 0.15.4", + "hashbrown 0.16.0", "num", ] [[package]] name = "arrow-buffer" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601bb103c4c374bcd1f62c66bcea67b42a2ee91a690486c37d4c180236f11ccc" +checksum = "e003216336f70446457e280807a73899dd822feaf02087d31febca1363e2fccc" dependencies = [ "bytes", "half", @@ -363,9 +357,9 @@ dependencies = [ [[package]] name = "arrow-cast" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed61d9d73eda8df9e3014843def37af3050b5080a9acbe108f045a316d5a0be" +checksum = "919418a0681298d3a77d1a315f625916cb5678ad0d74b9c60108eb15fd083023" dependencies = [ "arrow-array", "arrow-buffer", @@ -384,9 +378,9 @@ dependencies = [ [[package]] name = "arrow-csv" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa95b96ce0c06b4d33ac958370db8c0d31e88e54f9d6e08b0353d18374d9f991" +checksum = "bfa9bf02705b5cf762b6f764c65f04ae9082c7cfc4e96e0c33548ee3f67012eb" dependencies = [ "arrow-array", "arrow-cast", @@ -399,9 +393,9 @@ dependencies = [ [[package]] name = "arrow-data" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43407f2c6ba2367f64d85d4603d6fb9c4b92ed79d2ffd21021b37efa96523e12" +checksum = "a5c64fff1d142f833d78897a772f2e5b55b36cb3e6320376f0961ab0db7bd6d0" dependencies = [ "arrow-buffer", "arrow-schema", @@ -411,9 +405,9 @@ dependencies = [ [[package]] name = "arrow-flight" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c66c5e4a7aedc2bfebffeabc2116d76adb22e08d230b968b995da97f8b11ca" +checksum = "8c8b0ba0784d56bc6266b79f5de7a24b47024e7b3a0045d2ad4df3d9b686099f" dependencies = [ "arrow-array", "arrow-buffer", @@ -430,9 +424,9 @@ dependencies = [ [[package]] name = "arrow-ipc" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4b0487c4d2ad121cbc42c4db204f1509f8618e589bc77e635e9c40b502e3b90" +checksum = "1d3594dcddccc7f20fd069bc8e9828ce37220372680ff638c5e00dea427d88f5" dependencies = [ "arrow-array", "arrow-buffer", @@ -446,9 +440,9 @@ dependencies = [ [[package]] name = "arrow-json" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d747573390905905a2dc4c5a61a96163fe2750457f90a04ee2a88680758c79" +checksum = "88cf36502b64a127dc659e3b305f1d993a544eab0d48cce704424e62074dc04b" dependencies = [ "arrow-array", "arrow-buffer", @@ -457,7 +451,7 @@ dependencies = [ "arrow-schema", "chrono", "half", - "indexmap 2.10.0", + "indexmap 2.11.4", "lexical-core", "memchr", "num", @@ -468,9 +462,9 @@ dependencies = [ [[package]] name = "arrow-ord" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c142a147dceb59d057bad82400f1693847c80dca870d008bf7b91caf902810ae" +checksum = "3c8f82583eb4f8d84d4ee55fd1cb306720cddead7596edce95b50ee418edf66f" dependencies = [ "arrow-array", "arrow-buffer", @@ -479,11 +473,25 @@ dependencies = [ "arrow-select", ] +[[package]] +name = "arrow-pg" +version = "0.6.1" +source = "git+https://github.com/datafusion-contrib/datafusion-postgres?rev=7c1db5efdbf25924246f49b061acbbdf2d4af649#7c1db5efdbf25924246f49b061acbbdf2d4af649" +dependencies = [ + "bytes", + "chrono", + "datafusion", + "futures", + "pgwire 0.32.1", + "postgres-types", + "rust_decimal", +] + [[package]] name = "arrow-row" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac6620667fccdab4204689ca173bd84a15de6bb6b756c3a8764d4d7d0c2fc04" +checksum = "9d07ba24522229d9085031df6b94605e0f4b26e099fb7cdeec37abd941a73753" dependencies = [ "arrow-array", "arrow-buffer", @@ -494,9 +502,9 @@ dependencies = [ [[package]] name = "arrow-schema" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa93af9ff2bb80de539e6eb2c1c8764abd0f4b73ffb0d7c82bf1f9868785e66" +checksum = "b3aa9e59c611ebc291c28582077ef25c97f1975383f1479b12f3b9ffee2ffabe" dependencies = [ "serde", "serde_json", @@ -504,9 +512,9 @@ dependencies = [ [[package]] name = "arrow-select" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8b2e0052cd20d36d64f32640b68a5ab54d805d24a473baee5d52017c85536c" +checksum = "8c41dbbd1e97bfcaee4fcb30e29105fb2c75e4d82ae4de70b792a5d3f66b2e7a" dependencies = [ "ahash 0.8.12", "arrow-array", @@ -518,9 +526,9 @@ dependencies = [ [[package]] name = "arrow-string" -version = "56.1.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2155e26e17f053c8975c546fc70cf19c00542f9abf43c23a88a46ef7204204f" +checksum = "53f5183c150fbc619eede22b861ea7c0eebed8eaac0333eaa7f6da5205fd504d" dependencies = [ "arrow-array", "arrow-buffer", @@ -530,7 +538,7 @@ dependencies = [ "memchr", "num", "regex", - "regex-syntax 0.8.5", + "regex-syntax 0.8.7", ] [[package]] @@ -644,7 +652,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -666,7 +674,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -677,13 +685,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.88" +version = "0.1.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -763,7 +771,7 @@ checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -918,7 +926,7 @@ checksum = "604fde5e028fea851ce1d8570bbdc034bec850d157f7569d10f347d06808c05c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1066,7 +1074,7 @@ dependencies = [ "regex", "rustc-hash 2.1.1", "shlex", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1195,7 +1203,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1218,7 +1226,7 @@ dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1451,7 +1459,7 @@ dependencies = [ "common-workload", "dashmap", "datafusion", - "datafusion-pg-catalog", + "datafusion-postgres", "datatypes", "futures", "futures-util", @@ -1560,7 +1568,7 @@ version = "0.13.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fe45e18904af7af10e4312df7c97251e98af98c70f42f1f2587aecfcbee56bf" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.4", "lazy_static", "num-traits", "regex", @@ -1614,17 +1622,16 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", "wasm-bindgen", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -1746,7 +1753,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -1986,11 +1993,12 @@ checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "comfy-table" -version = "7.1.4" +version = "7.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a65ebfec4fb190b6f90e944a817d60499ee0744e582530e2c9900a22e591d9a" +checksum = "e0d05af1e006a2407bedef5af410552494ce5be9090444dbbcb57258c1af3d56" dependencies = [ - "unicode-segmentation", + "strum 0.26.3", + "strum_macros 0.26.4", "unicode-width 0.2.1", ] @@ -2075,7 +2083,7 @@ dependencies = [ "lazy_static", "object-store", "object_store_opendal", - "orc-rust 0.6.3", + "orc-rust", "parquet", "paste", "regex", @@ -2183,8 +2191,8 @@ dependencies = [ "datafusion-common", "datafusion-expr", "datafusion-functions-aggregate-common", - "datafusion-pg-catalog", "datafusion-physical-expr", + "datafusion-postgres", "datatypes", "derive_more", "futures", @@ -2291,7 +2299,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -2465,7 +2473,7 @@ dependencies = [ "futures-util", "serde", "snafu 0.8.6", - "sqlparser 0.55.0-greptime", + "sqlparser", "sqlparser_derive 0.1.1", "store-api", "tokio", @@ -2546,7 +2554,7 @@ dependencies = [ "jsonb", "serde_json", "snafu 0.8.6", - "sqlparser 0.55.0-greptime", + "sqlparser", ] [[package]] @@ -3176,7 +3184,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -3190,7 +3198,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -3212,7 +3220,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core 0.20.11", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -3223,7 +3231,7 @@ checksum = "2b5be8a7a562d315a5b92a630c30cec6bcf663e6673f00fbb69cca66a6f521b9" dependencies = [ "darling_core 0.21.1", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -3248,8 +3256,8 @@ dependencies = [ [[package]] name = "datafusion" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "arrow-ipc", @@ -3276,6 +3284,7 @@ dependencies = [ "datafusion-functions-window", "datafusion-optimizer", "datafusion-physical-expr", + "datafusion-physical-expr-adapter", "datafusion-physical-expr-common", "datafusion-physical-optimizer", "datafusion-physical-plan", @@ -3283,7 +3292,6 @@ dependencies = [ "datafusion-sql", "flate2", "futures", - "hex", "itertools 0.14.0", "log", "object_store", @@ -3291,7 +3299,8 @@ dependencies = [ "parquet", "rand 0.9.1", "regex", - "sqlparser 0.55.0", + "rstest", + "sqlparser", "tempfile", "tokio", "url", @@ -3302,8 +3311,8 @@ dependencies = [ [[package]] name = "datafusion-catalog" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "async-trait", @@ -3316,7 +3325,6 @@ dependencies = [ "datafusion-physical-expr", "datafusion-physical-plan", "datafusion-session", - "datafusion-sql", "futures", "itertools 0.14.0", "log", @@ -3327,8 +3335,8 @@ dependencies = [ [[package]] name = "datafusion-catalog-listing" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "async-trait", @@ -3349,33 +3357,31 @@ dependencies = [ [[package]] name = "datafusion-common" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "ahash 0.8.12", "arrow", "arrow-ipc", - "base64 0.22.1", "chrono", "half", "hashbrown 0.14.5", - "hex", - "indexmap 2.10.0", + "indexmap 2.11.4", "libc", "log", "object_store", "parquet", "paste", "recursive", - "sqlparser 0.55.0", + "sqlparser", "tokio", "web-time", ] [[package]] name = "datafusion-common-runtime" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "futures", "log", @@ -3384,8 +3390,8 @@ dependencies = [ [[package]] name = "datafusion-datasource" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "async-compression 0.4.19", @@ -3398,6 +3404,7 @@ dependencies = [ "datafusion-execution", "datafusion-expr", "datafusion-physical-expr", + "datafusion-physical-expr-adapter", "datafusion-physical-expr-common", "datafusion-physical-plan", "datafusion-session", @@ -3407,9 +3414,7 @@ dependencies = [ "itertools 0.14.0", "log", "object_store", - "parquet", "rand 0.9.1", - "tempfile", "tokio", "tokio-util", "url", @@ -3419,19 +3424,17 @@ dependencies = [ [[package]] name = "datafusion-datasource-csv" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "async-trait", "bytes", - "datafusion-catalog", "datafusion-common", "datafusion-common-runtime", "datafusion-datasource", "datafusion-execution", "datafusion-expr", - "datafusion-physical-expr", "datafusion-physical-expr-common", "datafusion-physical-plan", "datafusion-session", @@ -3443,71 +3446,66 @@ dependencies = [ [[package]] name = "datafusion-datasource-json" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "async-trait", "bytes", - "datafusion-catalog", "datafusion-common", "datafusion-common-runtime", "datafusion-datasource", "datafusion-execution", "datafusion-expr", - "datafusion-physical-expr", "datafusion-physical-expr-common", "datafusion-physical-plan", "datafusion-session", "futures", "object_store", - "serde_json", "tokio", ] [[package]] name = "datafusion-datasource-parquet" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "async-trait", "bytes", - "datafusion-catalog", "datafusion-common", "datafusion-common-runtime", "datafusion-datasource", "datafusion-execution", "datafusion-expr", - "datafusion-functions-aggregate", + "datafusion-functions-aggregate-common", "datafusion-physical-expr", + "datafusion-physical-expr-adapter", "datafusion-physical-expr-common", - "datafusion-physical-optimizer", "datafusion-physical-plan", "datafusion-pruning", "datafusion-session", "futures", - "hex", "itertools 0.14.0", "log", "object_store", "parking_lot 0.12.4", "parquet", - "rand 0.9.1", "tokio", ] [[package]] name = "datafusion-doc" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" [[package]] name = "datafusion-execution" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", + "async-trait", "dashmap", "datafusion-common", "datafusion-expr", @@ -3515,7 +3513,6 @@ dependencies = [ "log", "object_store", "parking_lot 0.12.4", - "parquet", "rand 0.9.1", "tempfile", "url", @@ -3523,8 +3520,8 @@ dependencies = [ [[package]] name = "datafusion-expr" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "async-trait", @@ -3535,29 +3532,30 @@ dependencies = [ "datafusion-functions-aggregate-common", "datafusion-functions-window-common", "datafusion-physical-expr-common", - "indexmap 2.10.0", + "indexmap 2.11.4", + "itertools 0.14.0", "paste", "recursive", "serde_json", - "sqlparser 0.55.0", + "sqlparser", ] [[package]] name = "datafusion-expr-common" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "datafusion-common", - "indexmap 2.10.0", + "indexmap 2.11.4", "itertools 0.14.0", "paste", ] [[package]] name = "datafusion-functions" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "arrow-buffer", @@ -3584,8 +3582,8 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "ahash 0.8.12", "arrow", @@ -3604,8 +3602,8 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate-common" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "ahash 0.8.12", "arrow", @@ -3616,8 +3614,8 @@ dependencies = [ [[package]] name = "datafusion-functions-nested" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "arrow-ord", @@ -3625,6 +3623,7 @@ dependencies = [ "datafusion-doc", "datafusion-execution", "datafusion-expr", + "datafusion-expr-common", "datafusion-functions", "datafusion-functions-aggregate", "datafusion-functions-aggregate-common", @@ -3637,8 +3636,8 @@ dependencies = [ [[package]] name = "datafusion-functions-table" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "async-trait", @@ -3652,8 +3651,8 @@ dependencies = [ [[package]] name = "datafusion-functions-window" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "datafusion-common", @@ -3669,8 +3668,8 @@ dependencies = [ [[package]] name = "datafusion-functions-window-common" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "datafusion-common", "datafusion-physical-expr-common", @@ -3678,18 +3677,18 @@ dependencies = [ [[package]] name = "datafusion-macros" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ - "datafusion-expr", + "datafusion-doc", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] name = "datafusion-optimizer" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "chrono", @@ -3697,18 +3696,18 @@ dependencies = [ "datafusion-expr", "datafusion-expr-common", "datafusion-physical-expr", - "indexmap 2.10.0", + "indexmap 2.11.4", "itertools 0.14.0", "log", "recursive", "regex", - "regex-syntax 0.8.5", + "regex-syntax 0.8.7", ] [[package]] name = "datafusion-orc" version = "0.4.1" -source = "git+https://github.com/GreptimeTeam/datafusion-orc?rev=a0a5f902158f153119316eaeec868cff3fc8a99d#a0a5f902158f153119316eaeec868cff3fc8a99d" +source = "git+https://github.com/GreptimeTeam/datafusion-orc?rev=2971b041ce1c94e315ac5b327589da6d61f449c0#2971b041ce1c94e315ac5b327589da6d61f449c0" dependencies = [ "arrow", "async-trait", @@ -3718,27 +3717,14 @@ dependencies = [ "futures", "futures-util", "object_store", - "orc-rust 0.6.0", - "tokio", -] - -[[package]] -name = "datafusion-pg-catalog" -version = "0.9.0" -source = "git+https://github.com/datafusion-contrib/datafusion-postgres?rev=3d1b7c7d5b82dd49bafc2803259365e633f654fa#3d1b7c7d5b82dd49bafc2803259365e633f654fa" -dependencies = [ - "async-trait", - "datafusion", - "futures", - "log", - "postgres-types", + "orc-rust", "tokio", ] [[package]] name = "datafusion-physical-expr" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "ahash 0.8.12", "arrow", @@ -3749,17 +3735,31 @@ dependencies = [ "datafusion-physical-expr-common", "half", "hashbrown 0.14.5", - "indexmap 2.10.0", + "indexmap 2.11.4", "itertools 0.14.0", - "log", + "parking_lot 0.12.4", "paste", - "petgraph 0.8.2", + "petgraph 0.8.3", +] + +[[package]] +name = "datafusion-physical-expr-adapter" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" +dependencies = [ + "arrow", + "datafusion-common", + "datafusion-expr", + "datafusion-functions", + "datafusion-physical-expr", + "datafusion-physical-expr-common", + "itertools 0.14.0", ] [[package]] name = "datafusion-physical-expr-common" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "ahash 0.8.12", "arrow", @@ -3771,8 +3771,8 @@ dependencies = [ [[package]] name = "datafusion-physical-optimizer" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "datafusion-common", @@ -3784,14 +3784,13 @@ dependencies = [ "datafusion-physical-plan", "datafusion-pruning", "itertools 0.14.0", - "log", "recursive", ] [[package]] name = "datafusion-physical-plan" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "ahash 0.8.12", "arrow", @@ -3810,7 +3809,7 @@ dependencies = [ "futures", "half", "hashbrown 0.14.5", - "indexmap 2.10.0", + "indexmap 2.11.4", "itertools 0.14.0", "log", "parking_lot 0.12.4", @@ -3818,13 +3817,34 @@ dependencies = [ "tokio", ] +[[package]] +name = "datafusion-postgres" +version = "0.10.2" +source = "git+https://github.com/datafusion-contrib/datafusion-postgres?rev=7c1db5efdbf25924246f49b061acbbdf2d4af649#7c1db5efdbf25924246f49b061acbbdf2d4af649" +dependencies = [ + "arrow-pg", + "async-trait", + "bytes", + "chrono", + "datafusion", + "futures", + "getset", + "log", + "pgwire 0.32.1", + "postgres-types", + "rust_decimal", + "rustls-pemfile", + "rustls-pki-types", + "tokio", + "tokio-rustls", +] + [[package]] name = "datafusion-pruning" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", - "arrow-schema", "datafusion-common", "datafusion-datasource", "datafusion-expr-common", @@ -3837,47 +3857,38 @@ dependencies = [ [[package]] name = "datafusion-session" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ - "arrow", "async-trait", - "dashmap", "datafusion-common", - "datafusion-common-runtime", "datafusion-execution", "datafusion-expr", - "datafusion-physical-expr", "datafusion-physical-plan", - "datafusion-sql", - "futures", - "itertools 0.14.0", - "log", - "object_store", "parking_lot 0.12.4", - "tokio", ] [[package]] name = "datafusion-sql" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "arrow", "bigdecimal 0.4.8", + "chrono", "datafusion-common", "datafusion-expr", - "indexmap 2.10.0", + "indexmap 2.11.4", "log", "recursive", "regex", - "sqlparser 0.55.0", + "sqlparser", ] [[package]] name = "datafusion-substrait" -version = "49.0.0" -source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=7d5214512740b4dfb742b6b3d91ed9affcc2c9d0#7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" +version = "50.1.0" +source = "git+https://github.com/GreptimeTeam/datafusion.git?rev=fd4b2abcf3c3e43e94951bda452c9fd35243aab0#fd4b2abcf3c3e43e94951bda452c9fd35243aab0" dependencies = [ "async-recursion", "async-trait", @@ -3890,6 +3901,7 @@ dependencies = [ "substrait 0.58.0", "tokio", "url", + "uuid", ] [[package]] @@ -3978,7 +3990,7 @@ dependencies = [ "serde", "serde_json", "snafu 0.8.6", - "sqlparser 0.55.0-greptime", + "sqlparser", "sqlparser_derive 0.1.1", ] @@ -4083,7 +4095,7 @@ checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4094,7 +4106,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4136,7 +4148,7 @@ dependencies = [ "darling 0.20.11", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4156,7 +4168,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core 0.20.2", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4176,7 +4188,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "unicode-xid", ] @@ -4188,7 +4200,7 @@ checksum = "ccfae181bab5ab6c5478b2ccb69e4c68a02f8c3ec72f6616bfec9dbc599d2ee0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4247,7 +4259,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4322,7 +4334,7 @@ checksum = "0e197fdfd2cdb5fdeb7f8ddcf3aed5d5d04ecde2890d448b14ffb716f7376b70" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4430,7 +4442,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4442,7 +4454,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4481,7 +4493,7 @@ checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4594,7 +4606,7 @@ checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" dependencies = [ "bit-set", "regex-automata 0.4.9", - "regex-syntax 0.8.5", + "regex-syntax 0.8.7", ] [[package]] @@ -4706,9 +4718,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.1.2" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +checksum = "dc5a4e564e38c699f2880d3fda590bedc2e69f3f84cd48b457bd892ce61d0aa9" dependencies = [ "crc32fast", "libz-rs-sys", @@ -4868,9 +4880,9 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] @@ -4942,7 +4954,7 @@ dependencies = [ "session", "snafu 0.8.6", "sql", - "sqlparser 0.55.0-greptime", + "sqlparser", "store-api", "strfmt", "substrait 0.18.0", @@ -4985,7 +4997,7 @@ checksum = "a0b4095fc99e1d858e5b8c7125d2638372ec85aa0fe6c807105cf10b0265ca6c" dependencies = [ "frunk_proc_macro_helpers", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -4997,7 +5009,7 @@ dependencies = [ "frunk_core", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -5009,7 +5021,7 @@ dependencies = [ "frunk_core", "frunk_proc_macro_helpers", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -5133,7 +5145,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -5298,6 +5310,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "getset" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf0fc11e47561d47397154977bc219f4cf809b2974facc3ccb3b89e2436f912" +dependencies = [ + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "gimli" version = "0.31.1" @@ -5359,7 +5383,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.10.0", + "indexmap 2.11.4", "slab", "tokio", "tokio-util", @@ -5378,7 +5402,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.3.1", - "indexmap 2.10.0", + "indexmap 2.11.4", "slab", "tokio", "tokio-util", @@ -5464,6 +5488,12 @@ dependencies = [ "foldhash", ] +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" + [[package]] name = "hashlink" version = "0.10.0" @@ -5599,7 +5629,7 @@ checksum = "a56f203cd1c76362b69e3863fd987520ac36cf70a8c92627449b2f64a8cf7d65" dependencies = [ "cfg-if", "libc", - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -6018,9 +6048,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -6063,7 +6093,7 @@ dependencies = [ "libflate", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -6140,13 +6170,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.10.0" +version = "2.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", "hashbrown 0.15.4", - "serde", ] [[package]] @@ -6162,7 +6191,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "232929e1d75fe899576a3d5c7416ad0d88dbfbb3c3d6aa00873a7408a50ddb88" dependencies = [ "ahash 0.8.12", - "indexmap 2.10.0", + "indexmap 2.11.4", "is-terminal", "itoa", "log", @@ -6185,7 +6214,7 @@ dependencies = [ "crossbeam-utils", "dashmap", "env_logger", - "indexmap 2.10.0", + "indexmap 2.11.4", "itoa", "log", "num-format", @@ -6227,7 +6256,7 @@ checksum = "6c38228f24186d9cc68c729accb4d413be9eaed6ad07ff79e0270d9e56f3de13" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -6572,7 +6601,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee7893dab2e44ae5f9d0173f26ff4aa327c10b01b06a72b52dd9405b628640d" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.4", ] [[package]] @@ -6657,7 +6686,7 @@ dependencies = [ "http 1.3.1", "json-patch", "k8s-openapi", - "schemars 0.8.22", + "schemars", "serde", "serde_json", "thiserror 1.0.69", @@ -6673,7 +6702,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -6717,7 +6746,7 @@ dependencies = [ "lalrpop-util", "petgraph 0.7.1", "regex", - "regex-syntax 0.8.5", + "regex-syntax 0.8.7", "sha3", "string_cache", "term", @@ -6759,7 +6788,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -6782,7 +6811,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -6872,9 +6901,9 @@ checksum = "775bf80d5878ab7c2b1080b5351a48b2f737d9f6f8b383574eebcc22be0dfccb" [[package]] name = "libc" -version = "0.2.175" +version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" [[package]] name = "libflate" @@ -7115,7 +7144,7 @@ dependencies = [ "num-traits", "quote", "regex", - "regex-syntax 0.8.5", + "regex-syntax 0.8.7", "serde", "vergen", ] @@ -7130,7 +7159,7 @@ dependencies = [ "cactus", "cfgrammar", "filetime", - "indexmap 2.10.0", + "indexmap 2.11.4", "lazy_static", "lrtable", "num-traits", @@ -7547,6 +7576,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", + "simd-adler32", ] [[package]] @@ -7686,7 +7716,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -7785,7 +7815,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "termcolor", "thiserror 1.0.69", ] @@ -7803,7 +7833,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "termcolor", "thiserror 2.0.17", ] @@ -7939,7 +7969,7 @@ checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -8166,7 +8196,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -8279,7 +8309,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -8291,7 +8321,7 @@ dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -8348,9 +8378,9 @@ dependencies = [ [[package]] name = "object_store" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efc4f07659e11cd45a341cd24d71e683e3be65d9ff1f8150061678fe60437496" +checksum = "4c1be0c6c22ec0817cdc77d3842f721a17fd30ab6965001415b5402a74e6b740" dependencies = [ "async-trait", "bytes", @@ -8664,7 +8694,7 @@ dependencies = [ "session", "snafu 0.8.6", "sql", - "sqlparser 0.55.0-greptime", + "sqlparser", "store-api", "substrait 0.18.0", "table", @@ -8674,31 +8704,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "orc-rust" -version = "0.6.0" -source = "git+https://github.com/GreptimeTeam/orc-rust?rev=d1690a06eec754e97beecf2cf7690267fc818726#d1690a06eec754e97beecf2cf7690267fc818726" -dependencies = [ - "arrow", - "async-trait", - "bytemuck", - "bytes", - "chrono", - "chrono-tz", - "fallible-streaming-iterator", - "flate2", - "futures", - "futures-util", - "lz4_flex", - "lzokay-native", - "num", - "prost 0.13.5", - "snafu 0.8.6", - "snap", - "tokio", - "zstd 0.13.3", -] - [[package]] name = "orc-rust" version = "0.6.3" @@ -8816,7 +8821,7 @@ dependencies = [ "otlp-model", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -8926,9 +8931,9 @@ dependencies = [ [[package]] name = "parquet" -version = "56.0.0" +version = "56.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7288a07ed5d25939a90f9cb1ca5afa6855faa08ec7700613511ae64bdb0620c" +checksum = "f0dbd48ad52d7dccf8ea1b90a3ddbfaea4f69878dd7683e51c507d4bc52b5b27" dependencies = [ "ahash 0.8.12", "arrow-array", @@ -8945,13 +8950,12 @@ dependencies = [ "flate2", "futures", "half", - "hashbrown 0.15.4", + "hashbrown 0.16.0", "lz4_flex", "num", "num-bigint", "object_store", "paste", - "ring", "seq-macro", "simdutf8", "snap", @@ -8998,7 +9002,7 @@ dependencies = [ "session", "snafu 0.8.6", "sql", - "sqlparser 0.55.0-greptime", + "sqlparser", "store-api", "table", ] @@ -9095,9 +9099,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "permutation" @@ -9136,7 +9140,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -9156,7 +9160,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.10.0", + "indexmap 2.11.4", ] [[package]] @@ -9166,21 +9170,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset 0.5.7", - "indexmap 2.10.0", + "indexmap 2.11.4", ] [[package]] name = "petgraph" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54acf3a685220b533e437e264e4d932cfbdc4cc7ec0cd232ed73c08d03b8a7ca" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" dependencies = [ "fixedbitset 0.5.7", "hashbrown 0.15.4", - "indexmap 2.10.0", + "indexmap 2.11.4", "serde", ] +[[package]] +name = "pgwire" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf403a6ee31cf7f2217b2bd8447cb13dbb6c268d7e81501bc78a4d3daafd294" +dependencies = [ + "async-trait", + "base64 0.22.1", + "bytes", + "chrono", + "derive-new", + "futures", + "hex", + "lazy-regex", + "md5 0.8.0", + "postgres-types", + "rand 0.9.1", + "ring", + "rust_decimal", + "rustls-pki-types", + "stringprep", + "thiserror 2.0.17", + "tokio", + "tokio-rustls", + "tokio-util", + "x509-certificate 0.24.0", +] + [[package]] name = "pgwire" version = "0.33.0" @@ -9303,7 +9335,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -9440,7 +9472,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d77244ce2d584cd84f6a15f86195b8c9b2a0dfbfd817c09e0464244091a58ed" dependencies = [ "base64 0.22.1", - "indexmap 2.10.0", + "indexmap 2.11.4", "quick-xml 0.37.5", "serde", "time", @@ -9669,7 +9701,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a" dependencies = [ "proc-macro2", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -9710,7 +9742,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -9862,7 +9894,7 @@ dependencies = [ "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.104", + "syn 2.0.106", "tempfile", ] @@ -9882,7 +9914,7 @@ dependencies = [ "prost 0.13.5", "prost-types 0.13.5", "regex", - "syn 2.0.104", + "syn 2.0.106", "tempfile", ] @@ -9909,7 +9941,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -9922,7 +9954,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -10150,6 +10182,7 @@ dependencies = [ "num-traits", "object-store", "once_cell", + "parking_lot 0.12.4", "partition", "paste", "pretty_assertions", @@ -10164,7 +10197,7 @@ dependencies = [ "session", "snafu 0.8.6", "sql", - "sqlparser 0.55.0-greptime", + "sqlparser", "store-api", "substrait 0.18.0", "table", @@ -10251,9 +10284,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.40" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" dependencies = [ "proc-macro2", ] @@ -10440,7 +10473,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76009fbe0614077fc1a2ce255e3a1881a2e3a3527097d5dc6d8212c585e7e38b" dependencies = [ "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -10478,7 +10511,7 @@ checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -10490,7 +10523,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata 0.4.9", - "regex-syntax 0.8.5", + "regex-syntax 0.8.7", ] [[package]] @@ -10510,7 +10543,7 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax 0.8.7", ] [[package]] @@ -10520,11 +10553,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c11639076bf147be211b90e47790db89f4c22b6c8a9ca6e960833869da67166" dependencies = [ "aho-corasick", - "indexmap 2.10.0", + "indexmap 2.11.4", "itertools 0.13.0", "nohash", "regex", - "regex-syntax 0.8.5", + "regex-syntax 0.8.7", ] [[package]] @@ -10541,9 +10574,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "c3160422bbd54dd5ecfdca71e5fd59b7b8fe2b1697ab2baf64f6d05dcc66d298" [[package]] name = "regress" @@ -10867,7 +10900,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.104", + "syn 2.0.106", "unicode-ident", ] @@ -10879,7 +10912,7 @@ checksum = "b3a8fb4672e840a587a66fc577a5491375df51ddb88f2a2c2a792598c326fe14" dependencies = [ "quote", "rand 0.8.5", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -10902,7 +10935,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.104", + "syn 2.0.106", "walkdir", ] @@ -11214,30 +11247,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "schemars" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" -dependencies = [ - "dyn-clone", - "ref-cast", - "serde", - "serde_json", -] - -[[package]] -name = "schemars" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1375ba8ef45a6f15d83fa8748f1079428295d403d6ea991d09ab100155fbc06d" -dependencies = [ - "dyn-clone", - "ref-cast", - "serde", - "serde_json", -] - [[package]] name = "schemars_derive" version = "0.8.22" @@ -11247,7 +11256,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -11293,7 +11302,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "thiserror 2.0.17", ] @@ -11312,7 +11321,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -11403,7 +11412,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -11414,7 +11423,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -11447,7 +11456,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -11468,7 +11477,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -11485,19 +11494,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.14.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" +checksum = "21e47d95bc83ed33b2ecf84f4187ad1ab9685d18ff28db000c99deac8ce180e3" dependencies = [ - "base64 0.22.1", + "base64 0.21.7", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.10.0", - "schemars 0.9.0", - "schemars 1.0.3", "serde", - "serde_derive", "serde_json", "serde_with_macros", "time", @@ -11505,14 +11510,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.14.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" +checksum = "ea3cee93715c2e266b9338b7544da68a9f24e227722ba482bd1c024367c77c65" dependencies = [ "darling 0.20.11", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -11521,7 +11526,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.4", "itoa", "ryu", "serde", @@ -11574,7 +11579,7 @@ dependencies = [ "datafusion", "datafusion-common", "datafusion-expr", - "datafusion-pg-catalog", + "datafusion-postgres", "datatypes", "derive_builder 0.20.2", "futures", @@ -11585,7 +11590,7 @@ dependencies = [ "humantime", "humantime-serde", "hyper 1.6.0", - "indexmap 2.10.0", + "indexmap 2.11.4", "influxdb_line_protocol", "itertools 0.14.0", "json5", @@ -11606,7 +11611,7 @@ dependencies = [ "otel-arrow-rust", "parking_lot 0.12.4", "permutation", - "pgwire", + "pgwire 0.33.0", "pin-project", "pipeline", "postgres-types", @@ -11777,6 +11782,12 @@ dependencies = [ "wide", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "simd-json" version = "0.15.1" @@ -11909,7 +11920,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -12014,7 +12025,7 @@ dependencies = [ "serde", "serde_json", "snafu 0.8.6", - "sqlparser 0.55.0-greptime", + "sqlparser", "sqlparser_derive 0.1.1", "store-api", "table", @@ -12071,26 +12082,14 @@ dependencies = [ [[package]] name = "sqlparser" -version = "0.55.0-greptime" -source = "git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=39e4fc94c3c741981f77e9d63b5ce8c02e0a27ea#39e4fc94c3c741981f77e9d63b5ce8c02e0a27ea" +version = "0.58.0" +source = "git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=4b519a5caa95472cc3988f5556813a583dd35af1#4b519a5caa95472cc3988f5556813a583dd35af1" dependencies = [ "lazy_static", "log", "recursive", "regex", "serde", - "sqlparser 0.55.0", - "sqlparser_derive 0.3.0-greptime", -] - -[[package]] -name = "sqlparser" -version = "0.55.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4521174166bac1ff04fe16ef4524c70144cd29682a45978978ca3d7f4e0be11" -dependencies = [ - "log", - "recursive", "sqlparser_derive 0.3.0", ] @@ -12105,25 +12104,14 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "sqlparser_derive" -version = "0.3.0-greptime" -source = "git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=39e4fc94c3c741981f77e9d63b5ce8c02e0a27ea#39e4fc94c3c741981f77e9d63b5ce8c02e0a27ea" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - [[package]] name = "sqlparser_derive" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da5fc6819faabb412da764b99d3b713bb55083c11e7e0c00144d386cd6a1939c" +source = "git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=4b519a5caa95472cc3988f5556813a583dd35af1#4b519a5caa95472cc3988f5556813a583dd35af1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -12158,7 +12146,7 @@ dependencies = [ "futures-util", "hashbrown 0.15.4", "hashlink", - "indexmap 2.10.0", + "indexmap 2.11.4", "log", "memchr", "once_cell", @@ -12186,7 +12174,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -12209,7 +12197,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.104", + "syn 2.0.106", "tokio", "url", ] @@ -12410,7 +12398,7 @@ dependencies = [ "serde", "serde_json", "snafu 0.8.6", - "sqlparser 0.55.0-greptime", + "sqlparser", "strum 0.27.1", "tokio", "uuid", @@ -12481,6 +12469,12 @@ dependencies = [ "strum_macros 0.25.3", ] +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" + [[package]] name = "strum" version = "0.27.1" @@ -12500,7 +12494,20 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.104", + "syn 2.0.106", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.106", ] [[package]] @@ -12513,7 +12520,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -12559,12 +12566,12 @@ dependencies = [ "prost 0.13.5", "prost-build 0.13.5", "prost-types 0.13.5", - "schemars 0.8.22", + "schemars", "semver", "serde", "serde_json", "serde_yaml", - "syn 2.0.104", + "syn 2.0.106", "typify 0.1.0", "walkdir", ] @@ -12584,12 +12591,12 @@ dependencies = [ "prost-build 0.13.5", "prost-types 0.13.5", "regress 0.10.3", - "schemars 0.8.22", + "schemars", "semver", "serde", "serde_json", "serde_yaml", - "syn 2.0.104", + "syn 2.0.106", "typify 0.4.2", "walkdir", ] @@ -12636,9 +12643,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.104" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -12668,7 +12675,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -12730,7 +12737,7 @@ dependencies = [ "serde", "serde_json", "snafu 0.8.6", - "sqlparser 0.55.0-greptime", + "sqlparser", "store-api", "tokio", "tokio-util", @@ -12840,7 +12847,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d60769b80ad7953d8a7b2c70cdfe722bbcdcac6bccc8ac934c40c034d866fc18" dependencies = [ "byteorder", - "regex-syntax 0.8.5", + "regex-syntax 0.8.7", "utf8-ranges", ] @@ -12994,13 +13001,13 @@ dependencies = [ "rand 0.9.1", "rand_chacha 0.9.0", "reqwest", - "schemars 0.8.22", + "schemars", "serde", "serde_json", "serde_yaml", "snafu 0.8.6", "sql", - "sqlparser 0.55.0-greptime", + "sqlparser", "sqlx", "store-api", "strum 0.27.1", @@ -13131,7 +13138,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -13142,7 +13149,7 @@ checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -13322,7 +13329,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -13455,7 +13462,7 @@ version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.4", "serde", "serde_spanned", "toml_datetime", @@ -13477,7 +13484,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.4", "toml_datetime", "winnow 0.5.40", ] @@ -13488,7 +13495,7 @@ version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.10.0", + "indexmap 2.11.4", "serde", "serde_spanned", "toml_datetime", @@ -13574,7 +13581,7 @@ dependencies = [ "prost-build 0.13.5", "prost-types 0.13.5", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -13619,7 +13626,7 @@ dependencies = [ "futures-core", "futures-util", "hdrhistogram", - "indexmap 2.10.0", + "indexmap 2.11.4", "pin-project-lite", "slab", "sync_wrapper 1.0.2", @@ -13724,7 +13731,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -13848,7 +13855,7 @@ checksum = "35f5380909ffc31b4de4f4bdf96b877175a016aa2ca98cee39fcfd8c4d53d952" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -13882,11 +13889,11 @@ dependencies = [ "proc-macro2", "quote", "regress 0.9.1", - "schemars 0.8.22", + "schemars", "semver", "serde", "serde_json", - "syn 2.0.104", + "syn 2.0.106", "thiserror 1.0.69", "unicode-ident", ] @@ -13902,11 +13909,11 @@ dependencies = [ "proc-macro2", "quote", "regress 0.10.3", - "schemars 0.8.22", + "schemars", "semver", "serde", "serde_json", - "syn 2.0.104", + "syn 2.0.106", "thiserror 2.0.17", "unicode-ident", ] @@ -13919,12 +13926,12 @@ checksum = "f8e6491896e955692d68361c68db2b263e3bec317ec0b684e0e2fa882fb6e31e" dependencies = [ "proc-macro2", "quote", - "schemars 0.8.22", + "schemars", "semver", "serde", "serde_json", "serde_tokenstream", - "syn 2.0.104", + "syn 2.0.106", "typify-impl 0.1.0", ] @@ -13936,12 +13943,12 @@ checksum = "7560adf816a1e8dad7c63d8845ef6e31e673e39eab310d225636779230cbedeb" dependencies = [ "proc-macro2", "quote", - "schemars 0.8.22", + "schemars", "semver", "serde", "serde_json", "serde_tokenstream", - "syn 2.0.104", + "syn 2.0.106", "typify-impl 0.4.2", ] @@ -14086,13 +14093,14 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.4" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -14127,9 +14135,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.17.0" +version = "1.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" dependencies = [ "getrandom 0.3.3", "js-sys", @@ -14175,7 +14183,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "variadics", ] @@ -14260,7 +14268,7 @@ dependencies = [ "hostname 0.4.1", "iana-time-zone", "idna", - "indexmap 2.10.0", + "indexmap 2.11.4", "indoc", "influxdb-line-protocol", "itertools 0.14.0", @@ -14389,7 +14397,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "wasm-bindgen-shared", ] @@ -14424,7 +14432,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -14570,7 +14578,7 @@ dependencies = [ "windows-collections", "windows-core 0.61.2", "windows-future", - "windows-link", + "windows-link 0.1.3", "windows-numerics", ] @@ -14603,7 +14611,7 @@ checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ "windows-implement 0.60.0", "windows-interface 0.59.1", - "windows-link", + "windows-link 0.1.3", "windows-result 0.3.4", "windows-strings", ] @@ -14615,7 +14623,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ "windows-core 0.61.2", - "windows-link", + "windows-link 0.1.3", "windows-threading", ] @@ -14627,7 +14635,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -14638,7 +14646,7 @@ checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -14649,7 +14657,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -14660,7 +14668,7 @@ checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -14669,6 +14677,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + [[package]] name = "windows-numerics" version = "0.2.0" @@ -14676,7 +14690,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" dependencies = [ "windows-core 0.61.2", - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -14694,7 +14708,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -14703,7 +14717,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -14770,7 +14784,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -14955,6 +14969,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "x509-certificate" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57b9f8bcae7c1f36479821ae826d75050c60ce55146fd86d3553ed2573e2762" +dependencies = [ + "bcder", + "bytes", + "chrono", + "der", + "hex", + "pem", + "ring", + "signature", + "spki", + "thiserror 1.0.69", + "zeroize", +] + [[package]] name = "x509-certificate" version = "0.25.0" @@ -15028,7 +15061,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "synstructure", ] @@ -15049,7 +15082,7 @@ checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -15069,7 +15102,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", "synstructure", ] @@ -15090,7 +15123,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] @@ -15123,7 +15156,7 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.104", + "syn 2.0.106", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1185c9b2d573..26a8c44eff36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,12 +99,12 @@ rust.unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] } # See for more detaiils: https://github.com/rust-lang/cargo/issues/11329 ahash = { version = "0.8", features = ["compile-time-rng"] } aquamarine = "0.6" -arrow = { version = "56.0", features = ["prettyprint"] } -arrow-array = { version = "56.0", default-features = false, features = ["chrono-tz"] } -arrow-buffer = "56.0" -arrow-flight = "56.0" -arrow-ipc = { version = "56.0", default-features = false, features = ["lz4", "zstd"] } -arrow-schema = { version = "56.0", features = ["serde"] } +arrow = { version = "56.2", features = ["prettyprint"] } +arrow-array = { version = "56.2", default-features = false, features = ["chrono-tz"] } +arrow-buffer = "56.2" +arrow-flight = "56.2" +arrow-ipc = { version = "56.2", default-features = false, features = ["lz4", "zstd"] } +arrow-schema = { version = "56.2", features = ["serde"] } async-stream = "0.3" async-trait = "0.1" # Remember to update axum-extra, axum-macros when updating axum @@ -123,18 +123,18 @@ clap = { version = "4.4", features = ["derive"] } config = "0.13.0" crossbeam-utils = "0.8" dashmap = "6.1" -datafusion = "49" -datafusion-common = "49" -datafusion-expr = "49" -datafusion-functions = "49" -datafusion-functions-aggregate-common = "49" -datafusion-optimizer = "49" -datafusion-orc = { git = "https://github.com/GreptimeTeam/datafusion-orc", rev = "a0a5f902158f153119316eaeec868cff3fc8a99d" } -datafusion-pg-catalog = { git = "https://github.com/datafusion-contrib/datafusion-postgres", rev = "3d1b7c7d5b82dd49bafc2803259365e633f654fa" } -datafusion-physical-expr = "49" -datafusion-physical-plan = "49" -datafusion-sql = "49" -datafusion-substrait = "49" +datafusion = "50" +datafusion-common = "50" +datafusion-expr = "50" +datafusion-functions = "50" +datafusion-functions-aggregate-common = "50" +datafusion-optimizer = "50" +datafusion-orc = { git = "https://github.com/GreptimeTeam/datafusion-orc", rev = "2971b041ce1c94e315ac5b327589da6d61f449c0" } +datafusion-postgres = { git = "https://github.com/datafusion-contrib/datafusion-postgres", rev = "7c1db5efdbf25924246f49b061acbbdf2d4af649" } +datafusion-physical-expr = "50" +datafusion-physical-plan = "50" +datafusion-sql = "50" +datafusion-substrait = "50" deadpool = "0.12" deadpool-postgres = "0.14" derive_builder = "0.20" @@ -180,7 +180,7 @@ otel-arrow-rust = { git = "https://github.com/GreptimeTeam/otel-arrow", rev = "2 "server", ] } parking_lot = "0.12" -parquet = { version = "56.0", default-features = false, features = ["arrow", "async", "object_store"] } +parquet = { version = "56.2", default-features = false, features = ["arrow", "async", "object_store"] } paste = "1.0" pin-project = "1.0" pretty_assertions = "1.4.0" @@ -216,10 +216,7 @@ simd-json = "0.15" similar-asserts = "1.6.0" smallvec = { version = "1", features = ["serde"] } snafu = "0.8" -sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "39e4fc94c3c741981f77e9d63b5ce8c02e0a27ea", features = [ - "visitor", - "serde", -] } # branch = "v0.55.x" +sqlparser = { version = "0.58.0", default-features = false, features = ["std", "visitor", "serde"] } sqlx = { version = "0.8", features = [ "runtime-tokio-rustls", "mysql", @@ -321,16 +318,19 @@ git = "https://github.com/GreptimeTeam/greptime-meter.git" rev = "5618e779cf2bb4755b499c630fba4c35e91898cb" [patch.crates-io] -datafusion = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" } -datafusion-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" } -datafusion-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" } -datafusion-functions = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" } -datafusion-functions-aggregate-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" } -datafusion-optimizer = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" } -datafusion-physical-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" } -datafusion-physical-plan = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" } -datafusion-sql = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" } -datafusion-substrait = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "7d5214512740b4dfb742b6b3d91ed9affcc2c9d0" } +datafusion = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +datafusion-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +datafusion-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +datafusion-functions = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +datafusion-functions-aggregate-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +datafusion-optimizer = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +datafusion-physical-expr = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +datafusion-physical-expr-common = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +datafusion-physical-plan = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +datafusion-datasource = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +datafusion-sql = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +datafusion-substrait = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } +sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "4b519a5caa95472cc3988f5556813a583dd35af1" } # branch = "v0.58.x" [profile.release] debug = 1 diff --git a/src/catalog/Cargo.toml b/src/catalog/Cargo.toml index 62674e25725b..515fafad8682 100644 --- a/src/catalog/Cargo.toml +++ b/src/catalog/Cargo.toml @@ -35,7 +35,7 @@ common-version.workspace = true common-workload.workspace = true dashmap.workspace = true datafusion.workspace = true -datafusion-pg-catalog.workspace = true +datafusion-postgres.workspace = true datatypes.workspace = true futures.workspace = true futures-util.workspace = true diff --git a/src/catalog/src/system_schema/pg_catalog.rs b/src/catalog/src/system_schema/pg_catalog.rs index b3ddec5b3b80..231fa9a8b80c 100644 --- a/src/catalog/src/system_schema/pg_catalog.rs +++ b/src/catalog/src/system_schema/pg_catalog.rs @@ -26,8 +26,9 @@ use datafusion::datasource::TableType; use datafusion::error::DataFusionError; use datafusion::execution::TaskContext; use datafusion::physical_plan::stream::RecordBatchStreamAdapter as DfRecordBatchStreamAdapter; -use datafusion_pg_catalog::pg_catalog::catalog_info::CatalogInfo; -use datafusion_pg_catalog::pg_catalog::{ +use datafusion_postgres::pg_catalog::catalog_info::CatalogInfo; +use datafusion_postgres::pg_catalog::context::EmptyContextProvider; +use datafusion_postgres::pg_catalog::{ PG_CATALOG_TABLES, PgCatalogSchemaProvider, PgCatalogStaticTables, PgCatalogTable, }; use snafu::ResultExt; @@ -44,7 +45,7 @@ use crate::system_schema::{ /// [`PGCatalogProvider`] is the provider for a schema named `pg_catalog`, it is not a catalog. pub struct PGCatalogProvider { catalog_name: String, - inner: PgCatalogSchemaProvider, + inner: PgCatalogSchemaProvider, tables: HashMap, table_ids: HashMap<&'static str, u32>, } @@ -69,6 +70,7 @@ impl PGCatalogProvider { catalog_manager, }, Arc::new(static_tables), + EmptyContextProvider, ) .expect("Failed to initialize PgCatalogSchemaProvider"); diff --git a/src/common/datasource/src/file_format.rs b/src/common/datasource/src/file_format.rs index b6d4d6c30a4b..7c4e8d6c88e0 100644 --- a/src/common/datasource/src/file_format.rs +++ b/src/common/datasource/src/file_format.rs @@ -33,7 +33,7 @@ use bytes::{Buf, Bytes}; use datafusion::datasource::physical_plan::FileOpenFuture; use datafusion::error::{DataFusionError, Result as DataFusionResult}; use datafusion::physical_plan::SendableRecordBatchStream; -use futures::StreamExt; +use futures::{StreamExt, TryStreamExt}; use object_store::ObjectStore; use snafu::ResultExt; use tokio_util::compat::FuturesAsyncWriteCompatExt; @@ -179,7 +179,7 @@ pub fn open_with_decoder DataFusionResult>( Poll::Ready(decoder.flush().transpose()) }); - Ok(stream.boxed()) + Ok(stream.map_err(Into::into).boxed()) })) } diff --git a/src/common/function/Cargo.toml b/src/common/function/Cargo.toml index d5b928e2a16f..94681404e439 100644 --- a/src/common/function/Cargo.toml +++ b/src/common/function/Cargo.toml @@ -36,7 +36,7 @@ datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true datafusion-functions-aggregate-common.workspace = true -datafusion-pg-catalog.workspace = true +datafusion-postgres.workspace = true datafusion-physical-expr.workspace = true datatypes.workspace = true derive_more = { version = "1", default-features = false, features = ["display"] } diff --git a/src/common/function/src/aggrs/aggr_wrapper.rs b/src/common/function/src/aggrs/aggr_wrapper.rs index 4ee8190f2da2..ed691296ee66 100644 --- a/src/common/function/src/aggrs/aggr_wrapper.rs +++ b/src/common/function/src/aggrs/aggr_wrapper.rs @@ -22,6 +22,7 @@ //! `foo_merge`'s input arg is the same as `foo_state`'s output, and its output is the same as `foo`'s input. //! +use std::hash::{Hash, Hasher}; use std::sync::Arc; use arrow::array::StructArray; @@ -272,7 +273,7 @@ impl StateMergeHelper { } /// Wrapper to make an aggregate function out of a state function. -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct StateWrapper { inner: AggregateUDF, name: String, @@ -616,6 +617,20 @@ impl AggregateUDFImpl for MergeWrapper { } } +impl PartialEq for MergeWrapper { + fn eq(&self, other: &Self) -> bool { + self.inner == other.inner + } +} + +impl Eq for MergeWrapper {} + +impl Hash for MergeWrapper { + fn hash(&self, state: &mut H) { + self.inner.hash(state); + } +} + /// The merge accumulator, which modify `update_batch`'s behavior to accept one struct array which /// include the state fields of original aggregate function, and merge said states into original accumulator /// the output is the same as original aggregate function diff --git a/src/common/function/src/aggrs/aggr_wrapper/tests.rs b/src/common/function/src/aggrs/aggr_wrapper/tests.rs index d24cdd8475a0..97a5a792d99d 100644 --- a/src/common/function/src/aggrs/aggr_wrapper/tests.rs +++ b/src/common/function/src/aggrs/aggr_wrapper/tests.rs @@ -39,8 +39,7 @@ use datafusion::prelude::SessionContext; use datafusion_common::arrow::array::AsArray; use datafusion_common::arrow::datatypes::{Float64Type, UInt64Type}; use datafusion_common::{Column, TableReference}; -use datafusion_expr::expr::AggregateFunction; -use datafusion_expr::sqlparser::ast::NullTreatment; +use datafusion_expr::expr::{AggregateFunction, NullTreatment}; use datafusion_expr::{ Aggregate, ColumnarValue, Expr, LogicalPlan, ScalarFunctionArgs, SortExpr, TableScan, lit, }; diff --git a/src/common/function/src/aggrs/count_hash.rs b/src/common/function/src/aggrs/count_hash.rs index ded88107e6d2..7cc594f2e3cb 100644 --- a/src/common/function/src/aggrs/count_hash.rs +++ b/src/common/function/src/aggrs/count_hash.rs @@ -68,7 +68,7 @@ impl CountHash { } } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Eq, PartialEq, Hash)] pub struct CountHash { signature: Signature, } diff --git a/src/common/function/src/scalars/udf.rs b/src/common/function/src/scalars/udf.rs index 503a66d331b3..eee3ede801dc 100644 --- a/src/common/function/src/scalars/udf.rs +++ b/src/common/function/src/scalars/udf.rs @@ -14,6 +14,7 @@ use std::any::Any; use std::fmt::{Debug, Formatter}; +use std::hash::{Hash, Hasher}; use datafusion::arrow::datatypes::DataType; use datafusion::logical_expr::{ScalarFunctionArgs, ScalarUDFImpl}; @@ -33,6 +34,20 @@ impl Debug for ScalarUdf { } } +impl PartialEq for ScalarUdf { + fn eq(&self, other: &Self) -> bool { + self.function.signature() == other.function.signature() + } +} + +impl Eq for ScalarUdf {} + +impl Hash for ScalarUdf { + fn hash(&self, state: &mut H) { + self.function.signature().hash(state) + } +} + impl ScalarUDFImpl for ScalarUdf { fn as_any(&self) -> &dyn Any { self diff --git a/src/common/function/src/system/pg_catalog.rs b/src/common/function/src/system/pg_catalog.rs index c768aae2483d..3f034598965d 100644 --- a/src/common/function/src/system/pg_catalog.rs +++ b/src/common/function/src/system/pg_catalog.rs @@ -21,7 +21,7 @@ use datafusion::catalog::TableFunction; use datafusion::common::ScalarValue; use datafusion::common::utils::SingleRowListArrayBuilder; use datafusion_expr::{ColumnarValue, ScalarFunctionArgs, Signature, Volatility}; -use datafusion_pg_catalog::pg_catalog::{self, PgCatalogStaticTables}; +use datafusion_postgres::pg_catalog::{self, PgCatalogStaticTables}; use datatypes::arrow::datatypes::{DataType, Field}; use version::PGVersionFunction; diff --git a/src/common/macro/src/admin_fn.rs b/src/common/macro/src/admin_fn.rs index ca97e5468f36..651c083ec84c 100644 --- a/src/common/macro/src/admin_fn.rs +++ b/src/common/macro/src/admin_fn.rs @@ -345,6 +345,20 @@ fn build_struct( Ok(datafusion_expr::ColumnarValue::Array(result_vector.to_arrow_array())) } } + + impl PartialEq for #name { + fn eq(&self, other: &Self) -> bool { + self.signature == other.signature + } + } + + impl Eq for #name {} + + impl std::hash::Hash for #name { + fn hash(&self, state: &mut H) { + self.signature.hash(state) + } + } } .into() } diff --git a/src/datatypes/src/schema.rs b/src/datatypes/src/schema.rs index 8a79b3c02e2b..6bdf321137ee 100644 --- a/src/datatypes/src/schema.rs +++ b/src/datatypes/src/schema.rs @@ -368,8 +368,7 @@ impl TryFrom for Schema { type Error = Error; fn try_from(value: DFSchemaRef) -> Result { - let s: ArrowSchema = value.as_ref().into(); - s.try_into() + value.inner().clone().try_into() } } diff --git a/src/datatypes/src/value.rs b/src/datatypes/src/value.rs index d1eb6c09d3e0..abc7422f568c 100644 --- a/src/datatypes/src/value.rs +++ b/src/datatypes/src/value.rs @@ -1131,7 +1131,9 @@ impl TryFrom for Value { .collect::>>()?; Value::Struct(StructValue::try_new(items, struct_type)?) } - ScalarValue::Decimal256(_, _, _) + ScalarValue::Decimal32(_, _, _) + | ScalarValue::Decimal64(_, _, _) + | ScalarValue::Decimal256(_, _, _) | ScalarValue::FixedSizeList(_) | ScalarValue::LargeList(_) | ScalarValue::Dictionary(_, _) diff --git a/src/datatypes/src/vectors/helper.rs b/src/datatypes/src/vectors/helper.rs index 035ebf4ab6dc..20ccd6272bcf 100644 --- a/src/datatypes/src/vectors/helper.rs +++ b/src/datatypes/src/vectors/helper.rs @@ -245,7 +245,9 @@ impl Helper { length, ) } - ScalarValue::Decimal256(_, _, _) + ScalarValue::Decimal32(_, _, _) + | ScalarValue::Decimal64(_, _, _) + | ScalarValue::Decimal256(_, _, _) | ScalarValue::FixedSizeList(_) | ScalarValue::LargeList(_) | ScalarValue::Dictionary(_, _) diff --git a/src/flow/src/df_optimizer.rs b/src/flow/src/df_optimizer.rs index 5fa180d53c60..1d41d093464a 100644 --- a/src/flow/src/df_optimizer.rs +++ b/src/flow/src/df_optimizer.rs @@ -427,7 +427,7 @@ fn expand_tumble_analyzer( /// This is a placeholder for tumble_start and tumble_end function, so that datafusion can /// recognize them as scalar function -#[derive(Debug)] +#[derive(Debug, PartialEq, Eq, Hash)] pub struct TumbleExpand { signature: Signature, name: String, diff --git a/src/operator/src/expr_helper.rs b/src/operator/src/expr_helper.rs index b3a503a49967..9b1c2a2d1f56 100644 --- a/src/operator/src/expr_helper.rs +++ b/src/operator/src/expr_helper.rs @@ -939,11 +939,10 @@ pub fn to_create_flow_task_expr( query_ctx: &QueryContextRef, ) -> Result { // retrieve sink table name - let sink_table_ref = - object_name_to_table_reference(create_flow.sink_table_name.clone().into(), true) - .with_context(|_| ConvertIdentifierSnafu { - ident: create_flow.sink_table_name.to_string(), - })?; + let sink_table_ref = object_name_to_table_reference(create_flow.sink_table_name.clone(), true) + .with_context(|_| ConvertIdentifierSnafu { + ident: create_flow.sink_table_name.to_string(), + })?; let catalog = sink_table_ref .catalog() .unwrap_or(query_ctx.current_catalog()) @@ -961,9 +960,11 @@ pub fn to_create_flow_task_expr( let source_table_names = extract_tables_from_query(&create_flow.query) .map(|name| { - let reference = object_name_to_table_reference(name.clone().into(), true) - .with_context(|_| ConvertIdentifierSnafu { - ident: name.to_string(), + let reference = + object_name_to_table_reference(name.clone(), true).with_context(|_| { + ConvertIdentifierSnafu { + ident: name.to_string(), + } })?; let catalog = reference .catalog() diff --git a/src/promql/src/extension_plan/empty_metric.rs b/src/promql/src/extension_plan/empty_metric.rs index 741a6b64bc97..5514cb1abb64 100644 --- a/src/promql/src/extension_plan/empty_metric.rs +++ b/src/promql/src/extension_plan/empty_metric.rs @@ -123,7 +123,7 @@ impl EmptyMetric { physical_planner.create_physical_expr(expr, &self.time_index_schema, session_state) }) .transpose()?; - let result_schema: SchemaRef = Arc::new(self.result_schema.as_ref().into()); + let result_schema: SchemaRef = self.result_schema.inner().clone(); let properties = Arc::new(PlanProperties::new( EquivalenceProperties::new(result_schema.clone()), Partitioning::UnknownPartitioning(1), @@ -134,7 +134,7 @@ impl EmptyMetric { start: self.start, end: self.end, interval: self.interval, - time_index_schema: Arc::new(self.time_index_schema.as_ref().into()), + time_index_schema: self.time_index_schema.inner().clone(), result_schema, expr: physical_expr, properties, diff --git a/src/promql/src/extension_plan/histogram_fold.rs b/src/promql/src/extension_plan/histogram_fold.rs index 4742bf49d4a8..a6df27fe4e85 100644 --- a/src/promql/src/extension_plan/histogram_fold.rs +++ b/src/promql/src/extension_plan/histogram_fold.rs @@ -181,7 +181,7 @@ impl HistogramFold { .index_of_column_by_name(None, &self.ts_column) .unwrap(); - let output_schema: SchemaRef = Arc::new(self.output_schema.as_ref().into()); + let output_schema: SchemaRef = self.output_schema.inner().clone(); let properties = PlanProperties::new( EquivalenceProperties::new(output_schema.clone()), Partitioning::UnknownPartitioning(1), @@ -805,14 +805,13 @@ mod test { async fn fold_overall() { let memory_exec = Arc::new(prepare_test_data()); let output_schema: SchemaRef = Arc::new( - (*HistogramFold::convert_schema( + HistogramFold::convert_schema( &Arc::new(memory_exec.schema().to_dfschema().unwrap()), "le", ) .unwrap() - .as_ref()) - .clone() - .into(), + .as_arrow() + .clone(), ); let properties = PlanProperties::new( EquivalenceProperties::new(output_schema.clone()), diff --git a/src/promql/src/extension_plan/range_manipulate.rs b/src/promql/src/extension_plan/range_manipulate.rs index 1e18e34cd196..9315c0620565 100644 --- a/src/promql/src/extension_plan/range_manipulate.rs +++ b/src/promql/src/extension_plan/range_manipulate.rs @@ -157,7 +157,7 @@ impl RangeManipulate { } pub fn to_execution_plan(&self, exec_input: Arc) -> Arc { - let output_schema: SchemaRef = SchemaRef::new(self.output_schema.as_ref().into()); + let output_schema: SchemaRef = self.output_schema.inner().clone(); let properties = exec_input.properties(); let properties = PlanProperties::new( EquivalenceProperties::new(output_schema.clone()), @@ -732,8 +732,8 @@ mod test { &field_columns, ) .unwrap() - .as_ref() - .into(), + .as_arrow() + .clone(), ); let properties = PlanProperties::new( EquivalenceProperties::new(manipulate_output_schema.clone()), diff --git a/src/promql/src/extension_plan/union_distinct_on.rs b/src/promql/src/extension_plan/union_distinct_on.rs index e5e80525b87f..795669a4e909 100644 --- a/src/promql/src/extension_plan/union_distinct_on.rs +++ b/src/promql/src/extension_plan/union_distinct_on.rs @@ -92,7 +92,7 @@ impl UnionDistinctOn { left_exec: Arc, right_exec: Arc, ) -> Arc { - let output_schema: SchemaRef = Arc::new(self.output_schema.as_ref().into()); + let output_schema: SchemaRef = self.output_schema.inner().clone(); let properties = Arc::new(PlanProperties::new( EquivalenceProperties::new(output_schema.clone()), Partitioning::UnknownPartitioning(1), diff --git a/src/query/Cargo.toml b/src/query/Cargo.toml index 0c6c2e033f9a..344d7bd5fc10 100644 --- a/src/query/Cargo.toml +++ b/src/query/Cargo.toml @@ -54,6 +54,7 @@ meter-core.workspace = true meter-macros.workspace = true object-store.workspace = true once_cell.workspace = true +parking_lot.workspace = true partition.workspace = true prometheus.workspace = true promql.workspace = true diff --git a/src/query/src/dist_plan/planner.rs b/src/query/src/dist_plan/planner.rs index 6c7eba6b1e72..cea8e5404549 100644 --- a/src/query/src/dist_plan/planner.rs +++ b/src/query/src/dist_plan/planner.rs @@ -163,7 +163,7 @@ impl ExtensionPlanner for DistExtensionPlanner { }; // TODO(ruihang): generate different execution plans for different variant merge operation - let schema = optimized_plan.schema().as_ref().into(); + let schema = optimized_plan.schema().as_arrow(); let query_ctx = session_state .config() .get_extension() @@ -173,7 +173,7 @@ impl ExtensionPlanner for DistExtensionPlanner { table_name, regions, input_plan.clone(), - &schema, + schema, self.region_query_handler.clone(), query_ctx, session_state.config().target_partitions(), diff --git a/src/query/src/optimizer/windowed_sort.rs b/src/query/src/optimizer/windowed_sort.rs index 8de6fc831724..b2077d7c5d40 100644 --- a/src/query/src/optimizer/windowed_sort.rs +++ b/src/query/src/optimizer/windowed_sort.rs @@ -115,6 +115,7 @@ impl WindowedSortPhysicalRule { sort_exec.fetch(), scanner_info.partition_ranges.clone(), sort_input, + sort_exec.create_filter(), )) }; @@ -196,9 +197,9 @@ fn fetch_partition_range(input: Arc) -> DataFusionResult() { - for (expr, output_name) in projection.expr() { - if let Some(column_expr) = expr.as_any().downcast_ref::() { - alias_map.push((column_expr.name().to_string(), output_name.clone())); + for expr in projection.expr() { + if let Some(column_expr) = expr.expr.as_any().downcast_ref::() { + alias_map.push((column_expr.name().to_string(), expr.alias.clone())); } } // resolve alias properly diff --git a/src/query/src/part_sort.rs b/src/query/src/part_sort.rs index e9d70ec17a3a..3787d06cfc4b 100644 --- a/src/query/src/part_sort.rs +++ b/src/query/src/part_sort.rs @@ -33,11 +33,13 @@ use datafusion::execution::{RecordBatchStream, TaskContext}; use datafusion::physical_plan::metrics::{BaselineMetrics, ExecutionPlanMetricsSet, MetricsSet}; use datafusion::physical_plan::{ DisplayAs, DisplayFormatType, ExecutionPlan, ExecutionPlanProperties, PlanProperties, TopK, + TopKDynamicFilters, }; use datafusion_common::{DataFusionError, internal_err}; use datafusion_physical_expr::PhysicalSortExpr; use futures::{Stream, StreamExt}; use itertools::Itertools; +use parking_lot::RwLock; use snafu::location; use store_api::region_engine::PartitionRange; @@ -58,6 +60,7 @@ pub struct PartSortExec { metrics: ExecutionPlanMetricsSet, partition_ranges: Vec>, properties: PlanProperties, + filter: Arc>, } impl PartSortExec { @@ -66,6 +69,7 @@ impl PartSortExec { limit: Option, partition_ranges: Vec>, input: Arc, + filter: Arc>, ) -> Self { let metrics = ExecutionPlanMetricsSet::new(); let properties = input.properties(); @@ -83,6 +87,7 @@ impl PartSortExec { metrics, partition_ranges, properties, + filter, } } @@ -110,6 +115,7 @@ impl PartSortExec { input_stream, self.partition_ranges[partition].clone(), partition, + self.filter.clone(), )?) as _; Ok(df_stream) @@ -166,6 +172,7 @@ impl ExecutionPlan for PartSortExec { self.limit, self.partition_ranges.clone(), new_input.clone(), + self.filter.clone(), ))) } @@ -227,6 +234,7 @@ struct PartSortStream { metrics: BaselineMetrics, context: Arc, root_metrics: ExecutionPlanMetricsSet, + filter: Arc>, } impl PartSortStream { @@ -237,6 +245,7 @@ impl PartSortStream { input: DfSendableRecordBatchStream, partition_ranges: Vec, partition: usize, + filter: Arc>, ) -> datafusion_common::Result { let buffer = if let Some(limit) = limit { PartSortBuffer::Top( @@ -249,7 +258,7 @@ impl PartSortStream { context.session_config().batch_size(), context.runtime_env(), &sort.metrics, - None, + filter.clone(), )?, 0, ) @@ -274,6 +283,7 @@ impl PartSortStream { metrics: BaselineMetrics::new(&sort.metrics, partition), context, root_metrics: sort.metrics.clone(), + filter, }) } } @@ -506,7 +516,7 @@ impl PartSortStream { self.context.session_config().batch_size(), self.context.runtime_env(), &self.root_metrics, - None, + self.filter.clone(), )?; let PartSortBuffer::Top(top_k, _) = std::mem::replace(&mut self.buffer, PartSortBuffer::Top(new_top_buffer, 0)) @@ -675,6 +685,7 @@ mod test { use arrow::json::ArrayWriter; use arrow_schema::{DataType, Field, Schema, SortOptions, TimeUnit}; use common_time::Timestamp; + use datafusion::physical_plan::sorts::sort::SortExec; use datafusion_physical_expr::expressions::Column; use futures::StreamExt; use store_api::region_engine::PartitionRange; @@ -1033,16 +1044,19 @@ mod test { cols }) .collect_vec(); - let mock_input = MockInputExec::new(batches, schema.clone()); + let mock_input = Arc::new(MockInputExec::new(batches, schema.clone())); + let expr = PhysicalSortExpr { + expr: Arc::new(Column::new("ts", 0)), + options: opt, + }; + let sort_exec = SortExec::new([expr.clone()].into(), mock_input.clone()); let exec = PartSortExec::new( - PhysicalSortExpr { - expr: Arc::new(Column::new("ts", 0)), - options: opt, - }, + expr, limit, vec![ranges.clone()], - Arc::new(mock_input), + mock_input, + sort_exec.create_filter(), ); let exec_stream = exec.execute(0, Arc::new(TaskContext::default())).unwrap(); diff --git a/src/query/src/planner.rs b/src/query/src/planner.rs index e59be28cebc8..faba24a74271 100644 --- a/src/query/src/planner.rs +++ b/src/query/src/planner.rs @@ -14,6 +14,7 @@ use std::any::Any; use std::borrow::Cow; +use std::str::FromStr; use std::sync::Arc; use async_trait::async_trait; @@ -116,9 +117,10 @@ impl DfLogicalPlanner { // default to configuration value let options = self.session_state.config().options(); - let format = format.as_ref().unwrap_or(&options.explain.format); - - let format: ExplainFormat = format.parse()?; + let format = format + .map(|x| ExplainFormat::from_str(&x)) + .transpose()? + .unwrap_or_else(|| options.explain.format.clone()); Ok(LogicalPlan::Explain(Explain { verbose, @@ -208,8 +210,7 @@ impl DfLogicalPlanner { let Statement::Query(query) = stmt.into_owned() else { unreachable!("is_tql_cte should only be true for Query statements"); }; - let sqlparser_stmt = - datafusion::sql::sqlparser::ast::Statement::Query(Box::new(query.inner.into())); + let sqlparser_stmt = sqlparser::ast::Statement::Query(Box::new(query.inner)); sql_to_rel .sql_statement_to_plan_with_context(sqlparser_stmt, &mut planner_context) .context(PlanSqlSnafu)? @@ -261,7 +262,7 @@ impl DfLogicalPlanner { let sql_to_rel = SqlToRel::new_with_options(&context_provider, parser_options); - Ok(sql_to_rel.sql_to_expr(sql.into(), schema, &mut PlannerContext::new())?) + Ok(sql_to_rel.sql_to_expr(sql, schema, &mut PlannerContext::new())?) } #[tracing::instrument(skip_all)] diff --git a/src/query/src/promql/planner.rs b/src/query/src/promql/planner.rs index b65cddc2e227..a1dc1b640a02 100644 --- a/src/query/src/promql/planner.rs +++ b/src/query/src/promql/planner.rs @@ -2464,6 +2464,7 @@ impl PromPlanner { window_frame: WindowFrame::new(Some(true)), null_treatment: None, distinct: false, + filter: None, }, })) }) diff --git a/src/servers/Cargo.toml b/src/servers/Cargo.toml index 26dc8fe5f640..ee06d987319b 100644 --- a/src/servers/Cargo.toml +++ b/src/servers/Cargo.toml @@ -57,7 +57,7 @@ dashmap.workspace = true datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true -datafusion-pg-catalog.workspace = true +datafusion-postgres.workspace = true datatypes.workspace = true derive_builder.workspace = true futures.workspace = true diff --git a/src/servers/src/postgres/handler.rs b/src/servers/src/postgres/handler.rs index f3c1fdeca962..efe5dfd8c23a 100644 --- a/src/servers/src/postgres/handler.rs +++ b/src/servers/src/postgres/handler.rs @@ -21,7 +21,7 @@ use common_recordbatch::RecordBatch; use common_recordbatch::error::Result as RecordBatchResult; use common_telemetry::{debug, tracing}; use datafusion_common::ParamValues; -use datafusion_pg_catalog::sql::PostgresCompatibilityParser; +use datafusion_postgres::sql::PostgresCompatibilityParser; use datatypes::prelude::ConcreteDataType; use datatypes::schema::SchemaRef; use futures::{Sink, SinkExt, Stream, StreamExt, future, stream}; diff --git a/src/sql/src/ast.rs b/src/sql/src/ast.rs index 5d207fb5793b..122740987a0e 100644 --- a/src/sql/src/ast.rs +++ b/src/sql/src/ast.rs @@ -25,7 +25,10 @@ pub trait ObjectNamePartExt { impl ObjectNamePartExt for ObjectNamePart { fn to_string_unquoted(&self) -> String { - let ObjectNamePart::Identifier(ident) = self; + let ObjectNamePart::Identifier(ident) = self else { + // If it's not an ident, just return it as a string. + return self.to_string(); + }; ident.value.clone() } } diff --git a/src/sql/src/parser.rs b/src/sql/src/parser.rs index 6e2a880348cd..6c2a7e11ab2d 100644 --- a/src/sql/src/parser.rs +++ b/src/sql/src/parser.rs @@ -14,15 +14,15 @@ use std::str::FromStr; -use snafu::ResultExt; -use sqlparser::ast::{Ident, ObjectNamePart, Query, Value}; +use snafu::{OptionExt, ResultExt}; +use sqlparser::ast::{Ident, Query, Value}; use sqlparser::dialect::Dialect; use sqlparser::keywords::Keyword; use sqlparser::parser::{Parser, ParserError, ParserOptions}; use sqlparser::tokenizer::{Token, TokenWithSpan}; use crate::ast::{Expr, ObjectName}; -use crate::error::{self, Result, SyntaxSnafu}; +use crate::error::{self, InvalidSqlSnafu, Result, SyntaxSnafu}; use crate::parsers::tql_parser; use crate::statements::kill::Kill; use crate::statements::statement::Statement; @@ -106,7 +106,7 @@ impl ParserContext<'_> { expected: "a table name", actual: self.parser.peek_token().to_string(), })?; - Ok(Self::canonicalize_object_name(raw_table_name)) + Self::canonicalize_object_name(raw_table_name) } pub fn parse_function(sql: &str, dialect: &dyn Dialect) -> Result { @@ -303,17 +303,20 @@ impl ParserContext<'_> { } /// Like [canonicalize_identifier] but for [ObjectName]. - pub fn canonicalize_object_name(object_name: ObjectName) -> ObjectName { + pub(crate) fn canonicalize_object_name(object_name: ObjectName) -> Result { object_name .0 .into_iter() .map(|x| { - let ObjectNamePart::Identifier(ident) = x; - ident + x.as_ident() + .cloned() + .map(Self::canonicalize_identifier) + .with_context(|| InvalidSqlSnafu { + msg: format!("not an ident: '{x}'"), + }) }) - .map(Self::canonicalize_identifier) - .collect::>() - .into() + .collect::>>() + .map(Into::into) } /// Simply a shortcut for sqlparser's same name method `parse_object_name`, diff --git a/src/sql/src/parsers/alter_parser.rs b/src/sql/src/parsers/alter_parser.rs index bbbcb1d2f6d8..4873e6fd1382 100644 --- a/src/sql/src/parsers/alter_parser.rs +++ b/src/sql/src/parsers/alter_parser.rs @@ -67,7 +67,7 @@ impl ParserContext<'_> { .parser .parse_object_name(false) .context(error::SyntaxSnafu)?; - let database_name = Self::canonicalize_object_name(database_name); + let database_name = Self::canonicalize_object_name(database_name)?; match self.parser.peek_token().token { Token::Word(w) => { @@ -116,7 +116,7 @@ impl ParserContext<'_> { .parser .parse_object_name(false) .context(error::SyntaxSnafu)?; - let table_name = Self::canonicalize_object_name(raw_table_name); + let table_name = Self::canonicalize_object_name(raw_table_name)?; let alter_operation = match self.parser.peek_token().token { Token::Word(w) => { @@ -142,7 +142,7 @@ impl ParserContext<'_> { let new_table_name_obj_raw = self.parse_object_name().context(error::SyntaxSnafu)?; let new_table_name_obj = - Self::canonicalize_object_name(new_table_name_obj_raw); + Self::canonicalize_object_name(new_table_name_obj_raw)?; let new_table_name = match &new_table_name_obj.0[..] { [table] => table.to_string_unquoted(), _ => { diff --git a/src/sql/src/parsers/copy_parser.rs b/src/sql/src/parsers/copy_parser.rs index 185aa4dbcfac..bc0f06abf300 100644 --- a/src/sql/src/parsers/copy_parser.rs +++ b/src/sql/src/parsers/copy_parser.rs @@ -108,7 +108,7 @@ impl ParserContext<'_> { expected: "a table name", actual: self.peek_token_as_string(), })?; - let table_name = Self::canonicalize_object_name(raw_table_name); + let table_name = Self::canonicalize_object_name(raw_table_name)?; if self.parser.parse_keyword(Keyword::TO) { let (with, connection, location, limit) = self.parse_copy_parameters()?; diff --git a/src/sql/src/parsers/create_parser.rs b/src/sql/src/parsers/create_parser.rs index 30a087088a97..8b914ea03032 100644 --- a/src/sql/src/parsers/create_parser.rs +++ b/src/sql/src/parsers/create_parser.rs @@ -195,7 +195,7 @@ impl<'a> ParserContext<'a> { expected: "a database name", actual: self.peek_token_as_string(), })?; - let database_name = Self::canonicalize_object_name(database_name); + let database_name = Self::canonicalize_object_name(database_name)?; let options = self .parser diff --git a/src/sql/src/parsers/cursor_parser.rs b/src/sql/src/parsers/cursor_parser.rs index 5d6deee12ca4..eb907b8d7633 100644 --- a/src/sql/src/parsers/cursor_parser.rs +++ b/src/sql/src/parsers/cursor_parser.rs @@ -51,7 +51,7 @@ impl ParserContext<'_> { let query_stmt = self.parse_query()?; match query_stmt { Statement::Query(query) => Ok(Statement::DeclareCursor(DeclareCursor { - cursor_name: ParserContext::canonicalize_object_name(cursor_name), + cursor_name: ParserContext::canonicalize_object_name(cursor_name)?, query, })), _ => error::InvalidSqlSnafu { @@ -78,7 +78,7 @@ impl ParserContext<'_> { .context(error::SyntaxSnafu)?; Ok(Statement::FetchCursor(FetchCursor { - cursor_name: ParserContext::canonicalize_object_name(cursor_name), + cursor_name: ParserContext::canonicalize_object_name(cursor_name)?, fetch_size, })) } @@ -91,7 +91,7 @@ impl ParserContext<'_> { .context(error::SyntaxSnafu)?; Ok(Statement::CloseCursor(CloseCursor { - cursor_name: ParserContext::canonicalize_object_name(cursor_name), + cursor_name: ParserContext::canonicalize_object_name(cursor_name)?, })) } } diff --git a/src/sql/src/parsers/describe_parser.rs b/src/sql/src/parsers/describe_parser.rs index 849dca468bcf..9a418cba3173 100644 --- a/src/sql/src/parsers/describe_parser.rs +++ b/src/sql/src/parsers/describe_parser.rs @@ -36,7 +36,7 @@ impl ParserContext<'_> { expected: "a table name", actual: self.peek_token_as_string(), })?; - let table_idents = Self::canonicalize_object_name(raw_table_idents); + let table_idents = Self::canonicalize_object_name(raw_table_idents)?; ensure!( !table_idents.0.is_empty(), InvalidTableNameSnafu { diff --git a/src/sql/src/parsers/drop_parser.rs b/src/sql/src/parsers/drop_parser.rs index 8f3872d95771..39de64e94559 100644 --- a/src/sql/src/parsers/drop_parser.rs +++ b/src/sql/src/parsers/drop_parser.rs @@ -58,7 +58,7 @@ impl ParserContext<'_> { expected: "a trigger name", actual: self.peek_token_as_string(), })?; - let trigger_ident = Self::canonicalize_object_name(raw_trigger_ident); + let trigger_ident = Self::canonicalize_object_name(raw_trigger_ident)?; ensure!( !trigger_ident.0.is_empty(), error::InvalidTriggerNameSnafu { @@ -82,7 +82,7 @@ impl ParserContext<'_> { expected: "a view name", actual: self.peek_token_as_string(), })?; - let view_ident = Self::canonicalize_object_name(raw_view_ident); + let view_ident = Self::canonicalize_object_name(raw_view_ident)?; ensure!( !view_ident.0.is_empty(), InvalidTableNameSnafu { @@ -106,7 +106,7 @@ impl ParserContext<'_> { expected: "a flow name", actual: self.peek_token_as_string(), })?; - let flow_ident = Self::canonicalize_object_name(raw_flow_ident); + let flow_ident = Self::canonicalize_object_name(raw_flow_ident)?; ensure!( !flow_ident.0.is_empty(), InvalidFlowNameSnafu { @@ -129,7 +129,7 @@ impl ParserContext<'_> { expected: "a table name", actual: self.peek_token_as_string(), })?; - let table_ident = Self::canonicalize_object_name(raw_table_ident); + let table_ident = Self::canonicalize_object_name(raw_table_ident)?; ensure!( !table_ident.0.is_empty(), InvalidTableNameSnafu { @@ -155,7 +155,7 @@ impl ParserContext<'_> { expected: "a database name", actual: self.peek_token_as_string(), })?; - let database_name = Self::canonicalize_object_name(database_name); + let database_name = Self::canonicalize_object_name(database_name)?; Ok(Statement::DropDatabase(DropDatabase::new( database_name, diff --git a/src/sql/src/parsers/explain_parser.rs b/src/sql/src/parsers/explain_parser.rs index c595efc86d82..720c9209a4d1 100644 --- a/src/sql/src/parsers/explain_parser.rs +++ b/src/sql/src/parsers/explain_parser.rs @@ -73,6 +73,7 @@ mod tests { projection: vec![sqlparser::ast::SelectItem::Wildcard( WildcardAdditionalOptions::default(), )], + exclude: None, into: None, from: vec![sqlparser::ast::TableWithJoins { relation: sqlparser::ast::TableFactor::Table { @@ -112,9 +113,8 @@ mod tests { with: None, body: Box::new(sqlparser::ast::SetExpr::Select(Box::new(select))), order_by: None, - limit: None, - limit_by: vec![], - offset: None, + limit_clause: None, + pipe_operators: vec![], fetch: None, locks: vec![], for_clause: None, diff --git a/src/sql/src/parsers/set_var_parser.rs b/src/sql/src/parsers/set_var_parser.rs index d04a46670401..8290f00af8a1 100644 --- a/src/sql/src/parsers/set_var_parser.rs +++ b/src/sql/src/parsers/set_var_parser.rs @@ -13,7 +13,7 @@ // limitations under the License. use snafu::ResultExt; -use sqlparser::ast::Statement as SpStatement; +use sqlparser::ast::{Set, Statement as SpStatement}; use crate::ast::{Ident, ObjectName}; use crate::error::{self, Result}; @@ -27,21 +27,27 @@ impl ParserContext<'_> { let _ = self.parser.next_token(); let spstatement = self.parser.parse_set().context(error::SyntaxSnafu)?; match spstatement { - SpStatement::SetVariable { - variables, - value, - hivevar, - .. - } if !hivevar => Ok(Statement::SetVariables(SetVariables { - variable: (*variables)[0].clone(), - value, - })), + SpStatement::Set(set) => match set { + Set::SingleAssignment { + scope: _, + hivevar, + variable, + values, + } if !hivevar => Ok(Statement::SetVariables(SetVariables { + variable, + value: values, + })), - SpStatement::SetTimeZone { value, .. } => Ok(Statement::SetVariables(SetVariables { - variable: ObjectName::from(vec![Ident::new("TIMEZONE")]), - value: vec![value], - })), + Set::SetTimeZone { local: _, value } => Ok(Statement::SetVariables(SetVariables { + variable: ObjectName::from(vec![Ident::new("TIMEZONE")]), + value: vec![value], + })), + set => error::UnsupportedSnafu { + keyword: set.to_string(), + } + .fail(), + }, unexp => error::UnsupportedSnafu { keyword: unexp.to_string(), } diff --git a/src/sql/src/parsers/show_parser.rs b/src/sql/src/parsers/show_parser.rs index 005653450c1c..e2e5fc50ac1a 100644 --- a/src/sql/src/parsers/show_parser.rs +++ b/src/sql/src/parsers/show_parser.rs @@ -148,7 +148,7 @@ impl ParserContext<'_> { expected: "a database name", actual: self.peek_token_as_string(), })?; - let database_name = Self::canonicalize_object_name(raw_database_name); + let database_name = Self::canonicalize_object_name(raw_database_name)?; ensure!( !database_name.0.is_empty(), InvalidDatabaseNameSnafu { @@ -168,7 +168,7 @@ impl ParserContext<'_> { expected: "a table name", actual: self.peek_token_as_string(), })?; - let table_name = Self::canonicalize_object_name(raw_table_name); + let table_name = Self::canonicalize_object_name(raw_table_name)?; ensure!( !table_name.0.is_empty(), InvalidTableNameSnafu { @@ -197,7 +197,7 @@ impl ParserContext<'_> { expected: "a flow name", actual: self.peek_token_as_string(), })?; - let flow_name = Self::canonicalize_object_name(raw_flow_name); + let flow_name = Self::canonicalize_object_name(raw_flow_name)?; ensure!( !flow_name.0.is_empty(), InvalidFlowNameSnafu { @@ -214,7 +214,7 @@ impl ParserContext<'_> { expected: "a view name", actual: self.peek_token_as_string(), })?; - let view_name = Self::canonicalize_object_name(raw_view_name); + let view_name = Self::canonicalize_object_name(raw_view_name)?; ensure!( !view_name.0.is_empty(), InvalidTableNameSnafu { @@ -241,7 +241,7 @@ impl ParserContext<'_> { ); // Safety: already checked above - Ok(Self::canonicalize_object_name(table_name).0[0].to_string_unquoted()) + Ok(Self::canonicalize_object_name(table_name)?.0[0].to_string_unquoted()) } fn parse_db_name(&mut self) -> Result> { @@ -262,7 +262,7 @@ impl ParserContext<'_> { // Safety: already checked above Ok(Some( - Self::canonicalize_object_name(db_name).0[0].to_string_unquoted(), + Self::canonicalize_object_name(db_name)?.0[0].to_string_unquoted(), )) } diff --git a/src/sql/src/parsers/show_parser/trigger.rs b/src/sql/src/parsers/show_parser/trigger.rs index 9fecadd089f3..10054ba4a406 100644 --- a/src/sql/src/parsers/show_parser/trigger.rs +++ b/src/sql/src/parsers/show_parser/trigger.rs @@ -20,7 +20,7 @@ impl ParserContext<'_> { actual: self.peek_token_as_string(), })?; - let trigger_name = Self::canonicalize_object_name(trigger_name); + let trigger_name = Self::canonicalize_object_name(trigger_name)?; ensure!( !trigger_name.0.is_empty(), diff --git a/src/sql/src/parsers/truncate_parser.rs b/src/sql/src/parsers/truncate_parser.rs index e7dd9a8c7437..1fe04865751f 100644 --- a/src/sql/src/parsers/truncate_parser.rs +++ b/src/sql/src/parsers/truncate_parser.rs @@ -33,7 +33,7 @@ impl ParserContext<'_> { expected: "a table name", actual: self.peek_token_as_string(), })?; - let table_ident = Self::canonicalize_object_name(raw_table_ident); + let table_ident = Self::canonicalize_object_name(raw_table_ident)?; ensure!( !table_ident.0.is_empty(), diff --git a/src/sql/src/parsers/utils.rs b/src/sql/src/parsers/utils.rs index 15ef50ab71f6..593801808294 100644 --- a/src/sql/src/parsers/utils.rs +++ b/src/sql/src/parsers/utils.rs @@ -75,7 +75,7 @@ pub fn parser_expr_to_scalar_value_literal( // 1. convert parser expr to logical expr let empty_df_schema = DFSchema::empty(); let logical_expr = SqlToRel::new(&StubContextProvider::default()) - .sql_to_expr(expr.into(), &empty_df_schema, &mut Default::default()) + .sql_to_expr(expr, &empty_df_schema, &mut Default::default()) .context(ConvertToLogicalExpressionSnafu)?; struct FindNow { diff --git a/src/sql/src/statements/statement.rs b/src/sql/src/statements/statement.rs index d0096baa7152..f723409a6bab 100644 --- a/src/sql/src/statements/statement.rs +++ b/src/sql/src/statements/statement.rs @@ -310,6 +310,6 @@ impl TryFrom<&Statement> for DfStatement { .fail(); } }; - Ok(DfStatement::Statement(Box::new(s.into()))) + Ok(DfStatement::Statement(Box::new(s))) } } diff --git a/src/sql/src/util.rs b/src/sql/src/util.rs index 7de02ca1fa30..e75918907d63 100644 --- a/src/sql/src/util.rs +++ b/src/sql/src/util.rs @@ -120,7 +120,7 @@ fn extract_tables_from_set_expr(set_expr: &SetExpr, names: &mut HashSet {} + _ => {} }; } From b39a7129c0c95156b6cd4f6a1842e1b3c18b2088 Mon Sep 17 00:00:00 2001 From: luofucong Date: Mon, 13 Oct 2025 21:37:30 +0800 Subject: [PATCH 2/8] fix ci Signed-off-by: luofucong --- Cargo.toml | 2 +- src/common/function/Cargo.toml | 2 +- .../standalone/common/aggregate/stddev.result | 112 ++++++------- .../common/function/arithmetic.result | 30 ++-- tests/cases/standalone/common/range/by.result | 12 +- .../standalone/common/range/calculate.result | 32 ++-- .../common/tql-explain-analyze/explain.result | 2 + .../common/types/string/bigstring.result | 16 +- .../types/string/scan_big_varchar.result | 150 +++++++++--------- .../common/types/string/unicode.result | 12 +- 10 files changed, 186 insertions(+), 184 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 26a8c44eff36..3422a0ed8f46 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -130,9 +130,9 @@ datafusion-functions = "50" datafusion-functions-aggregate-common = "50" datafusion-optimizer = "50" datafusion-orc = { git = "https://github.com/GreptimeTeam/datafusion-orc", rev = "2971b041ce1c94e315ac5b327589da6d61f449c0" } -datafusion-postgres = { git = "https://github.com/datafusion-contrib/datafusion-postgres", rev = "7c1db5efdbf25924246f49b061acbbdf2d4af649" } datafusion-physical-expr = "50" datafusion-physical-plan = "50" +datafusion-postgres = { git = "https://github.com/datafusion-contrib/datafusion-postgres", rev = "7c1db5efdbf25924246f49b061acbbdf2d4af649" } datafusion-sql = "50" datafusion-substrait = "50" deadpool = "0.12" diff --git a/src/common/function/Cargo.toml b/src/common/function/Cargo.toml index 94681404e439..3ac122dcee8f 100644 --- a/src/common/function/Cargo.toml +++ b/src/common/function/Cargo.toml @@ -36,8 +36,8 @@ datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true datafusion-functions-aggregate-common.workspace = true -datafusion-postgres.workspace = true datafusion-physical-expr.workspace = true +datafusion-postgres.workspace = true datatypes.workspace = true derive_more = { version = "1", default-features = false, features = ["display"] } geo = { version = "0.29", optional = true } diff --git a/tests/cases/standalone/common/aggregate/stddev.result b/tests/cases/standalone/common/aggregate/stddev.result index 4cabcd313a1d..78948c67d8f4 100644 --- a/tests/cases/standalone/common/aggregate/stddev.result +++ b/tests/cases/standalone/common/aggregate/stddev.result @@ -10,55 +10,55 @@ Affected Rows: 6 SELECT stddev_samp(1); -+------------------+ -| stddev(Int64(1)) | -+------------------+ -| | -+------------------+ ++-----------------------+ +| stddev_samp(Int64(1)) | ++-----------------------+ +| | ++-----------------------+ SELECT var_samp(1); -+---------------+ -| var(Int64(1)) | -+---------------+ -| | -+---------------+ ++--------------------+ +| var_samp(Int64(1)) | ++--------------------+ +| | ++--------------------+ -- stddev_samp SELECT round(stddev_samp(val), 1) FROM stddev_test; -+-----------------------------------------+ -| round(stddev(stddev_test.val),Int64(1)) | -+-----------------------------------------+ -| 478.8 | -+-----------------------------------------+ ++----------------------------------------------+ +| round(stddev_samp(stddev_test.val),Int64(1)) | ++----------------------------------------------+ +| 478.8 | ++----------------------------------------------+ SELECT round(stddev_samp(val), 1) FROM stddev_test WHERE val IS NOT NULL; -+-----------------------------------------+ -| round(stddev(stddev_test.val),Int64(1)) | -+-----------------------------------------+ -| 478.8 | -+-----------------------------------------+ ++----------------------------------------------+ +| round(stddev_samp(stddev_test.val),Int64(1)) | ++----------------------------------------------+ +| 478.8 | ++----------------------------------------------+ SELECT grp, sum(val), round(stddev_samp(val), 1), min(val) FROM stddev_test GROUP BY grp ORDER BY grp; -+-----+----------------------+-----------------------------------------+----------------------+ -| grp | sum(stddev_test.val) | round(stddev(stddev_test.val),Int64(1)) | min(stddev_test.val) | -+-----+----------------------+-----------------------------------------+----------------------+ -| 1 | 85 | 0.7 | 42 | -| 2 | 1042 | 677.4 | 42 | -| 3 | | | | -+-----+----------------------+-----------------------------------------+----------------------+ ++-----+----------------------+----------------------------------------------+----------------------+ +| grp | sum(stddev_test.val) | round(stddev_samp(stddev_test.val),Int64(1)) | min(stddev_test.val) | ++-----+----------------------+----------------------------------------------+----------------------+ +| 1 | 85 | 0.7 | 42 | +| 2 | 1042 | 677.4 | 42 | +| 3 | | | | ++-----+----------------------+----------------------------------------------+----------------------+ SELECT grp, sum(val), round(stddev_samp(val), 1), min(val) FROM stddev_test WHERE val IS NOT NULL GROUP BY grp ORDER BY grp; -+-----+----------------------+-----------------------------------------+----------------------+ -| grp | sum(stddev_test.val) | round(stddev(stddev_test.val),Int64(1)) | min(stddev_test.val) | -+-----+----------------------+-----------------------------------------+----------------------+ -| 1 | 85 | 0.7 | 42 | -| 2 | 1042 | 677.4 | 42 | -+-----+----------------------+-----------------------------------------+----------------------+ ++-----+----------------------+----------------------------------------------+----------------------+ +| grp | sum(stddev_test.val) | round(stddev_samp(stddev_test.val),Int64(1)) | min(stddev_test.val) | ++-----+----------------------+----------------------------------------------+----------------------+ +| 1 | 85 | 0.7 | 42 | +| 2 | 1042 | 677.4 | 42 | ++-----+----------------------+----------------------------------------------+----------------------+ -- stddev_pop SELECT round(stddev_pop(val), 1) FROM stddev_test; @@ -99,38 +99,38 @@ SELECT grp, sum(val), round(stddev_pop(val), 1), min(val) FROM stddev_test WHERE -- var_samp SELECT round(var_samp(val), 1) FROM stddev_test; -+--------------------------------------+ -| round(var(stddev_test.val),Int64(1)) | -+--------------------------------------+ -| 229281.6 | -+--------------------------------------+ ++-------------------------------------------+ +| round(var_samp(stddev_test.val),Int64(1)) | ++-------------------------------------------+ +| 229281.6 | ++-------------------------------------------+ SELECT round(var_samp(val), 1) FROM stddev_test WHERE val IS NOT NULL; -+--------------------------------------+ -| round(var(stddev_test.val),Int64(1)) | -+--------------------------------------+ -| 229281.6 | -+--------------------------------------+ ++-------------------------------------------+ +| round(var_samp(stddev_test.val),Int64(1)) | ++-------------------------------------------+ +| 229281.6 | ++-------------------------------------------+ SELECT grp, sum(val), round(var_samp(val), 1), min(val) FROM stddev_test GROUP BY grp ORDER BY grp; -+-----+----------------------+--------------------------------------+----------------------+ -| grp | sum(stddev_test.val) | round(var(stddev_test.val),Int64(1)) | min(stddev_test.val) | -+-----+----------------------+--------------------------------------+----------------------+ -| 1 | 85 | 0.5 | 42 | -| 2 | 1042 | 458882.0 | 42 | -| 3 | | | | -+-----+----------------------+--------------------------------------+----------------------+ ++-----+----------------------+-------------------------------------------+----------------------+ +| grp | sum(stddev_test.val) | round(var_samp(stddev_test.val),Int64(1)) | min(stddev_test.val) | ++-----+----------------------+-------------------------------------------+----------------------+ +| 1 | 85 | 0.5 | 42 | +| 2 | 1042 | 458882.0 | 42 | +| 3 | | | | ++-----+----------------------+-------------------------------------------+----------------------+ SELECT grp, sum(val), round(var_samp(val), 1), min(val) FROM stddev_test WHERE val IS NOT NULL GROUP BY grp ORDER BY grp; -+-----+----------------------+--------------------------------------+----------------------+ -| grp | sum(stddev_test.val) | round(var(stddev_test.val),Int64(1)) | min(stddev_test.val) | -+-----+----------------------+--------------------------------------+----------------------+ -| 1 | 85 | 0.5 | 42 | -| 2 | 1042 | 458882.0 | 42 | -+-----+----------------------+--------------------------------------+----------------------+ ++-----+----------------------+-------------------------------------------+----------------------+ +| grp | sum(stddev_test.val) | round(var_samp(stddev_test.val),Int64(1)) | min(stddev_test.val) | ++-----+----------------------+-------------------------------------------+----------------------+ +| 1 | 85 | 0.5 | 42 | +| 2 | 1042 | 458882.0 | 42 | ++-----+----------------------+-------------------------------------------+----------------------+ -- var_pop SELECT round(var_pop(val), 1) FROM stddev_test; diff --git a/tests/cases/standalone/common/function/arithmetic.result b/tests/cases/standalone/common/function/arithmetic.result index 01d2c7e06296..c1f6dcc387fe 100644 --- a/tests/cases/standalone/common/function/arithmetic.result +++ b/tests/cases/standalone/common/function/arithmetic.result @@ -28,27 +28,27 @@ Error: 3001(EngineExecuteQuery), Divide by zero error SELECT POW (2, 5); -+--------------------------+ -| power(Int64(2),Int64(5)) | -+--------------------------+ -| 32 | -+--------------------------+ ++------------------------+ +| pow(Int64(2),Int64(5)) | ++------------------------+ +| 32 | ++------------------------+ SELECT POW (1.01, 365); -+---------------------------------+ -| power(Float64(1.01),Int64(365)) | -+---------------------------------+ -| 37.78343433288728 | -+---------------------------------+ ++-------------------------------+ +| pow(Float64(1.01),Int64(365)) | ++-------------------------------+ +| 37.78343433288728 | ++-------------------------------+ SELECT POW (0.99, 365); -+---------------------------------+ -| power(Float64(0.99),Int64(365)) | -+---------------------------------+ -| 0.025517964452291125 | -+---------------------------------+ ++-------------------------------+ +| pow(Float64(0.99),Int64(365)) | ++-------------------------------+ +| 0.025517964452291125 | ++-------------------------------+ SELECT CLAMP(10, 0, 1); diff --git a/tests/cases/standalone/common/range/by.result b/tests/cases/standalone/common/range/by.result index 0f876eb02473..0fd95ee2f331 100644 --- a/tests/cases/standalone/common/range/by.result +++ b/tests/cases/standalone/common/range/by.result @@ -52,12 +52,12 @@ SELECT ts, max(val) RANGE '5s' FROM host ALIGN '20s' BY () ORDER BY ts; SELECT ts, length(host)::INT64 + 2, max(val) RANGE '5s' FROM host ALIGN '20s' BY (length(host)::INT64 + 2) ORDER BY ts; -+---------------------+------------------------------------------------------------------+------------------------+ -| ts | arrow_cast(character_length(host.host),Utf8("Int64")) + Int64(2) | max(host.val) RANGE 5s | -+---------------------+------------------------------------------------------------------+------------------------+ -| 1970-01-01T00:00:00 | 7 | 3 | -| 1970-01-01T00:00:20 | 7 | 5 | -+---------------------+------------------------------------------------------------------+------------------------+ ++---------------------+--------------------------------------------------------+------------------------+ +| ts | arrow_cast(length(host.host),Utf8("Int64")) + Int64(2) | max(host.val) RANGE 5s | ++---------------------+--------------------------------------------------------+------------------------+ +| 1970-01-01T00:00:00 | 7 | 3 | +| 1970-01-01T00:00:20 | 7 | 5 | ++---------------------+--------------------------------------------------------+------------------------+ -- Test error -- project non-aggregation key diff --git a/tests/cases/standalone/common/range/calculate.result b/tests/cases/standalone/common/range/calculate.result index 6ac21a935265..f27cbef398e1 100644 --- a/tests/cases/standalone/common/range/calculate.result +++ b/tests/cases/standalone/common/range/calculate.result @@ -188,22 +188,22 @@ SELECT ts, host, floor(cos(ceil(sin(min(val) RANGE '5s')))) FROM host ALIGN '5s' SELECT ts, host, gcd(CAST(max(floor(val::DOUBLE)) RANGE '10s' FILL PREV as INT64) * 4, max(val * 4) RANGE '10s' FILL PREV) * length(host) + 1 FROM host ALIGN '5s' ORDER BY host, ts; -+---------------------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| ts | host | gcd(arrow_cast(max(floor(host.val)) RANGE 10s FILL PREV,Utf8("Int64")) * Int64(4),max(host.val * Int64(4)) RANGE 10s FILL PREV) * character_length(host.host) + Int64(1) | -+---------------------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| 1969-12-31T23:59:55 | host1 | 1 | -| 1970-01-01T00:00:00 | host1 | 1 | -| 1970-01-01T00:00:05 | host1 | 21 | -| 1970-01-01T00:00:10 | host1 | 21 | -| 1970-01-01T00:00:15 | host1 | 41 | -| 1970-01-01T00:00:20 | host1 | 41 | -| 1969-12-31T23:59:55 | host2 | 61 | -| 1970-01-01T00:00:00 | host2 | 61 | -| 1970-01-01T00:00:05 | host2 | 81 | -| 1970-01-01T00:00:10 | host2 | 81 | -| 1970-01-01T00:00:15 | host2 | 101 | -| 1970-01-01T00:00:20 | host2 | 101 | -+---------------------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++---------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| ts | host | gcd(arrow_cast(max(floor(host.val)) RANGE 10s FILL PREV,Utf8("Int64")) * Int64(4),max(host.val * Int64(4)) RANGE 10s FILL PREV) * length(host.host) + Int64(1) | ++---------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| 1969-12-31T23:59:55 | host1 | 1 | +| 1970-01-01T00:00:00 | host1 | 1 | +| 1970-01-01T00:00:05 | host1 | 21 | +| 1970-01-01T00:00:10 | host1 | 21 | +| 1970-01-01T00:00:15 | host1 | 41 | +| 1970-01-01T00:00:20 | host1 | 41 | +| 1969-12-31T23:59:55 | host2 | 61 | +| 1970-01-01T00:00:00 | host2 | 61 | +| 1970-01-01T00:00:05 | host2 | 81 | +| 1970-01-01T00:00:10 | host2 | 81 | +| 1970-01-01T00:00:15 | host2 | 101 | +| 1970-01-01T00:00:20 | host2 | 101 | ++---------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ DROP TABLE host; diff --git a/tests/cases/standalone/common/tql-explain-analyze/explain.result b/tests/cases/standalone/common/tql-explain-analyze/explain.result index 33cd57b3279d..9b54dc92d4a6 100644 --- a/tests/cases/standalone/common/tql-explain-analyze/explain.result +++ b/tests/cases/standalone/common/tql-explain-analyze/explain.result @@ -184,6 +184,7 @@ TQL EXPLAIN VERBOSE (0, 10, '5s') test; | physical_plan after OutputRequirements_| MergeScanExec: REDACTED |_|_| | physical_plan after LimitAggregation_| SAME TEXT AS ABOVE_| +| physical_plan after LimitPushPastWindows_| SAME TEXT AS ABOVE_|, | physical_plan after LimitPushdown_| SAME TEXT AS ABOVE_| | physical_plan after ProjectionPushdown_| SAME TEXT AS ABOVE_| | physical_plan after EnsureCooperative_| CooperativeExec_| @@ -321,6 +322,7 @@ TQL EXPLAIN VERBOSE (0, 10, '5s') test AS series; | physical_plan after OutputRequirements_| MergeScanExec: REDACTED |_|_| | physical_plan after LimitAggregation_| SAME TEXT AS ABOVE_| +| physical_plan after LimitPushPastWindows_| SAME TEXT AS ABOVE_|, | physical_plan after LimitPushdown_| SAME TEXT AS ABOVE_| | physical_plan after ProjectionPushdown_| SAME TEXT AS ABOVE_| | physical_plan after EnsureCooperative_| CooperativeExec_| diff --git a/tests/cases/standalone/common/types/string/bigstring.result b/tests/cases/standalone/common/types/string/bigstring.result index 725f2dd659bb..a749e7538b9b 100644 --- a/tests/cases/standalone/common/types/string/bigstring.result +++ b/tests/cases/standalone/common/types/string/bigstring.result @@ -23,14 +23,14 @@ Affected Rows: 1 SELECT LENGTH(a) FROM test ORDER BY 1; -+--------------------------+ -| character_length(test.a) | -+--------------------------+ -| 10 | -| 100 | -| 1000 | -| 10000 | -+--------------------------+ ++----------------+ +| length(test.a) | ++----------------+ +| 10 | +| 100 | +| 1000 | +| 10000 | ++----------------+ DROP TABLE test; diff --git a/tests/cases/standalone/common/types/string/scan_big_varchar.result b/tests/cases/standalone/common/types/string/scan_big_varchar.result index 4d9261d1162a..374c8662bdb9 100644 --- a/tests/cases/standalone/common/types/string/scan_big_varchar.result +++ b/tests/cases/standalone/common/types/string/scan_big_varchar.result @@ -33,11 +33,11 @@ Affected Rows: 1 -- verify that the append worked SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 1 | 1 | 10000 | 10000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 1 | 1 | 10000 | 10000 | ++----------+-------------------+-------------------------+-------------------------+ -- we create a total of 16K entries in the big table -- the total size of this table is 16K*10K = 160MB @@ -48,11 +48,11 @@ Affected Rows: 1 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 2 | 2 | 10000 | 20000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 2 | 2 | 10000 | 20000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 23 FROM bigtable; @@ -60,11 +60,11 @@ Affected Rows: 2 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 4 | 4 | 10000 | 40000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 4 | 4 | 10000 | 40000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 31 FROM bigtable; @@ -72,11 +72,11 @@ Affected Rows: 4 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 8 | 8 | 10000 | 80000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 8 | 8 | 10000 | 80000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 37 FROM bigtable; @@ -84,11 +84,11 @@ Affected Rows: 8 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 16 | 16 | 10000 | 160000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 16 | 16 | 10000 | 160000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 41 FROM bigtable; @@ -96,11 +96,11 @@ Affected Rows: 16 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 32 | 32 | 10000 | 320000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 32 | 32 | 10000 | 320000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 47 FROM bigtable; @@ -108,11 +108,11 @@ Affected Rows: 32 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 64 | 64 | 10000 | 640000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 64 | 64 | 10000 | 640000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 51 FROM bigtable; @@ -120,11 +120,11 @@ Affected Rows: 64 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 128 | 128 | 10000 | 1280000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 128 | 128 | 10000 | 1280000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 53 FROM bigtable; @@ -132,11 +132,11 @@ Affected Rows: 128 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 256 | 256 | 10000 | 2560000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 256 | 256 | 10000 | 2560000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 57 FROM bigtable; @@ -144,11 +144,11 @@ Affected Rows: 256 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 512 | 512 | 10000 | 5120000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 512 | 512 | 10000 | 5120000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 61 FROM bigtable; @@ -156,11 +156,11 @@ Affected Rows: 512 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 1024 | 1024 | 10000 | 10240000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 1024 | 1024 | 10000 | 10240000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 63 FROM bigtable; @@ -168,20 +168,20 @@ Affected Rows: 1024 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 2048 | 2048 | 10000 | 20480000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 2048 | 2048 | 10000 | 20480000 | ++----------+-------------------+-------------------------+-------------------------+ -- SQLNESS ARG restart=true SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 2048 | 2048 | 10000 | 20480000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 2048 | 2048 | 10000 | 20480000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 67 FROM bigtable; @@ -189,11 +189,11 @@ Affected Rows: 2048 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 4096 | 4096 | 10000 | 40960000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 4096 | 4096 | 10000 | 40960000 | ++----------+-------------------+-------------------------+-------------------------+ INSERT INTO bigtable SELECT a, to_unixtime(ts) * 71 FROM bigtable; @@ -201,11 +201,11 @@ Affected Rows: 4096 SELECT COUNT(*), COUNT(a), MAX(LENGTH(a)), SUM(LENGTH(a)) FROM bigtable; -+----------+-------------------+-----------------------------------+-----------------------------------+ -| count(*) | count(bigtable.a) | max(character_length(bigtable.a)) | sum(character_length(bigtable.a)) | -+----------+-------------------+-----------------------------------+-----------------------------------+ -| 8192 | 8192 | 10000 | 81920000 | -+----------+-------------------+-----------------------------------+-----------------------------------+ ++----------+-------------------+-------------------------+-------------------------+ +| count(*) | count(bigtable.a) | max(length(bigtable.a)) | sum(length(bigtable.a)) | ++----------+-------------------+-------------------------+-------------------------+ +| 8192 | 8192 | 10000 | 81920000 | ++----------+-------------------+-------------------------+-------------------------+ DROP TABLE test; diff --git a/tests/cases/standalone/common/types/string/unicode.result b/tests/cases/standalone/common/types/string/unicode.result index 5580093c2260..c9cd0283c029 100644 --- a/tests/cases/standalone/common/types/string/unicode.result +++ b/tests/cases/standalone/common/types/string/unicode.result @@ -58,12 +58,12 @@ SELECT substr('🦤🦆f', 1, 2); -- length on emojis SELECT length(s) FROM emojis ORDER BY id; -+----------------------------+ -| character_length(emojis.s) | -+----------------------------+ -| 1 | -| 3 | -+----------------------------+ ++------------------+ +| length(emojis.s) | ++------------------+ +| 1 | +| 3 | ++------------------+ DROP TABLE emojis; From 4ac47597dda572b1239e5601434078ffc0b392fa Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Tue, 14 Oct 2025 03:12:40 +0800 Subject: [PATCH 3/8] fix: update datafusion_pg_catalog import --- Cargo.lock | 119 +++---------------- Cargo.toml | 2 +- src/catalog/Cargo.toml | 2 +- src/catalog/src/system_schema/pg_catalog.rs | 6 +- src/common/function/Cargo.toml | 2 +- src/common/function/src/system/pg_catalog.rs | 2 +- src/servers/Cargo.toml | 2 +- src/servers/src/postgres/handler.rs | 2 +- 8 files changed, 28 insertions(+), 109 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5dee778d487a..f95bc2f516c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -473,20 +473,6 @@ dependencies = [ "arrow-select", ] -[[package]] -name = "arrow-pg" -version = "0.6.1" -source = "git+https://github.com/datafusion-contrib/datafusion-postgres?rev=7c1db5efdbf25924246f49b061acbbdf2d4af649#7c1db5efdbf25924246f49b061acbbdf2d4af649" -dependencies = [ - "bytes", - "chrono", - "datafusion", - "futures", - "pgwire 0.32.1", - "postgres-types", - "rust_decimal", -] - [[package]] name = "arrow-row" version = "56.2.0" @@ -1459,7 +1445,7 @@ dependencies = [ "common-workload", "dashmap", "datafusion", - "datafusion-postgres", + "datafusion-pg-catalog", "datatypes", "futures", "futures-util", @@ -2191,8 +2177,8 @@ dependencies = [ "datafusion-common", "datafusion-expr", "datafusion-functions-aggregate-common", + "datafusion-pg-catalog", "datafusion-physical-expr", - "datafusion-postgres", "datatypes", "derive_more", "futures", @@ -3721,6 +3707,20 @@ dependencies = [ "tokio", ] +[[package]] +name = "datafusion-pg-catalog" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f258caedd1593e7dca3bf53912249de6685fa224bcce897ede1fbb7b040ac6f6" +dependencies = [ + "async-trait", + "datafusion", + "futures", + "log", + "postgres-types", + "tokio", +] + [[package]] name = "datafusion-physical-expr" version = "50.1.0" @@ -3817,28 +3817,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "datafusion-postgres" -version = "0.10.2" -source = "git+https://github.com/datafusion-contrib/datafusion-postgres?rev=7c1db5efdbf25924246f49b061acbbdf2d4af649#7c1db5efdbf25924246f49b061acbbdf2d4af649" -dependencies = [ - "arrow-pg", - "async-trait", - "bytes", - "chrono", - "datafusion", - "futures", - "getset", - "log", - "pgwire 0.32.1", - "postgres-types", - "rust_decimal", - "rustls-pemfile", - "rustls-pki-types", - "tokio", - "tokio-rustls", -] - [[package]] name = "datafusion-pruning" version = "50.1.0" @@ -5310,18 +5288,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "getset" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf0fc11e47561d47397154977bc219f4cf809b2974facc3ccb3b89e2436f912" -dependencies = [ - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.106", -] - [[package]] name = "gimli" version = "0.31.1" @@ -6175,7 +6141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", - "hashbrown 0.15.4", + "hashbrown 0.16.0", ] [[package]] @@ -9185,34 +9151,6 @@ dependencies = [ "serde", ] -[[package]] -name = "pgwire" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf403a6ee31cf7f2217b2bd8447cb13dbb6c268d7e81501bc78a4d3daafd294" -dependencies = [ - "async-trait", - "base64 0.22.1", - "bytes", - "chrono", - "derive-new", - "futures", - "hex", - "lazy-regex", - "md5 0.8.0", - "postgres-types", - "rand 0.9.1", - "ring", - "rust_decimal", - "rustls-pki-types", - "stringprep", - "thiserror 2.0.17", - "tokio", - "tokio-rustls", - "tokio-util", - "x509-certificate 0.24.0", -] - [[package]] name = "pgwire" version = "0.33.0" @@ -11579,7 +11517,7 @@ dependencies = [ "datafusion", "datafusion-common", "datafusion-expr", - "datafusion-postgres", + "datafusion-pg-catalog", "datatypes", "derive_builder 0.20.2", "futures", @@ -11611,7 +11549,7 @@ dependencies = [ "otel-arrow-rust", "parking_lot 0.12.4", "permutation", - "pgwire 0.33.0", + "pgwire", "pin-project", "pipeline", "postgres-types", @@ -14969,25 +14907,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "x509-certificate" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57b9f8bcae7c1f36479821ae826d75050c60ce55146fd86d3553ed2573e2762" -dependencies = [ - "bcder", - "bytes", - "chrono", - "der", - "hex", - "pem", - "ring", - "signature", - "spki", - "thiserror 1.0.69", - "zeroize", -] - [[package]] name = "x509-certificate" version = "0.25.0" diff --git a/Cargo.toml b/Cargo.toml index 3422a0ed8f46..774f4d185f73 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,7 +132,7 @@ datafusion-optimizer = "50" datafusion-orc = { git = "https://github.com/GreptimeTeam/datafusion-orc", rev = "2971b041ce1c94e315ac5b327589da6d61f449c0" } datafusion-physical-expr = "50" datafusion-physical-plan = "50" -datafusion-postgres = { git = "https://github.com/datafusion-contrib/datafusion-postgres", rev = "7c1db5efdbf25924246f49b061acbbdf2d4af649" } +datafusion-pg-catalog = "0.11" datafusion-sql = "50" datafusion-substrait = "50" deadpool = "0.12" diff --git a/src/catalog/Cargo.toml b/src/catalog/Cargo.toml index 515fafad8682..62674e25725b 100644 --- a/src/catalog/Cargo.toml +++ b/src/catalog/Cargo.toml @@ -35,7 +35,7 @@ common-version.workspace = true common-workload.workspace = true dashmap.workspace = true datafusion.workspace = true -datafusion-postgres.workspace = true +datafusion-pg-catalog.workspace = true datatypes.workspace = true futures.workspace = true futures-util.workspace = true diff --git a/src/catalog/src/system_schema/pg_catalog.rs b/src/catalog/src/system_schema/pg_catalog.rs index 231fa9a8b80c..08aad2d6dd3e 100644 --- a/src/catalog/src/system_schema/pg_catalog.rs +++ b/src/catalog/src/system_schema/pg_catalog.rs @@ -26,9 +26,9 @@ use datafusion::datasource::TableType; use datafusion::error::DataFusionError; use datafusion::execution::TaskContext; use datafusion::physical_plan::stream::RecordBatchStreamAdapter as DfRecordBatchStreamAdapter; -use datafusion_postgres::pg_catalog::catalog_info::CatalogInfo; -use datafusion_postgres::pg_catalog::context::EmptyContextProvider; -use datafusion_postgres::pg_catalog::{ +use datafusion_pg_catalog::pg_catalog::catalog_info::CatalogInfo; +use datafusion_pg_catalog::pg_catalog::context::EmptyContextProvider; +use datafusion_pg_catalog::pg_catalog::{ PG_CATALOG_TABLES, PgCatalogSchemaProvider, PgCatalogStaticTables, PgCatalogTable, }; use snafu::ResultExt; diff --git a/src/common/function/Cargo.toml b/src/common/function/Cargo.toml index 3ac122dcee8f..e2917f8254d6 100644 --- a/src/common/function/Cargo.toml +++ b/src/common/function/Cargo.toml @@ -37,7 +37,7 @@ datafusion-common.workspace = true datafusion-expr.workspace = true datafusion-functions-aggregate-common.workspace = true datafusion-physical-expr.workspace = true -datafusion-postgres.workspace = true +datafusion-pg-catalog.workspace = true datatypes.workspace = true derive_more = { version = "1", default-features = false, features = ["display"] } geo = { version = "0.29", optional = true } diff --git a/src/common/function/src/system/pg_catalog.rs b/src/common/function/src/system/pg_catalog.rs index 3f034598965d..c768aae2483d 100644 --- a/src/common/function/src/system/pg_catalog.rs +++ b/src/common/function/src/system/pg_catalog.rs @@ -21,7 +21,7 @@ use datafusion::catalog::TableFunction; use datafusion::common::ScalarValue; use datafusion::common::utils::SingleRowListArrayBuilder; use datafusion_expr::{ColumnarValue, ScalarFunctionArgs, Signature, Volatility}; -use datafusion_postgres::pg_catalog::{self, PgCatalogStaticTables}; +use datafusion_pg_catalog::pg_catalog::{self, PgCatalogStaticTables}; use datatypes::arrow::datatypes::{DataType, Field}; use version::PGVersionFunction; diff --git a/src/servers/Cargo.toml b/src/servers/Cargo.toml index ee06d987319b..26dc8fe5f640 100644 --- a/src/servers/Cargo.toml +++ b/src/servers/Cargo.toml @@ -57,7 +57,7 @@ dashmap.workspace = true datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true -datafusion-postgres.workspace = true +datafusion-pg-catalog.workspace = true datatypes.workspace = true derive_builder.workspace = true futures.workspace = true diff --git a/src/servers/src/postgres/handler.rs b/src/servers/src/postgres/handler.rs index efe5dfd8c23a..f3c1fdeca962 100644 --- a/src/servers/src/postgres/handler.rs +++ b/src/servers/src/postgres/handler.rs @@ -21,7 +21,7 @@ use common_recordbatch::RecordBatch; use common_recordbatch::error::Result as RecordBatchResult; use common_telemetry::{debug, tracing}; use datafusion_common::ParamValues; -use datafusion_postgres::sql::PostgresCompatibilityParser; +use datafusion_pg_catalog::sql::PostgresCompatibilityParser; use datatypes::prelude::ConcreteDataType; use datatypes::schema::SchemaRef; use futures::{Sink, SinkExt, Stream, StreamExt, future, stream}; From 0695bf29487b025ca4b2f755d307e7615d90f7d9 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Tue, 14 Oct 2025 03:17:20 +0800 Subject: [PATCH 4/8] chore: fix toml format --- Cargo.toml | 2 +- src/common/function/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 774f4d185f73..6cb189ad0484 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -130,9 +130,9 @@ datafusion-functions = "50" datafusion-functions-aggregate-common = "50" datafusion-optimizer = "50" datafusion-orc = { git = "https://github.com/GreptimeTeam/datafusion-orc", rev = "2971b041ce1c94e315ac5b327589da6d61f449c0" } +datafusion-pg-catalog = "0.11" datafusion-physical-expr = "50" datafusion-physical-plan = "50" -datafusion-pg-catalog = "0.11" datafusion-sql = "50" datafusion-substrait = "50" deadpool = "0.12" diff --git a/src/common/function/Cargo.toml b/src/common/function/Cargo.toml index e2917f8254d6..d5b928e2a16f 100644 --- a/src/common/function/Cargo.toml +++ b/src/common/function/Cargo.toml @@ -36,8 +36,8 @@ datafusion.workspace = true datafusion-common.workspace = true datafusion-expr.workspace = true datafusion-functions-aggregate-common.workspace = true -datafusion-physical-expr.workspace = true datafusion-pg-catalog.workspace = true +datafusion-physical-expr.workspace = true datatypes.workspace = true derive_more = { version = "1", default-features = false, features = ["display"] } geo = { version = "0.29", optional = true } From eceeed4ff3b0084e8243c8eefb1cb21a9c467d87 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Tue, 14 Oct 2025 03:24:42 +0800 Subject: [PATCH 5/8] chore: fix toml format again --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6cb189ad0484..8f3f426106cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -330,7 +330,7 @@ datafusion-physical-plan = { git = "https://github.com/GreptimeTeam/datafusion.g datafusion-datasource = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } datafusion-sql = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } datafusion-substrait = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "fd4b2abcf3c3e43e94951bda452c9fd35243aab0" } -sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "4b519a5caa95472cc3988f5556813a583dd35af1" } # branch = "v0.58.x" +sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "4b519a5caa95472cc3988f5556813a583dd35af1" } # branch = "v0.58.x" [profile.release] debug = 1 From 5b5f280c403b68f1207c22cf2bfee2cfe742767c Mon Sep 17 00:00:00 2001 From: luofucong Date: Tue, 14 Oct 2025 17:44:44 +0800 Subject: [PATCH 6/8] fix nextest Signed-off-by: luofucong --- src/query/src/optimizer/windowed_sort.rs | 1 - src/query/src/part_sort.rs | 35 ++++++++++-------------- src/servers/src/http/handler.rs | 2 +- src/sql/src/parsers/create_parser.rs | 3 +- tests-integration/tests/http.rs | 8 +++--- tests-integration/tests/sql.rs | 4 +-- 6 files changed, 23 insertions(+), 30 deletions(-) diff --git a/src/query/src/optimizer/windowed_sort.rs b/src/query/src/optimizer/windowed_sort.rs index b2077d7c5d40..dcf63f6d73fd 100644 --- a/src/query/src/optimizer/windowed_sort.rs +++ b/src/query/src/optimizer/windowed_sort.rs @@ -115,7 +115,6 @@ impl WindowedSortPhysicalRule { sort_exec.fetch(), scanner_info.partition_ranges.clone(), sort_input, - sort_exec.create_filter(), )) }; diff --git a/src/query/src/part_sort.rs b/src/query/src/part_sort.rs index 3787d06cfc4b..64ba76a14983 100644 --- a/src/query/src/part_sort.rs +++ b/src/query/src/part_sort.rs @@ -37,6 +37,7 @@ use datafusion::physical_plan::{ }; use datafusion_common::{DataFusionError, internal_err}; use datafusion_physical_expr::PhysicalSortExpr; +use datafusion_physical_expr::expressions::{DynamicFilterPhysicalExpr, lit}; use futures::{Stream, StreamExt}; use itertools::Itertools; use parking_lot::RwLock; @@ -60,7 +61,6 @@ pub struct PartSortExec { metrics: ExecutionPlanMetricsSet, partition_ranges: Vec>, properties: PlanProperties, - filter: Arc>, } impl PartSortExec { @@ -69,7 +69,6 @@ impl PartSortExec { limit: Option, partition_ranges: Vec>, input: Arc, - filter: Arc>, ) -> Self { let metrics = ExecutionPlanMetricsSet::new(); let properties = input.properties(); @@ -87,7 +86,6 @@ impl PartSortExec { metrics, partition_ranges, properties, - filter, } } @@ -115,7 +113,6 @@ impl PartSortExec { input_stream, self.partition_ranges[partition].clone(), partition, - self.filter.clone(), )?) as _; Ok(df_stream) @@ -172,7 +169,6 @@ impl ExecutionPlan for PartSortExec { self.limit, self.partition_ranges.clone(), new_input.clone(), - self.filter.clone(), ))) } @@ -234,7 +230,6 @@ struct PartSortStream { metrics: BaselineMetrics, context: Arc, root_metrics: ExecutionPlanMetricsSet, - filter: Arc>, } impl PartSortStream { @@ -245,9 +240,11 @@ impl PartSortStream { input: DfSendableRecordBatchStream, partition_ranges: Vec, partition: usize, - filter: Arc>, ) -> datafusion_common::Result { let buffer = if let Some(limit) = limit { + let filter = Arc::new(RwLock::new(TopKDynamicFilters::new(Arc::new( + DynamicFilterPhysicalExpr::new(vec![], lit(true)), + )))); PartSortBuffer::Top( TopK::try_new( partition, @@ -258,7 +255,7 @@ impl PartSortStream { context.session_config().batch_size(), context.runtime_env(), &sort.metrics, - filter.clone(), + filter, )?, 0, ) @@ -283,7 +280,6 @@ impl PartSortStream { metrics: BaselineMetrics::new(&sort.metrics, partition), context, root_metrics: sort.metrics.clone(), - filter, }) } } @@ -507,6 +503,9 @@ impl PartSortStream { /// Internal method for sorting `Top` buffer (with limit). fn sort_top_buffer(&mut self) -> datafusion_common::Result { + let filter = Arc::new(RwLock::new(TopKDynamicFilters::new(Arc::new( + DynamicFilterPhysicalExpr::new(vec![], lit(true)), + )))); let new_top_buffer = TopK::try_new( self.partition, self.schema().clone(), @@ -516,7 +515,7 @@ impl PartSortStream { self.context.session_config().batch_size(), self.context.runtime_env(), &self.root_metrics, - self.filter.clone(), + filter, )?; let PartSortBuffer::Top(top_k, _) = std::mem::replace(&mut self.buffer, PartSortBuffer::Top(new_top_buffer, 0)) @@ -685,7 +684,6 @@ mod test { use arrow::json::ArrayWriter; use arrow_schema::{DataType, Field, Schema, SortOptions, TimeUnit}; use common_time::Timestamp; - use datafusion::physical_plan::sorts::sort::SortExec; use datafusion_physical_expr::expressions::Column; use futures::StreamExt; use store_api::region_engine::PartitionRange; @@ -1044,19 +1042,16 @@ mod test { cols }) .collect_vec(); - let mock_input = Arc::new(MockInputExec::new(batches, schema.clone())); + let mock_input = MockInputExec::new(batches, schema.clone()); - let expr = PhysicalSortExpr { - expr: Arc::new(Column::new("ts", 0)), - options: opt, - }; - let sort_exec = SortExec::new([expr.clone()].into(), mock_input.clone()); let exec = PartSortExec::new( - expr, + PhysicalSortExpr { + expr: Arc::new(Column::new("ts", 0)), + options: opt, + }, limit, vec![ranges.clone()], - mock_input, - sort_exec.create_filter(), + Arc::new(mock_input), ); let exec_stream = exec.execute(0, Arc::new(TaskContext::default())).unwrap(); diff --git a/src/servers/src/http/handler.rs b/src/servers/src/http/handler.rs index 69ba93cc5cde..ca56e5234e34 100644 --- a/src/servers/src/http/handler.rs +++ b/src/servers/src/http/handler.rs @@ -208,7 +208,7 @@ pub async fn sql_format( let mut parts: Vec = Vec::with_capacity(stmts.len()); for stmt in stmts { - let mut s = format!("{:#}", stmt); + let mut s = format!("{stmt}"); if !s.trim_end().ends_with(';') { s.push(';'); } diff --git a/src/sql/src/parsers/create_parser.rs b/src/sql/src/parsers/create_parser.rs index 8b914ea03032..d23f45bc014f 100644 --- a/src/sql/src/parsers/create_parser.rs +++ b/src/sql/src/parsers/create_parser.rs @@ -2427,8 +2427,7 @@ non TIMESTAMP(6) TIME INDEX, let sql = "CREATE VIEW test AS DELETE from demo"; let result = ParserContext::create_with_dialect(sql, &GreptimeDbDialect {}, ParseOptions::default()); - assert!(result.is_err()); - assert_matches!(result, Err(crate::error::Error::Syntax { .. })); + assert!(result.is_ok_and(|x| x.len() == 1)); } #[test] diff --git a/tests-integration/tests/http.rs b/tests-integration/tests/http.rs index 538392e4371a..6d333780c145 100644 --- a/tests-integration/tests/http.rs +++ b/tests-integration/tests/http.rs @@ -662,7 +662,7 @@ pub async fn test_http_sql_slow_query(store_type: StorageType) { let (app, mut guard) = setup_test_http_app_with_frontend(store_type, "sql_api").await; let client = TestClient::new(app).await; - let slow_query = "WITH RECURSIVE slow_cte AS (SELECT 1 AS n, md5(CAST(random() AS STRING)) AS hash UNION ALL SELECT n + 1, md5(concat(hash, n)) FROM slow_cte WHERE n < 4500) SELECT COUNT(*) FROM slow_cte"; + let slow_query = "SELECT count(*) FROM generate_series(1, 1000000000)"; let encoded_slow_query = encode(slow_query); let query_params = format!("/v1/sql?sql={encoded_slow_query}"); @@ -1152,12 +1152,12 @@ pub async fn test_prom_http_api(store_type: StorageType) { // query `__name__` without match[] // create a physical table and a logical table let res = client - .get("/v1/sql?sql=create table physical_table (`ts` timestamp time index, message string) with ('physical_metric_table' = 'true');") + .get("/v1/sql?sql=create table physical_table (`ts` timestamp time index, `message` string) with ('physical_metric_table' = 'true');") .send() .await; assert_eq!(res.status(), StatusCode::OK, "{:?}", res.text().await); let res = client - .get("/v1/sql?sql=create table logic_table (`ts` timestamp time index, message string) with ('on_physical_table' = 'physical_table');") + .get("/v1/sql?sql=create table logic_table (`ts` timestamp time index, `message` string) with ('on_physical_table' = 'physical_table');") .send() .await; assert_eq!(res.status(), StatusCode::OK, "{:?}", res.text().await); @@ -5295,7 +5295,7 @@ pub async fn test_log_query(store_type: StorageType) { // prepare data with SQL API let res = client - .get("/v1/sql?sql=create table logs (`ts` timestamp time index, message string);") + .get("/v1/sql?sql=create table logs (`ts` timestamp time index, `message` string);") .send() .await; assert_eq!(res.status(), StatusCode::OK, "{:?}", res.text().await); diff --git a/tests-integration/tests/sql.rs b/tests-integration/tests/sql.rs index bacafc5380c2..33c415a6be31 100644 --- a/tests-integration/tests/sql.rs +++ b/tests-integration/tests/sql.rs @@ -643,7 +643,7 @@ pub async fn test_mysql_slow_query(store_type: StorageType) { .unwrap(); // The slow query will run at least longer than 1s. - let slow_query = "WITH RECURSIVE slow_cte AS (SELECT 1 AS n, md5(CAST(random() AS STRING)) AS hash UNION ALL SELECT n + 1, md5(concat(hash, n)) FROM slow_cte WHERE n < 4500) SELECT COUNT(*) FROM slow_cte"; + let slow_query = "SELECT count(*) FROM generate_series(1, 1000000000)"; // Simulate a slow query. sqlx::query(slow_query).fetch_all(&pool).await.unwrap(); @@ -758,7 +758,7 @@ pub async fn test_postgres_slow_query(store_type: StorageType) { .await .unwrap(); - let slow_query = "WITH RECURSIVE slow_cte AS (SELECT 1 AS n, md5(CAST(random() AS STRING)) AS hash UNION ALL SELECT n + 1, md5(concat(hash, n)) FROM slow_cte WHERE n < 4500) SELECT COUNT(*) FROM slow_cte"; + let slow_query = "SELECT count(*) FROM generate_series(1, 1000000000)"; let _ = sqlx::query(slow_query).fetch_all(&pool).await.unwrap(); // Wait for the slow query to be recorded. From 6a9f08bcbaefc44dd82c532d957e26502b15c86f Mon Sep 17 00:00:00 2001 From: luofucong Date: Wed, 15 Oct 2025 14:20:08 +0800 Subject: [PATCH 7/8] fix sqlness Signed-off-by: luofucong --- .../function/src/scalars/geo/geohash.rs | 4 +-- src/common/function/src/scalars/geo/h3.rs | 4 +-- src/query/src/dist_plan/commutativity.rs | 25 +++++++++++++++++++ .../standalone/common/aggregate/corr.result | 3 +-- .../standalone/common/aggregate/corr.sql | 1 - .../common/error/incorrect_sql.result | 2 +- .../standalone/common/order/limit.result | 2 +- .../common/system/pg_catalog.result | 8 +++--- .../common/tql-explain-analyze/explain.result | 4 +-- .../standalone/common/tql/tql-cte.result | 8 +++--- .../standalone/common/view/create.result | 2 +- 11 files changed, 43 insertions(+), 20 deletions(-) diff --git a/src/common/function/src/scalars/geo/geohash.rs b/src/common/function/src/scalars/geo/geohash.rs index 2a9deddca609..90bb958246ce 100644 --- a/src/common/function/src/scalars/geo/geohash.rs +++ b/src/common/function/src/scalars/geo/geohash.rs @@ -76,7 +76,7 @@ impl Function for GeohashFunction { } fn return_type(&self, _: &[DataType]) -> datafusion_common::Result { - Ok(DataType::Utf8) + Ok(DataType::Utf8View) } fn signature(&self) -> &Signature { @@ -176,7 +176,7 @@ impl Function for GeohashNeighboursFunction { Ok(DataType::List(Arc::new(Field::new( "item", DataType::Utf8View, - false, + true, )))) } diff --git a/src/common/function/src/scalars/geo/h3.rs b/src/common/function/src/scalars/geo/h3.rs index d90eed81434a..c6630525df28 100644 --- a/src/common/function/src/scalars/geo/h3.rs +++ b/src/common/function/src/scalars/geo/h3.rs @@ -355,9 +355,9 @@ impl Function for H3CellCenterLatLng { fn return_type(&self, _: &[DataType]) -> datafusion_common::Result { Ok(DataType::List(Arc::new(Field::new( - "x", + "item", DataType::Float64, - false, + true, )))) } diff --git a/src/query/src/dist_plan/commutativity.rs b/src/query/src/dist_plan/commutativity.rs index d0e26a3f92d4..ba6a74203bb2 100644 --- a/src/query/src/dist_plan/commutativity.rs +++ b/src/query/src/dist_plan/commutativity.rs @@ -18,6 +18,7 @@ use std::sync::Arc; use common_function::aggrs::aggr_wrapper::{StateMergeHelper, is_all_aggr_exprs_steppable}; use common_telemetry::debug; use datafusion::error::Result as DfResult; +use datafusion_common::tree_node::{TreeNode, TreeNodeRecursion}; use datafusion_expr::{Expr, LogicalPlan, UserDefinedLogicalNode}; use promql::extension_plan::{ EmptyMetric, InstantManipulate, RangeManipulate, SeriesDivide, SeriesNormalize, @@ -93,6 +94,12 @@ impl Categorizer { plan: &LogicalPlan, partition_cols: Option, ) -> DfResult { + // Subquery is treated separately in `inspect_plan_with_subquery`. To avoid rewrite the + // "maybe rewritten" plan, stop the check here. + if has_subquery(plan)? { + return Ok(Commutativity::NonCommutative); + } + let partition_cols = partition_cols.unwrap_or_default(); let comm = match plan { @@ -331,6 +338,24 @@ pub fn partial_commutative_transformer(plan: &LogicalPlan) -> Option DfResult { + let mut found = false; + plan.apply_expressions(|e| { + e.apply(|x| { + if matches!( + x, + Expr::Exists(_) | Expr::InSubquery(_) | Expr::ScalarSubquery(_) + ) { + found = true; + Ok(TreeNodeRecursion::Stop) + } else { + Ok(TreeNodeRecursion::Continue) + } + }) + })?; + Ok(found) +} + #[cfg(test)] mod test { use datafusion_expr::{LogicalPlanBuilder, Sort}; diff --git a/tests/cases/standalone/common/aggregate/corr.result b/tests/cases/standalone/common/aggregate/corr.result index 7099c7a85ed0..919639bc7b5c 100644 --- a/tests/cases/standalone/common/aggregate/corr.result +++ b/tests/cases/standalone/common/aggregate/corr.result @@ -10,13 +10,12 @@ SELECT corr(NULL,NULL); +-----------------+ -- Single value returns NULL --- FIXME(dennis): datafusion returns 0.0 here, should be NULL SELECT corr(1,1); +-------------------------+ | corr(Int64(1),Int64(1)) | +-------------------------+ -| 0.0 | +| | +-------------------------+ -- Test with table diff --git a/tests/cases/standalone/common/aggregate/corr.sql b/tests/cases/standalone/common/aggregate/corr.sql index d22715337a78..8c859fdddbec 100644 --- a/tests/cases/standalone/common/aggregate/corr.sql +++ b/tests/cases/standalone/common/aggregate/corr.sql @@ -5,7 +5,6 @@ SELECT corr(NULL,NULL); -- Single value returns NULL --- FIXME(dennis): datafusion returns 0.0 here, should be NULL SELECT corr(1,1); -- Test with table diff --git a/tests/cases/standalone/common/error/incorrect_sql.result b/tests/cases/standalone/common/error/incorrect_sql.result index 5069376ed694..d8511ad6df55 100644 --- a/tests/cases/standalone/common/error/incorrect_sql.result +++ b/tests/cases/standalone/common/error/incorrect_sql.result @@ -25,7 +25,7 @@ Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Execution err -- No matching function signature SELECT cos(0, 1, 2, 3); -Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Failed to coerce arguments to satisfy a call to 'cos' function: coercion from [Int64, Int64, Int64, Int64] to the signature Uniform(1, [Float64, Float32]) failed No function matches the given name and argument types 'cos(Int64, Int64, Int64, Int64)'. You might need to add explicit type casts. +Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Failed to coerce arguments to satisfy a call to 'cos' function: coercion from Int64, Int64, Int64, Int64 to the signature Uniform(1, [Float64, Float32]) failed No function matches the given name and argument types 'cos(Int64, Int64, Int64, Int64)'. You might need to add explicit type casts. Candidate functions: cos(Float64/Float32) diff --git a/tests/cases/standalone/common/order/limit.result b/tests/cases/standalone/common/order/limit.result index 059cc9706aed..e830a3ea4b78 100644 --- a/tests/cases/standalone/common/order/limit.result +++ b/tests/cases/standalone/common/order/limit.result @@ -49,7 +49,7 @@ Error: 1001(Unsupported), This feature is not implemented: Unsupported LIMIT exp SELECT a FROM test LIMIT row_number() OVER (); -Error: 3001(EngineExecuteQuery), This feature is not implemented: Unsupported LIMIT expression: Some(Cast(Cast { expr: WindowFunction(WindowFunction { fun: WindowUDF(WindowUDF { inner: RowNumber { signature: Signature { type_signature: Nullary, volatility: Immutable } } }), params: WindowFunctionParams { args: [], partition_by: [], order_by: [], window_frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(NULL)), is_causal: false }, null_treatment: None, distinct: false } }), data_type: Int64 })) +Error: 3001(EngineExecuteQuery), This feature is not implemented: Unsupported LIMIT expression: Some(Cast(Cast { expr: WindowFunction(WindowFunction { fun: WindowUDF(WindowUDF { inner: RowNumber { signature: Signature { type_signature: Nullary, volatility: Immutable } } }), params: WindowFunctionParams { args: [], partition_by: [], order_by: [], window_frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(NULL)), is_causal: false }, filter: None, null_treatment: None, distinct: false } }), data_type: Int64 })) CREATE TABLE test2 (a STRING, ts TIMESTAMP TIME INDEX); diff --git a/tests/cases/standalone/common/system/pg_catalog.result b/tests/cases/standalone/common/system/pg_catalog.result index d6530a78d294..0aa7f1cc7e06 100644 --- a/tests/cases/standalone/common/system/pg_catalog.result +++ b/tests/cases/standalone/common/system/pg_catalog.result @@ -712,10 +712,10 @@ select * from pg_catalog.pg_type order by oid; -- SQLNESS REPLACE (\d+\s*) OID select * from pg_catalog.pg_database where datname = 'public'; -+-----+---------+--------+----------+------------+----------+---------------+--------------+--------------+---------------+--------------+------------+---------------+--------+ -| oid | datname | datdba | encoding | datcollate | datctype | datistemplate | datallowconn | datconnlimit | datlastsysoid | datfrozenxid | datminmxid | dattablespace | datacl | -+-----+---------+--------+----------+------------+----------+---------------+--------------+--------------+---------------+--------------+------------+---------------+--------+ -+-----+---------+--------+----------+------------+----------+---------------+--------------+--------------+---------------+--------------+------------+---------------+--------+ ++-----+---------+--------+----------+----------------+------------+----------+---------------+--------------+--------------+---------------+--------------+------------+---------------+--------------+-------------+--------+ +| oid | datname | datdba | encoding | datlocprovider | datcollate | datctype | datistemplate | datallowconn | datconnlimit | datlastsysoid | datfrozenxid | datminmxid | dattablespace | daticulocale | daticurules | datacl | ++-----+---------+--------+----------+----------------+------------+----------+---------------+--------------+--------------+---------------+--------------+------------+---------------+--------------+-------------+--------+ ++-----+---------+--------+----------+----------------+------------+----------+---------------+--------------+--------------+---------------+--------------+------------+---------------+--------------+-------------+--------+ -- \d -- SQLNESS PROTOCOL POSTGRES diff --git a/tests/cases/standalone/common/tql-explain-analyze/explain.result b/tests/cases/standalone/common/tql-explain-analyze/explain.result index 9b54dc92d4a6..846086bf67c6 100644 --- a/tests/cases/standalone/common/tql-explain-analyze/explain.result +++ b/tests/cases/standalone/common/tql-explain-analyze/explain.result @@ -184,7 +184,7 @@ TQL EXPLAIN VERBOSE (0, 10, '5s') test; | physical_plan after OutputRequirements_| MergeScanExec: REDACTED |_|_| | physical_plan after LimitAggregation_| SAME TEXT AS ABOVE_| -| physical_plan after LimitPushPastWindows_| SAME TEXT AS ABOVE_|, +| physical_plan after LimitPushPastWindows_| SAME TEXT AS ABOVE_| | physical_plan after LimitPushdown_| SAME TEXT AS ABOVE_| | physical_plan after ProjectionPushdown_| SAME TEXT AS ABOVE_| | physical_plan after EnsureCooperative_| CooperativeExec_| @@ -322,7 +322,7 @@ TQL EXPLAIN VERBOSE (0, 10, '5s') test AS series; | physical_plan after OutputRequirements_| MergeScanExec: REDACTED |_|_| | physical_plan after LimitAggregation_| SAME TEXT AS ABOVE_| -| physical_plan after LimitPushPastWindows_| SAME TEXT AS ABOVE_|, +| physical_plan after LimitPushPastWindows_| SAME TEXT AS ABOVE_| | physical_plan after LimitPushdown_| SAME TEXT AS ABOVE_| | physical_plan after ProjectionPushdown_| SAME TEXT AS ABOVE_| | physical_plan after EnsureCooperative_| CooperativeExec_| diff --git a/tests/cases/standalone/common/tql/tql-cte.result b/tests/cases/standalone/common/tql/tql-cte.result index 76e4b511dbd8..7127f79d9f89 100644 --- a/tests/cases/standalone/common/tql/tql-cte.result +++ b/tests/cases/standalone/common/tql/tql-cte.result @@ -775,8 +775,8 @@ LIMIT 5; | | SubqueryAlias: l | | | TableScan: labels | | | ]] | -| physical_plan | SortPreservingMergeExec: [ts@0 ASC NULLS LAST, host@2 ASC NULLS LAST, avg_value@1 ASC NULLS LAST], fetch=5 | -| | SortExec: TopK(fetch=5), expr=[ts@0 ASC NULLS LAST, host@2 ASC NULLS LAST, avg_value@1 ASC NULLS LAST], preserve_REDACTED +| physical_plan | SortPreservingMergeExec: [ts@0 ASC NULLS LAST, avg_value@1 ASC NULLS LAST], fetch=5 | +| | SortExec: TopK(fetch=5), expr=[ts@0 ASC NULLS LAST, avg_value@1 ASC NULLS LAST], preserve_REDACTED | | ProjectionExec: expr=[ts@0 as ts, cpu@1 as avg_value, host@2 as host] | | | CoalesceBatchesExec: target_batch_size=8192 | | | HashJoinExec: mode=Partitioned, join_type=Inner, on=[(date_trunc(Utf8("second"),t.ts)@2, date_trunc(Utf8("second"),l.ts)@2)], projection=[ts@0, cpu@1, host@4] | @@ -861,8 +861,8 @@ LIMIT 5; | | SubqueryAlias: l | | | TableScan: labels | | | ]] | -| physical_plan | SortPreservingMergeExec: [ts@0 ASC NULLS LAST, host@2 ASC NULLS LAST, avg_value@1 ASC NULLS LAST], fetch=5 | -| | SortExec: TopK(fetch=5), expr=[ts@0 ASC NULLS LAST, host@2 ASC NULLS LAST, avg_value@1 ASC NULLS LAST], preserve_REDACTED +| physical_plan | SortPreservingMergeExec: [ts@0 ASC NULLS LAST, avg_value@1 ASC NULLS LAST], fetch=5 | +| | SortExec: TopK(fetch=5), expr=[ts@0 ASC NULLS LAST, avg_value@1 ASC NULLS LAST], preserve_REDACTED | | ProjectionExec: expr=[ts@1 as ts, cpu@0 as avg_value, host@2 as host] | | | CoalesceBatchesExec: target_batch_size=8192 | | | HashJoinExec: mode=Partitioned, join_type=Inner, on=[(date_trunc(Utf8("second"),t.ts)@2, date_trunc(Utf8("second"),l.ts)@2)], projection=[cpu@0, ts@1, host@4] | diff --git a/tests/cases/standalone/common/view/create.result b/tests/cases/standalone/common/view/create.result index 743108541153..2f6096702ab9 100644 --- a/tests/cases/standalone/common/view/create.result +++ b/tests/cases/standalone/common/view/create.result @@ -9,7 +9,7 @@ Error: 2000(InvalidSyntax), Invalid SQL syntax: sql parser error: Expected: AS, CREATE VIEW test_view as DELETE FROM public.numbers; -Error: 2000(InvalidSyntax), Invalid SQL syntax: sql parser error: Expected: SELECT, VALUES, or a subquery in the query body, found: DELETE at Line: 1, Column: 26 +Error: 1001(Unsupported), Failed to plan SQL: This feature is not implemented: Query DELETE FROM public.numbers not implemented yet, --- Table already exists --- CREATE VIEW test_table as SELECT * FROM public.numbers; From a45c065249c9b179a1ee9beda73f047c855bca8b Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Sat, 18 Oct 2025 05:57:03 +0800 Subject: [PATCH 8/8] chore: switch datafusion-orc to upstream tag --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f95bc2f516c5..8bf163bce01a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3693,7 +3693,7 @@ dependencies = [ [[package]] name = "datafusion-orc" version = "0.4.1" -source = "git+https://github.com/GreptimeTeam/datafusion-orc?rev=2971b041ce1c94e315ac5b327589da6d61f449c0#2971b041ce1c94e315ac5b327589da6d61f449c0" +source = "git+https://github.com/datafusion-contrib/datafusion-orc?tag=v0.5.0#ad8b804a783a8f1f6c1135dfb59f9ca97a1de18c" dependencies = [ "arrow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 8f3f426106cd..923b2ebd4d6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -129,7 +129,7 @@ datafusion-expr = "50" datafusion-functions = "50" datafusion-functions-aggregate-common = "50" datafusion-optimizer = "50" -datafusion-orc = { git = "https://github.com/GreptimeTeam/datafusion-orc", rev = "2971b041ce1c94e315ac5b327589da6d61f449c0" } +datafusion-orc = { git = "https://github.com/datafusion-contrib/datafusion-orc", tag = "v0.5.0" } datafusion-pg-catalog = "0.11" datafusion-physical-expr = "50" datafusion-physical-plan = "50"