diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 549c035101..4ad8b08c1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -217,6 +217,10 @@ jobs: working-directory: integration_tests run: | make run-rust + - name: Run MySQL client tests + working-directory: integration_tests + run: | + make run-mysql - name: Upload Logs if: always() uses: actions/upload-artifact@v3 diff --git a/Cargo.lock b/Cargo.lock index 89eb617bf1..b91e86501f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ "gimli", ] @@ -32,44 +32,44 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.8", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e6e951cfbb2db8de1828d49073a113a29fd7117b1596caa781a258c7e38d72" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if 1.0.0", "const-random", - "getrandom 0.2.7", + "getrandom 0.2.8", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] [[package]] name = "alloc-no-stdlib" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ef4730490ad1c4eae5c4325b2a95f521d023e5c885853ff7aca0a6a1631db3" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" [[package]] name = "alloc-stdlib" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697ed7edc0f1711de49ce108c541623a0af97c6c60b2f6e2b65229847ac843c2" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" dependencies = [ "alloc-no-stdlib", ] @@ -78,12 +78,12 @@ dependencies = [ name = "analytic_engine" version = "1.1.0" dependencies = [ - "arc-swap 1.5.1", + "arc-swap 1.6.0", "arena", - "arrow 32.0.0", + "arrow 34.0.0", "async-stream", "async-trait", - "base64 0.13.0", + "base64 0.13.1", "bytes 1.4.0", "ceresdbproto 1.0.1 (git+https://github.com/CeresDB/ceresdbproto.git?rev=1c3bf4e803ef8b7a1fbc8c3d4a07fdd372e1830b)", "common_types", @@ -91,7 +91,7 @@ dependencies = [ "datafusion", "datafusion-expr", "env_logger", - "futures 0.3.25", + "futures 0.3.28", "lazy_static", "log", "lru", @@ -138,18 +138,18 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.59" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c91f1f46651137be86f3a2b9a8359f9ab421d04d941c62b5982e1ca21113adf9" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" dependencies = [ "backtrace", ] [[package]] name = "arbitrary" -version = "1.2.3" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e90af4de65aa7b293ef2d09daff88501eb254f58edde2e1ac02c82d873eadad" +checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" [[package]] name = "arc-swap" @@ -159,9 +159,9 @@ checksum = "dabe5a181f83789739c194cbe5a897dde195078fac08568d09221fd6137a7ba8" [[package]] name = "arc-swap" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "983cd8b9d4b02a6dc6ffa557262eb5858a27a0038ffffe21a0f133eaa819a164" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "arena" @@ -178,9 +178,9 @@ checksum = "bf7d0a018de4f6aa429b9d33d69edf69072b1c5b1cb8d3e4a5f7ef898fc3eb76" [[package]] name = "arrayref" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" @@ -203,13 +203,13 @@ version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fedc767fbaa36ea50f086215f54f1a007d22046fc4754b0448c657bcbe9f8413" dependencies = [ - "ahash 0.8.0", + "ahash 0.8.3", "arrow-buffer 23.0.0", "bitflags", "chrono", "csv", "flatbuffers 2.1.2", - "half 2.1.0", + "half 2.2.1", "hashbrown 0.12.3", "indexmap", "lazy_static", @@ -224,22 +224,22 @@ dependencies = [ [[package]] name = "arrow" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87d948f553cf556656eb89265700258e1032d26fec9b7920cd20319336e06afd" +checksum = "f410d3907b6b3647b9e7bca4551274b2e3d716aa940afb67b7287257401da921" dependencies = [ - "ahash 0.8.0", + "ahash 0.8.3", "arrow-arith", - "arrow-array", - "arrow-buffer 32.0.0", + "arrow-array 34.0.0", + "arrow-buffer 34.0.0", "arrow-cast", "arrow-csv", - "arrow-data", + "arrow-data 34.0.0", "arrow-ipc", "arrow-json", "arrow-ord", "arrow-row", - "arrow-schema", + "arrow-schema 34.0.0", "arrow-select", "arrow-string", "comfy-table", @@ -247,31 +247,48 @@ dependencies = [ [[package]] name = "arrow-arith" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf30d4ebc3df9dfd8bd26883aa30687d4ddcfd7b2443e62bd7c8fedf153b8e45" +checksum = "f87391cf46473c9bc53dab68cb8872c3a81d4dfd1703f1c8aa397dba9880a043" dependencies = [ - "arrow-array", - "arrow-buffer 32.0.0", - "arrow-data", - "arrow-schema", + "arrow-array 34.0.0", + "arrow-buffer 34.0.0", + "arrow-data 34.0.0", + "arrow-schema 34.0.0", "chrono", - "half 2.1.0", + "half 2.2.1", "num", ] [[package]] name = "arrow-array" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fe66ec388d882a61fff3eb613b5266af133aa08a3318e5e493daf0f5c1696cb" +checksum = "d35d5475e65c57cffba06d0022e3006b677515f99b54af33a7cd54f6cdd4a5b5" dependencies = [ - "ahash 0.8.0", - "arrow-buffer 32.0.0", - "arrow-data", - "arrow-schema", + "ahash 0.8.3", + "arrow-buffer 34.0.0", + "arrow-data 34.0.0", + "arrow-schema 34.0.0", "chrono", - "half 2.1.0", + "half 2.2.1", + "hashbrown 0.13.2", + "num", +] + +[[package]] +name = "arrow-array" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43489bbff475545b78b0e20bde1d22abd6c99e54499839f9e815a2fa5134a51b" +dependencies = [ + "ahash 0.8.3", + "arrow-buffer 35.0.0", + "arrow-data 35.0.0", + "arrow-schema 35.0.0", + "chrono", + "chrono-tz", + "half 2.2.1", "hashbrown 0.13.2", "num", ] @@ -282,30 +299,40 @@ version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d290050c6e12a81a24ad08525cef2203c4156a6350f75508d49885d677e88ea9" dependencies = [ - "half 2.1.0", + "half 2.2.1", + "num", +] + +[[package]] +name = "arrow-buffer" +version = "34.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b4ec72eda7c0207727df96cf200f539749d736b21f3e782ece113e18c1a0a7" +dependencies = [ + "half 2.2.1", "num", ] [[package]] name = "arrow-buffer" -version = "32.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef967dadbccd4586ec8d7aab27d7033ecb5dfae8a605c839613039eac227bda" +checksum = "a3759e4a52c593281184787af5435671dc8b1e78333e5a30242b2e2d6e3c9d1f" dependencies = [ - "half 2.1.0", + "half 2.2.1", "num", ] [[package]] name = "arrow-cast" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "491a7979ea9e76dc218f532896e2d245fde5235e2e6420ce80d27cf6395dda84" +checksum = "0a7285272c9897321dfdba59de29f5b05aeafd3cdedf104a941256d155f6d304" dependencies = [ - "arrow-array", - "arrow-buffer 32.0.0", - "arrow-data", - "arrow-schema", + "arrow-array 34.0.0", + "arrow-buffer 34.0.0", + "arrow-data 34.0.0", + "arrow-schema 34.0.0", "arrow-select", "chrono", "lexical-core 0.8.5", @@ -314,15 +341,15 @@ dependencies = [ [[package]] name = "arrow-csv" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b1d4fc91078dbe843c2c50d90f8119c96e8dfac2f78d30f7a8cb9397399c61d" +checksum = "981ee4e7f6a120da04e00d0b39182e1eeacccb59c8da74511de753c56b7fddf7" dependencies = [ - "arrow-array", - "arrow-buffer 32.0.0", + "arrow-array 34.0.0", + "arrow-buffer 34.0.0", "arrow-cast", - "arrow-data", - "arrow-schema", + "arrow-data 34.0.0", + "arrow-schema 34.0.0", "chrono", "csv", "csv-core", @@ -333,13 +360,25 @@ dependencies = [ [[package]] name = "arrow-data" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee0c0e3c5d3b80be8f267f4b2af714c08cad630569be01a8379cfe27b4866495" +checksum = "27cc673ee6989ea6e4b4e8c7d461f7e06026a096c8f0b1a7288885ff71ae1e56" dependencies = [ - "arrow-buffer 32.0.0", - "arrow-schema", - "half 2.1.0", + "arrow-buffer 34.0.0", + "arrow-schema 34.0.0", + "half 2.2.1", + "num", +] + +[[package]] +name = "arrow-data" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19c7787c6cdbf9539b1ffb860bfc18c5848926ec3d62cbd52dc3b1ea35c874fd" +dependencies = [ + "arrow-buffer 35.0.0", + "arrow-schema 35.0.0", + "half 2.2.1", "num", ] @@ -355,31 +394,31 @@ dependencies = [ [[package]] name = "arrow-ipc" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a3ca7eb8d23c83fe40805cbafec70a6a31df72de47355545ff34c850f715403" +checksum = "e37b8b69d9e59116b6b538e8514e0ec63a30f08b617ce800d31cb44e3ef64c1a" dependencies = [ - "arrow-array", - "arrow-buffer 32.0.0", + "arrow-array 34.0.0", + "arrow-buffer 34.0.0", "arrow-cast", - "arrow-data", - "arrow-schema", + "arrow-data 34.0.0", + "arrow-schema 34.0.0", "flatbuffers 23.1.21", ] [[package]] name = "arrow-json" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf65aff76d2e340d827d5cab14759e7dd90891a288347e2202e4ee28453d9bed" +checksum = "80c3fa0bed7cfebf6d18e46b733f9cb8a1cb43ce8e6539055ca3e1e48a426266" dependencies = [ - "arrow-array", - "arrow-buffer 32.0.0", + "arrow-array 34.0.0", + "arrow-buffer 34.0.0", "arrow-cast", - "arrow-data", - "arrow-schema", + "arrow-data 34.0.0", + "arrow-schema 34.0.0", "chrono", - "half 2.1.0", + "half 2.2.1", "indexmap", "lexical-core 0.8.5", "num", @@ -388,62 +427,68 @@ dependencies = [ [[package]] name = "arrow-ord" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074a5a55c37ae4750af4811c8861c0378d8ab2ff6c262622ad24efae6e0b73b3" +checksum = "d247dce7bed6a8d6a3c6debfa707a3a2f694383f0c692a39d736a593eae5ef94" dependencies = [ - "arrow-array", - "arrow-buffer 32.0.0", - "arrow-data", - "arrow-schema", + "arrow-array 34.0.0", + "arrow-buffer 34.0.0", + "arrow-data 34.0.0", + "arrow-schema 34.0.0", "arrow-select", "num", ] [[package]] name = "arrow-row" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e064ac4e64960ebfbe35f218f5e7d9dc9803b59c2e56f611da28ce6d008f839e" +checksum = "8d609c0181f963cea5c70fddf9a388595b5be441f3aa1d1cdbf728ca834bbd3a" dependencies = [ - "ahash 0.8.0", - "arrow-array", - "arrow-buffer 32.0.0", - "arrow-data", - "arrow-schema", - "half 2.1.0", + "ahash 0.8.3", + "arrow-array 34.0.0", + "arrow-buffer 34.0.0", + "arrow-data 34.0.0", + "arrow-schema 34.0.0", + "half 2.2.1", "hashbrown 0.13.2", ] [[package]] name = "arrow-schema" -version = "32.0.0" +version = "34.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64951898473bfb8e22293e83a44f02874d2257514d49cd95f9aa4afcff183fbc" + +[[package]] +name = "arrow-schema" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ead3f373b9173af52f2fdefcb5a7dd89f453fbc40056f574a8aeb23382a4ef81" +checksum = "bf6b26f6a6f8410e3b9531cbd1886399b99842701da77d4b4cf2013f7708f20f" [[package]] name = "arrow-select" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "646b4f15b5a77c970059e748aeb1539705c68cd397ecf0f0264c4ef3737d35f3" +checksum = "2a513d89c2e1ac22b28380900036cf1f3992c6443efc5e079de631dcf83c6888" dependencies = [ - "arrow-array", - "arrow-buffer 32.0.0", - "arrow-data", - "arrow-schema", + "arrow-array 34.0.0", + "arrow-buffer 34.0.0", + "arrow-data 34.0.0", + "arrow-schema 34.0.0", "num", ] [[package]] name = "arrow-string" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b8bf150caaeca03f39f1a91069701387d93f7cfd256d27f423ac8496d99a51" +checksum = "5288979b2705dae1114c864d73150629add9153b9b8f1d7ee3963db94c372ba5" dependencies = [ - "arrow-array", - "arrow-buffer 32.0.0", - "arrow-data", - "arrow-schema", + "arrow-array 34.0.0", + "arrow-buffer 34.0.0", + "arrow-data 34.0.0", + "arrow-schema 34.0.0", "arrow-select", "regex", "regex-syntax", @@ -456,12 +501,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5feafd6df4e3f577529e6aa2b9b7cdb3c9fe8e8f66ebc8dc29abbe71a7e968f0" dependencies = [ "arrow-format", - "base64 0.13.0", + "base64 0.13.1", "bytemuck", "chrono", "either", "fallible-streaming-iterator", - "futures 0.3.25", + "futures 0.3.28", "hash_hasher", "num-traits", "parquet2", @@ -473,9 +518,9 @@ dependencies = [ name = "arrow_ext" version = "1.1.0" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", "snafu 0.6.10", - "zstd 0.12.1+zstd.1.5.2", + "zstd 0.12.3+zstd.1.5.2", ] [[package]] @@ -492,26 +537,28 @@ dependencies = [ "pin-project-lite", "tokio", "xz2", + "zstd 0.11.2+zstd.1.5.2", + "zstd-safe 5.0.2+zstd.1.5.2", ] [[package]] name = "async-io" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock", "autocfg 1.1.0", + "cfg-if 1.0.0", "concurrent-queue", "futures-lite", - "libc", "log", "parking", "polling", + "rustix", "slab", "socket2", "waker-fn", - "windows-sys 0.42.0", ] [[package]] @@ -542,18 +589,18 @@ checksum = "e4655ae1a7b0cdf149156f780c5bf3f1352bc53cbd9e0a361a7ef7b22947e965" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "async-trait" -version = "0.1.61" +version = "0.1.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.12", ] [[package]] @@ -584,9 +631,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.5.16" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e3356844c4d6a6d6467b8da2cffb4a2820be256f50a3a386c9d152bab31043" +checksum = "349f8ccfd9221ee7d1f3d4b33e1f8319b3a81ed8f61f2ea40b37b859794b4491" dependencies = [ "async-trait", "axum-core", @@ -596,26 +643,25 @@ dependencies = [ "http", "http-body", "hyper", - "itoa 1.0.3", + "itoa", "matchit", "memchr", "mime", "percent-encoding", "pin-project-lite", + "rustversion", "serde", "sync_wrapper", - "tokio", "tower", - "tower-http", "tower-layer", "tower-service", ] [[package]] name = "axum-core" -version = "0.2.8" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f0c0a60006f2a293d82d571f635042a72edf927539b7685bd62d361963839b" +checksum = "b2f958c80c248b34b9a877a643811be8dbca03ca5ba827f2b63baf3a81e5fc4e" dependencies = [ "async-trait", "bytes 1.4.0", @@ -623,15 +669,16 @@ dependencies = [ "http", "http-body", "mime", + "rustversion", "tower-layer", "tower-service", ] [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ "addr2line", "cc", @@ -653,9 +700,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" @@ -669,15 +716,15 @@ version = "1.1.0" dependencies = [ "analytic_engine", "arena", - "arrow 32.0.0", + "arrow 34.0.0", "arrow2", - "base64 0.13.0", + "base64 0.13.1", "clap 3.2.23", "common_types", "common_util", "criterion", "env_logger", - "futures 0.3.25", + "futures 0.3.28", "log", "object_store 1.1.0", "parquet", @@ -691,7 +738,7 @@ dependencies = [ "tokio", "trace_metric", "wal", - "zstd 0.12.1+zstd.1.5.2", + "zstd 0.12.3+zstd.1.5.2", ] [[package]] @@ -799,25 +846,25 @@ dependencies = [ [[package]] name = "blake2" -version = "0.10.4" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9cf849ee05b2ee5fba5e36f97ff8ec2533916700fc0758d40d92136a42f3388" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.3", + "digest 0.10.6", ] [[package]] name = "blake3" -version = "1.3.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" +checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" dependencies = [ "arrayref", "arrayvec 0.7.2", "cc", "cfg-if 1.0.0", "constant_time_eq", - "digest 0.10.3", + "digest 0.10.6", ] [[package]] @@ -834,11 +881,11 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -850,6 +897,51 @@ dependencies = [ "byte-tools", ] +[[package]] +name = "borsh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +dependencies = [ + "borsh-derive", + "hashbrown 0.13.2", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "brotli" version = "3.3.4" @@ -863,26 +955,14 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.2" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" +checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", ] -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", -] - [[package]] name = "buf_redux" version = "0.8.4" @@ -911,6 +991,28 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +[[package]] +name = "bytecheck" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13fe11640a23eb24562225322cd3e452b93a3d4091d62fab69c70542fcd17d1f" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31225543cb46f81a7e224762764f4a6a0f097b1db0b175f69e8065efaa42de5" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "bytecount" version = "0.6.3" @@ -919,22 +1021,22 @@ checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" [[package]] name = "bytemuck" -version = "1.11.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5377c8865e74a160d21f29c2d40669f53286db6eab59b88540cbb12ffc8b835" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.1.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd2f4180c5721da6335cc9e9061cce522b87a35e51cc57636d28d22a9863c80" +checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.12", ] [[package]] @@ -1014,7 +1116,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.13", + "semver 1.0.17", "serde", "serde_json", ] @@ -1077,14 +1179,14 @@ dependencies = [ "proc-macro-error 0.4.12", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "cc" -version = "1.0.73" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" dependencies = [ "jobserver", ] @@ -1127,12 +1229,12 @@ dependencies = [ "async-trait", "ceresdbproto 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "dashmap 5.4.0", - "futures 0.3.25", - "paste 1.0.8", + "futures 0.3.28", + "paste 1.0.12", "thiserror", "tokio", "tonic", - "zstd 0.12.1+zstd.1.5.2", + "zstd 0.12.3+zstd.1.5.2", ] [[package]] @@ -1191,7 +1293,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom 7.1.1", + "nom 7.1.3", ] [[package]] @@ -1208,16 +1310,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" dependencies = [ "iana-time-zone", "js-sys", "num-integer", "num-traits", "serde", - "time 0.1.45", + "time 0.1.43", "wasm-bindgen", "winapi", ] @@ -1246,9 +1348,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.3.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", @@ -1293,11 +1395,11 @@ version = "3.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" dependencies = [ - "heck 0.4.0", + "heck 0.4.1", "proc-macro-error 1.0.4", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1344,9 +1446,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.48" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" dependencies = [ "cc", ] @@ -1363,9 +1465,9 @@ dependencies = [ [[package]] name = "comfy-table" -version = "6.1.0" +version = "6.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85914173c2f558d61613bfbbf1911f14e630895087a7ed2fafc0f5319e1536e7" +checksum = "6e7b787b0dc42e8111badfdbe4c3059158ccb2db8780352fa1b01e8ccf45cc4d" dependencies = [ "strum", "strum_macros", @@ -1376,7 +1478,7 @@ dependencies = [ name = "common_types" version = "1.1.0" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", "arrow_ext", "byteorder", "bytes_ext", @@ -1384,7 +1486,7 @@ dependencies = [ "chrono", "datafusion", "murmur3", - "paste 1.0.8", + "paste 1.0.12", "prost", "serde", "serde_json", @@ -1396,12 +1498,12 @@ dependencies = [ name = "common_util" version = "1.1.0" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", "backtrace", "ceresdbproto 1.0.1 (git+https://github.com/CeresDB/ceresdbproto.git?rev=1c3bf4e803ef8b7a1fbc8c3d4a07fdd372e1830b)", "chrono", "common_types", - "crossbeam-utils 0.8.11", + "crossbeam-utils 0.8.15", "env_logger", "gag", "lazy_static", @@ -1417,7 +1519,7 @@ dependencies = [ "slog-global", "snafu 0.6.10", "tempfile", - "time 0.3.15", + "time 0.3.20", "tokio", "tokio-test", "toml 0.7.3", @@ -1429,14 +1531,14 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" dependencies = [ - "crossbeam-utils 0.8.11", + "crossbeam-utils 0.8.15", ] [[package]] name = "const-random" -version = "0.1.13" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f590d95d011aa80b063ffe3253422ed5aa462af4e9867d43ce8337562bac77c4" +checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" dependencies = [ "const-random-macro", "proc-macro-hack", @@ -1444,21 +1546,21 @@ dependencies = [ [[package]] name = "const-random-macro" -version = "0.1.13" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615f6e27d000a2bffbc7f2f6a8669179378fa27ee4d0a509e985dfc0a7defb40" +checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" dependencies = [ - "getrandom 0.2.7", - "lazy_static", + "getrandom 0.2.8", + "once_cell", "proc-macro-hack", "tiny-keccak", ] [[package]] name = "constant_time_eq" -version = "0.1.5" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" [[package]] name = "convert_case" @@ -1483,27 +1585,27 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" dependencies = [ "libc", ] [[package]] name = "crc" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" [[package]] name = "crc32c" @@ -1585,12 +1687,12 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.11", + "crossbeam-utils 0.8.15", ] [[package]] @@ -1606,13 +1708,13 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.10", - "crossbeam-utils 0.8.11", + "crossbeam-epoch 0.9.14", + "crossbeam-utils 0.8.15", ] [[package]] @@ -1632,15 +1734,14 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.10" +version = "0.9.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" dependencies = [ "autocfg 1.1.0", "cfg-if 1.0.0", - "crossbeam-utils 0.8.11", - "memoffset 0.6.5", - "once_cell", + "crossbeam-utils 0.8.15", + "memoffset 0.8.0", "scopeguard", ] @@ -1668,12 +1769,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" dependencies = [ "cfg-if 1.0.0", - "once_cell", ] [[package]] @@ -1688,19 +1788,18 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "typenum", ] [[package]] name = "csv" -version = "1.1.6" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" +checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad" dependencies = [ - "bstr", "csv-core", - "itoa 0.4.8", + "itoa", "ryu", "serde", ] @@ -1716,9 +1815,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.88" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322296e2f2e5af4270b54df9e85a02ff037e271af20ba3e7fe1575515dc840b8" +checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" dependencies = [ "cc", "cxxbridge-flags", @@ -1728,9 +1827,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.88" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "017a1385b05d631e7875b1f151c9f012d37b53491e2a87f65bff5c262b2111d8" +checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" dependencies = [ "cc", "codespan-reporting", @@ -1738,31 +1837,31 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 2.0.12", ] [[package]] name = "cxxbridge-flags" -version = "1.0.88" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c26bbb078acf09bc1ecda02d4223f03bdd28bd4874edcb0379138efc499ce971" +checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" [[package]] name = "cxxbridge-macro" -version = "1.0.88" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357f40d1f06a24b60ae1fe122542c1fb05d28d32acb2aed064e84bc2ad1e252e" +checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.12", ] [[package]] name = "darling" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ "darling_core", "darling_macro", @@ -1770,27 +1869,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.10.0", - "syn", + "syn 1.0.109", ] [[package]] name = "darling_macro" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1814,17 +1913,16 @@ dependencies = [ "hashbrown 0.12.3", "lock_api", "once_cell", - "parking_lot_core 0.9.3", + "parking_lot_core 0.9.7", ] [[package]] name = "datafusion" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd805bdf93d3137b37fd9966042df0c84ddfca0df5a8d32eaacb16cf6ab0d93d" +version = "20.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=26e1b20ea3362ea62cb713004a0636b8af6a16d7#26e1b20ea3362ea62cb713004a0636b8af6a16d7" dependencies = [ - "ahash 0.8.0", - "arrow 32.0.0", + "ahash 0.8.3", + "arrow 34.0.0", "async-compression", "async-trait", "bytes 1.4.0", @@ -1832,13 +1930,14 @@ dependencies = [ "chrono", "dashmap 5.4.0", "datafusion-common", + "datafusion-execution", "datafusion-expr", "datafusion-optimizer", "datafusion-physical-expr", "datafusion-row", "datafusion-sql", "flate2", - "futures 0.3.25", + "futures 0.3.28", "glob", "hashbrown 0.13.2", "indexmap", @@ -1849,7 +1948,6 @@ dependencies = [ "object_store 0.5.5", "parking_lot 0.12.1", "parquet", - "paste 1.0.8", "percent-encoding", "pin-project-lite", "rand 0.8.5", @@ -1862,15 +1960,16 @@ dependencies = [ "url", "uuid 1.3.0", "xz2", + "zstd 0.12.3+zstd.1.5.2", ] [[package]] name = "datafusion-common" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c58d6714427f52f9815d19debab7adab5bac5b4d2a99d51c250e606acb6cf5" +version = "20.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=26e1b20ea3362ea62cb713004a0636b8af6a16d7#26e1b20ea3362ea62cb713004a0636b8af6a16d7" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", + "arrow-array 35.0.0", "chrono", "num_cpus", "object_store 0.5.5", @@ -1879,79 +1978,91 @@ dependencies = [ ] [[package]] -name = "datafusion-expr" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a32ee054230dd9a57d0bed587406869c4a7814d90154616aff2cb9991c1756f" +name = "datafusion-execution" +version = "20.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=26e1b20ea3362ea62cb713004a0636b8af6a16d7#26e1b20ea3362ea62cb713004a0636b8af6a16d7" dependencies = [ - "ahash 0.8.0", - "arrow 32.0.0", + "dashmap 5.4.0", "datafusion-common", + "datafusion-expr", + "hashbrown 0.13.2", "log", + "object_store 0.5.5", + "parking_lot 0.12.1", + "rand 0.8.5", + "tempfile", + "url", +] + +[[package]] +name = "datafusion-expr" +version = "20.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=26e1b20ea3362ea62cb713004a0636b8af6a16d7#26e1b20ea3362ea62cb713004a0636b8af6a16d7" +dependencies = [ + "ahash 0.8.3", + "arrow 34.0.0", + "datafusion-common", "sqlparser", ] [[package]] name = "datafusion-optimizer" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6de4d144924de29a835feeff8313a81fdc2c7190111301508e09ea59a80edbbc" +version = "20.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=26e1b20ea3362ea62cb713004a0636b8af6a16d7#26e1b20ea3362ea62cb713004a0636b8af6a16d7" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", "async-trait", "chrono", "datafusion-common", "datafusion-expr", "datafusion-physical-expr", "hashbrown 0.13.2", + "itertools", "log", "regex-syntax", ] [[package]] name = "datafusion-physical-expr" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943e42356f0f6f5ac37ceacd412de9c4d7d8eba1e81b6f724f88699540c7f070" +version = "20.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=26e1b20ea3362ea62cb713004a0636b8af6a16d7#26e1b20ea3362ea62cb713004a0636b8af6a16d7" dependencies = [ - "ahash 0.8.0", - "arrow 32.0.0", - "arrow-buffer 32.0.0", - "arrow-schema", + "ahash 0.8.3", + "arrow 34.0.0", + "arrow-buffer 34.0.0", + "arrow-schema 34.0.0", "blake2", "blake3", "chrono", "datafusion-common", "datafusion-expr", "datafusion-row", - "half 2.1.0", + "half 2.2.1", "hashbrown 0.13.2", "indexmap", "itertools", "lazy_static", "md-5", - "num-traits", - "paste 1.0.8", + "paste 1.0.12", + "petgraph", "rand 0.8.5", "regex", - "sha2 0.10.2", + "sha2 0.10.6", "unicode-segmentation", "uuid 1.3.0", ] [[package]] name = "datafusion-proto" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "649aec221737d8fb88956a2e6181297456f83b8560d32d775ad1cd22d67fd598" +version = "20.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=26e1b20ea3362ea62cb713004a0636b8af6a16d7#26e1b20ea3362ea62cb713004a0636b8af6a16d7" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", "chrono", "datafusion", "datafusion-common", "datafusion-expr", "object_store 0.5.5", - "parking_lot 0.12.1", "pbjson-build", "prost", "prost-build", @@ -1959,29 +2070,41 @@ dependencies = [ [[package]] name = "datafusion-row" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a506f5924f8af54e0806a995da0897f8c2b548d492793e045a3896d88d6714a" +version = "20.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=26e1b20ea3362ea62cb713004a0636b8af6a16d7#26e1b20ea3362ea62cb713004a0636b8af6a16d7" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", "datafusion-common", - "paste 1.0.8", + "paste 1.0.12", "rand 0.8.5", ] [[package]] name = "datafusion-sql" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3d12047a5847f9667f4e2aa8fa2e7d5a6e1094b8e3546d58de492152a50dc7" +version = "20.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=26e1b20ea3362ea62cb713004a0636b8af6a16d7#26e1b20ea3362ea62cb713004a0636b8af6a16d7" dependencies = [ - "arrow-schema", + "arrow-schema 34.0.0", "datafusion-common", "datafusion-expr", "log", "sqlparser", ] +[[package]] +name = "datafusion_util" +version = "0.1.0" +source = "git+https://github.com/CeresDB/influxql#36fc4d873e7d9b544560e465cfb2224883bddf98" +dependencies = [ + "async-trait", + "datafusion", + "futures 0.3.28", + "observability_deps", + "pin-project", + "tokio", + "tokio-stream", +] + [[package]] name = "debugid" version = "0.8.0" @@ -2009,7 +2132,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2019,7 +2142,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ "derive_builder_core", - "syn", + "syn 1.0.109", ] [[package]] @@ -2032,15 +2155,15 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn", + "syn 1.0.109", ] [[package]] name = "df_operator" version = "1.1.0" dependencies = [ - "arrow 32.0.0", - "base64 0.13.0", + "arrow 34.0.0", + "base64 0.13.1", "bincode", "chrono", "common_types", @@ -2063,11 +2186,11 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.3" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ - "block-buffer 0.10.2", + "block-buffer 0.10.4", "crypto-common", "subtle", ] @@ -2101,9 +2224,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "either" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "encode_unicode" @@ -2113,9 +2236,9 @@ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ "cfg-if 1.0.0", ] @@ -2137,7 +2260,7 @@ checksum = "355f93763ef7b0ae1c43c4d8eccc9d5848d84ad1a1d8ce61c421d1ac85a19d05" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2155,13 +2278,13 @@ dependencies = [ [[package]] name = "errno" -version = "0.2.8" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" dependencies = [ "errno-dragonfly", "libc", - "winapi", + "windows-sys 0.45.0", ] [[package]] @@ -2214,9 +2337,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] @@ -2273,9 +2396,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", "libz-sys", @@ -2290,19 +2413,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] [[package]] name = "frunk" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cd67cf7d54b7e72d0ea76f3985c3747d74aee43e0218ad993b7903ba7a5395e" +checksum = "a89c703bf50009f383a0873845357cc400a95fc535f836feddfe015d7df6e1e0" dependencies = [ "frunk_core", "frunk_derives", @@ -2311,38 +2433,38 @@ dependencies = [ [[package]] name = "frunk_core" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1246cf43ec80bf8b2505b5c360b8fb999c97dabd17dbb604d85558d5cbc25482" +checksum = "2a446d01a558301dca28ef43222864a9fa2bd9a2e71370f769d5d5d5ec9f3537" [[package]] name = "frunk_derives" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dbc4f084ec5a3f031d24ccedeb87ab2c3189a2f33b8d070889073837d5ea09e" +checksum = "b83164912bb4c97cfe0772913c7af7387ee2e00cb6d4636fb65a35b3d0c8f173" dependencies = [ "frunk_proc_macro_helpers", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "frunk_proc_macro_helpers" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99f11257f106c6753f5ffcb8e601fb39c390a088017aaa55b70c526bff15f63e" +checksum = "015425591bbeb0f5b8a75593340f1789af428e9f887a4f1e36c0c471f067ef50" dependencies = [ "frunk_core", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "frunk_proc_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a078bd8459eccbb85e0b007b8f756585762a72a9efc53f359b371c3b6351dbcc" +checksum = "ea01524f285deab48affffb342b97f186e657b119c3f1821ac531780e0fbfae0" dependencies = [ "frunk_core", "frunk_proc_macros_impl", @@ -2351,15 +2473,15 @@ dependencies = [ [[package]] name = "frunk_proc_macros_impl" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffba99f0fa4f57e42f57388fbb9a0ca863bc2b4261f3c5570fed579d5df6c32" +checksum = "0a802d974cc18ee7fe1a7868fc9ce31086294fd96ba62f8da64ecb44e92a2653" dependencies = [ "frunk_core", "frunk_proc_macro_helpers", "proc-macro-hack", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2388,9 +2510,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -2403,9 +2525,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -2413,9 +2535,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-cpupool" @@ -2429,9 +2551,9 @@ dependencies = [ [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -2440,9 +2562,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" @@ -2461,32 +2583,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.12", ] [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -2516,6 +2638,20 @@ version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" +[[package]] +name = "generated_types" +version = "0.1.0" +source = "git+https://github.com/CeresDB/influxql#36fc4d873e7d9b544560e465cfb2224883bddf98" +dependencies = [ + "pbjson", + "pbjson-build", + "pbjson-types", + "prost", + "prost-build", + "serde", + "tonic-build", +] + [[package]] name = "generic-array" version = "0.12.4" @@ -2527,9 +2663,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -2548,9 +2684,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if 1.0.0", "libc", @@ -2566,20 +2702,20 @@ dependencies = [ "proc-macro-error 1.0.4", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" [[package]] name = "git2" -version = "0.14.4" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0155506aab710a86160ddb504a480d2964d7ab5b9e62419be69e0032bc5931c" +checksum = "ccf7f68c2995f392c49fffb4f95ae2c873297830eb25c6bc4c114ce8f4562acc" dependencies = [ "bitflags", "libc", @@ -2590,15 +2726,15 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.13" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" dependencies = [ "bytes 1.4.0", "fnv", @@ -2621,9 +2757,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "half" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad6a9459c9c30b177b925162351f97e7d967c7ea8bab3b8352805327daf45554" +checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" dependencies = [ "crunchy", "num-traits", @@ -2650,23 +2786,23 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.0", + "ahash 0.8.3", ] [[package]] name = "headers" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cff78e5788be1e0ab65b04d306b2ed5092c815ec97ec70f4ebd5aee158aa55d" +checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "bitflags", "bytes 1.4.0", "headers-core", "http", "httpdate", "mime", - "sha-1", + "sha1 0.10.5", ] [[package]] @@ -2689,9 +2825,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -2711,24 +2847,30 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "hmac" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest 0.10.6", ] [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes 1.4.0", "fnv", - "itoa 1.0.3", + "itoa", ] [[package]] @@ -2742,17 +2884,11 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-range-header" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" - [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -2771,9 +2907,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.20" +version = "0.14.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" dependencies = [ "bytes 1.4.0", "futures-channel", @@ -2784,7 +2920,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.3", + "itoa", "pin-project-lite", "socket2", "tokio", @@ -2831,16 +2967,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "716f12fbcfac6ffab0a5e9ec51d0a0ff70503742bb2dc7b99396394c9dc323f0" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows", ] [[package]] @@ -2861,20 +2997,19 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg 1.1.0", "hashbrown 0.12.3", @@ -2882,18 +3017,18 @@ dependencies = [ [[package]] name = "inferno" -version = "0.11.9" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb31a5d9068fccb34562007cd564bb08fff1478255b0534c549e93fcb658cd90" +checksum = "2fb7c1b80a1dfa604bb4a649a5c5aeef3d913f7c520cb42b40e534e8a61bcdfc" dependencies = [ - "ahash 0.7.6", - "atty", + "ahash 0.8.3", "indexmap", - "itoa 1.0.3", + "is-terminal", + "itoa", "log", "num-format", "once_cell", - "quick-xml 0.23.1", + "quick-xml 0.26.0", "rgb", "str_stack", ] @@ -2906,36 +3041,19 @@ checksum = "1192416847e724d001c1f410cf348f27978a50b30f3473afbf73062cada2697a" dependencies = [ "bytes 1.4.0", "log", - "nom 7.1.1", + "nom 7.1.3", "smallvec", - "snafu 0.7.1", + "snafu 0.7.4", ] [[package]] -name = "influxql-logical-planner" +name = "influxdb_influxql_parser" version = "0.1.0" -source = "git+https://github.com/Rachelint/influxql-logical-planner.git?rev=6057f72cd07336b9d641fcfcb98fb69b60fec1eb#6057f72cd07336b9d641fcfcb98fb69b60fec1eb" +source = "git+https://github.com/CeresDB/influxql#36fc4d873e7d9b544560e465cfb2224883bddf98" dependencies = [ - "arrow 32.0.0", "chrono", "chrono-tz", - "datafusion", - "influxql-parser", - "itertools", - "lazy_static", - "once_cell", - "regex", - "regex-syntax", -] - -[[package]] -name = "influxql-parser" -version = "0.1.0" -source = "git+https://github.com/Rachelint/influxql-parser.git?rev=6fd5d946843682c3559e1c172cf23a14d61495b9#6fd5d946843682c3559e1c172cf23a14d61495b9" -dependencies = [ - "chrono", - "chrono-tz", - "nom 7.1.1", + "nom 7.1.3", "num-traits", "once_cell", ] @@ -2970,7 +3088,7 @@ name = "interpreters" version = "1.1.0" dependencies = [ "analytic_engine", - "arrow 32.0.0", + "arrow 34.0.0", "async-trait", "catalog", "catalog_impls", @@ -2993,12 +3111,13 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.4" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" dependencies = [ + "hermit-abi 0.3.1", "libc", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -3010,22 +3129,53 @@ dependencies = [ "libc", ] +[[package]] +name = "iox_query" +version = "0.1.0" +source = "git+https://github.com/CeresDB/influxql#36fc4d873e7d9b544560e465cfb2224883bddf98" +dependencies = [ + "datafusion", + "observability_deps", +] + +[[package]] +name = "iox_query_influxql" +version = "0.1.0" +source = "git+https://github.com/CeresDB/influxql#36fc4d873e7d9b544560e465cfb2224883bddf98" +dependencies = [ + "arrow 34.0.0", + "chrono", + "chrono-tz", + "datafusion", + "datafusion_util", + "generated_types", + "influxdb_influxql_parser", + "iox_query", + "itertools", + "observability_deps", + "once_cell", + "query_functions", + "regex", + "schema", + "serde_json", +] + [[package]] name = "ipnet" -version = "2.5.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "is-terminal" -version = "0.4.2" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +checksum = "256017f749ab3117e93acb91063009e1f1bb56d03965b14c2c8df4eb02c524d8" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.1", "io-lifetimes", "rustix", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -3039,15 +3189,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.3" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "jemalloc-ctl" @@ -3083,18 +3227,18 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.59" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] @@ -3216,15 +3360,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.139" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "libgit2-sys" -version = "0.13.5+1.4.5" +version = "0.14.2+1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e5ea06c26926f1002dd553fded6cfcdc9784c1f60feeb58368b4d9b07b6dba" +checksum = "7f3d95f6b51075fe9810a7ae22c7095f12b98005ab364d8544797a825ce946a4" dependencies = [ "cc", "libc", @@ -3234,9 +3378,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if 1.0.0", "winapi", @@ -3244,9 +3388,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" [[package]] name = "librocksdb_sys" @@ -3303,9 +3447,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" [[package]] name = "local-ip-address" @@ -3363,9 +3507,9 @@ dependencies = [ [[package]] name = "lz4" -version = "1.23.3" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edcb94251b1c375c459e5abe9fb0168c1c826c3370172684844f8f3f8d1a885" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" dependencies = [ "libc", "lz4-sys", @@ -3410,17 +3554,11 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - [[package]] name = "matchit" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" +checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" [[package]] name = "maybe-uninit" @@ -3430,11 +3568,11 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "md-5" -version = "0.10.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658646b21e0b72f7866c7038ab086d3d5e1cd6271f060fd37defb241949d0582" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ - "digest 0.10.3", + "digest 0.10.6", ] [[package]] @@ -3445,9 +3583,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.5.7" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ "libc", ] @@ -3470,6 +3608,15 @@ dependencies = [ "autocfg 1.1.0", ] +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg 1.1.0", +] + [[package]] name = "message_queue" version = "0.1.0" @@ -3477,7 +3624,7 @@ dependencies = [ "async-trait", "chrono", "common_util", - "futures 0.3.25", + "futures 0.3.28", "log", "rskafka", "serde", @@ -3494,7 +3641,7 @@ dependencies = [ "ceresdbproto 1.0.1 (git+https://github.com/CeresDB/ceresdbproto.git?rev=1c3bf4e803ef8b7a1fbc8c3d4a07fdd372e1830b)", "common_types", "common_util", - "futures 0.3.25", + "futures 0.3.28", "log", "prost", "rand 0.7.3", @@ -3510,9 +3657,9 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" @@ -3532,36 +3679,36 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.36.1", + "windows-sys 0.45.0", ] [[package]] name = "moka" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b6446f16d504e3d575df79cabb11bfbe9f24b17e9562d964a815db7b28ae3ec" +checksum = "1ccedbe530334b20d6f57b2ca9f7c54c7bd1072a5a0b0035970aafd53982bd8d" dependencies = [ "async-io", "async-lock", - "crossbeam-channel 0.5.6", - "crossbeam-epoch 0.9.10", - "crossbeam-utils 0.8.11", + "crossbeam-channel 0.5.7", + "crossbeam-epoch 0.9.14", + "crossbeam-utils 0.8.15", "futures-util", "num_cpus", "once_cell", @@ -3618,7 +3765,7 @@ checksum = "a8a3e2bde382ebf960c1f3e79689fa5941625fe9bf694a1cb64af3e85faff3af" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3684,18 +3831,18 @@ dependencies = [ "serde_json", "sha1 0.6.1", "sha2 0.8.2", - "time 0.1.45", + "time 0.1.43", "twox-hash", "uuid 0.7.4", ] [[package]] name = "mysql_common" -version = "0.29.1" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522f2f30f72de409fc04f88df25a031f98cfc5c398a94e0b892cabb33a1464cb" +checksum = "9006c95034ccf7b903d955f210469119f6c3477fc9c9e7a7845ce38a3e665c2a" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "bigdecimal 0.3.0", "bindgen 0.59.2", "bitflags", @@ -3718,12 +3865,12 @@ dependencies = [ "saturating", "serde", "serde_json", - "sha-1", - "sha2 0.10.2", + "sha1 0.10.5", + "sha2 0.10.6", "smallvec", "subprocess", "thiserror", - "time 0.3.15", + "time 0.3.20", "uuid 1.3.0", ] @@ -3748,9 +3895,9 @@ dependencies = [ [[package]] name = "net2" -version = "0.2.37" +version = "0.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" +checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" dependencies = [ "cfg-if 0.1.10", "libc", @@ -3785,9 +3932,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags", "cfg-if 1.0.0", @@ -3812,9 +3959,9 @@ dependencies = [ [[package]] name = "nom" -version = "7.1.1" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -3859,21 +4006,21 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" +checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" dependencies = [ "num-traits", ] [[package]] name = "num-format" -version = "0.4.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bafe4179722c2894288ee77a9f044f02811c86af699344c498b0840c698a2465" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.4.12", - "itoa 0.4.8", + "arrayvec 0.7.2", + "itoa", ] [[package]] @@ -3921,11 +4068,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi 0.2.6", "libc", ] @@ -3940,9 +4087,9 @@ dependencies = [ [[package]] name = "object" -version = "0.29.0" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "memchr", ] @@ -3957,7 +4104,7 @@ dependencies = [ "base64 0.21.0", "bytes 1.4.0", "chrono", - "futures 0.3.25", + "futures 0.3.28", "itertools", "parking_lot 0.12.1", "percent-encoding", @@ -3967,7 +4114,7 @@ dependencies = [ "ring", "serde", "serde_json", - "snafu 0.7.1", + "snafu 0.7.4", "tokio", "tracing", "url", @@ -3985,7 +4132,7 @@ dependencies = [ "clru", "common_util", "crc", - "futures 0.3.25", + "futures 0.3.28", "lazy_static", "log", "lru", @@ -4028,17 +4175,25 @@ dependencies = [ "serde_bytes", "serde_derive", "serde_json", - "spin", + "spin 0.5.2", "tokio-codec", "uuid 1.3.0", "zstd 0.11.2+zstd.1.5.2", ] +[[package]] +name = "observability_deps" +version = "0.1.0" +source = "git+https://github.com/CeresDB/influxql#36fc4d873e7d9b544560e465cfb2224883bddf98" +dependencies = [ + "tracing", +] + [[package]] name = "once_cell" -version = "1.15.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "oorandom" @@ -4061,8 +4216,8 @@ dependencies = [ "async-trait", "byteorder", "chrono", - "mysql_common 0.29.1", - "nom 7.1.1", + "mysql_common 0.29.2", + "nom 7.1.3", "tokio", ] @@ -4086,9 +4241,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.3.1" +version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3baf96e39c5359d2eb0dd6ccb42c62b91d9678aa68160d261b9e0ccbf9e9dea9" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "oss-rust-sdk" @@ -4097,7 +4252,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0d9aab6ebed77bd0998c728fbef20d6afc63db38c8fe85e0923b624c1b6bfab" dependencies = [ "async-trait", - "base64 0.13.0", + "base64 0.13.1", "bytes 1.4.0", "chrono", "derive_more", @@ -4106,7 +4261,7 @@ dependencies = [ "log", "quick-xml 0.27.1", "reqwest", - "sha1 0.10.4", + "sha1 0.10.5", ] [[package]] @@ -4123,7 +4278,7 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core 0.8.5", + "parking_lot_core 0.8.6", ] [[package]] @@ -4133,67 +4288,67 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.3", + "parking_lot_core 0.9.7", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "winapi", ] [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", - "windows-sys 0.36.1", + "windows-sys 0.45.0", ] [[package]] name = "parquet" -version = "32.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b3d4917209e17e1da5fb07d276da237a42465f0def2b8d5fa5ce0e85855b4c" +checksum = "7ac135ecf63ebb5f53dda0921b0b76d6048b3ef631a5f4760b9e8f863ff00cfa" dependencies = [ - "ahash 0.8.0", - "arrow-array", - "arrow-buffer 32.0.0", + "ahash 0.8.3", + "arrow-array 34.0.0", + "arrow-buffer 34.0.0", "arrow-cast", - "arrow-data", + "arrow-data 34.0.0", "arrow-ipc", - "arrow-schema", + "arrow-schema 34.0.0", "arrow-select", "base64 0.21.0", "brotli", "bytes 1.4.0", "chrono", "flate2", - "futures 0.3.25", + "futures 0.3.28", "hashbrown 0.13.2", "lz4", "num", "num-bigint 0.4.3", - "paste 1.0.8", + "paste 1.0.12", "seq-macro", "snap", "thrift 0.17.0", "tokio", "twox-hash", - "zstd 0.12.1+zstd.1.5.2", + "zstd 0.12.3+zstd.1.5.2", ] [[package]] @@ -4212,7 +4367,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1a672c84c3e5b5eb6530286b2d22cc1ea8e1e3560e4c314218d6ab749c6db99" dependencies = [ "async-trait", - "futures 0.3.25", + "futures 0.3.28", "integer-encoding 3.0.4", ] @@ -4224,7 +4379,7 @@ checksum = "73fd2690ad041f9296876daef1f2706f6347073bdbcc719090887f1691e4a09d" dependencies = [ "async-stream", "bitpacking", - "futures 0.3.25", + "futures 0.3.28", "parquet-format-async-temp", "streaming-decompression", ] @@ -4233,7 +4388,7 @@ dependencies = [ name = "parquet_ext" version = "1.1.0" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", "arrow_ext", "async-trait", "bytes 1.4.0", @@ -4269,9 +4424,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423e2b32f7a043629287a536f21951e8c6a82482d0acb1eeebfc90bc2225b22" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" [[package]] name = "paste-impl" @@ -4282,18 +4437,43 @@ dependencies = [ "proc-macro-hack", ] +[[package]] +name = "pbjson" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048f9ac93c1eab514f9470c4bc8d97ca2a0a236b84f45cc19d69a59fc11467f6" +dependencies = [ + "base64 0.13.1", + "serde", +] + [[package]] name = "pbjson-build" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbb7b706f2afc610f3853550cdbbf6372fd324824a087806bd4480ea4996e24" dependencies = [ - "heck 0.4.0", + "heck 0.4.1", "itertools", "prost", "prost-types", ] +[[package]] +name = "pbjson-types" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a88c8d87f99a4ac14325e7a4c24af190fca261956e3b82dd7ed67e77e6c7043" +dependencies = [ + "bytes 1.4.0", + "chrono", + "pbjson", + "pbjson-build", + "prost", + "prost-build", + "serde", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -4308,9 +4488,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "petgraph" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", "indexmap", @@ -4356,22 +4536,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4388,9 +4568,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "planus" @@ -4403,9 +4583,9 @@ dependencies = [ [[package]] name = "plotters" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9428003b84df1496fb9d6eeee9c5f8145cb41ca375eb0dad204328888832811f" +checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" dependencies = [ "num-traits", "plotters-backend", @@ -4422,25 +4602,27 @@ checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" [[package]] name = "plotters-svg" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0918736323d1baff32ee0eade54984f6f201ad7e97d5cfb5d6ab4a358529615" +checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" dependencies = [ "plotters-backend", ] [[package]] name = "polling" -version = "2.5.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" +checksum = "7e1f879b2998099c2d69ab9605d145d5b661195627eccc680002c4918a7fb6fa" dependencies = [ "autocfg 1.1.0", + "bitflags", "cfg-if 1.0.0", + "concurrent-queue", "libc", "log", - "wepoll-ffi", - "windows-sys 0.42.0", + "pin-project-lite", + "windows-sys 0.45.0", ] [[package]] @@ -4456,7 +4638,7 @@ dependencies = [ "inferno", "libc", "log", - "nix 0.24.2", + "nix 0.24.3", "once_cell", "parking_lot 0.12.1", "smallvec", @@ -4467,9 +4649,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettydiff" @@ -4484,12 +4666,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.1.19" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49e86d2c26a24059894a3afa13fd17d063419b05dfb83f06d9c3566060c3f5a" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.109", ] [[package]] @@ -4506,6 +4688,15 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml 0.5.11", +] + [[package]] name = "proc-macro-error" version = "0.4.12" @@ -4515,7 +4706,7 @@ dependencies = [ "proc-macro-error-attr 0.4.12", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -4528,7 +4719,7 @@ dependencies = [ "proc-macro-error-attr 1.0.4", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -4540,7 +4731,7 @@ checksum = "8a5b4b77fdb63c1eca72173d68d24501c54ab1269409f6b672c85deb18af69de" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "syn-mid", "version_check", ] @@ -4558,15 +4749,15 @@ dependencies = [ [[package]] name = "proc-macro-hack" -version = "0.5.19" +version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.52" +version = "1.0.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" +checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534" dependencies = [ "unicode-ident", ] @@ -4589,7 +4780,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbef7d8c450f6570e12606546fd941696561ed97a07a353e4131f4fc715da09f" dependencies = [ "async-trait", - "futures 0.3.25", + "futures 0.3.28", "prost", "prost-build", "snap", @@ -4607,7 +4798,7 @@ dependencies = [ "lazy_static", "protobuf", "quick-error", - "spin", + "spin 0.5.2", ] [[package]] @@ -4648,14 +4839,14 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "prost" -version = "0.11.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21dc42e00223fc37204bd4aa177e69420c604ca4a183209a8f9de30c6d934698" +checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" dependencies = [ "bytes 1.4.0", "prost-derive", @@ -4663,12 +4854,12 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.6" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f8ad728fb08fe212df3c05169e940fbb6d9d16a877ddde14644a983ba2012e" +checksum = "a24be1d23b4552a012093e1b93697b73d644ae9590e3253d878d0e77d411b614" dependencies = [ "bytes 1.4.0", - "heck 0.4.0", + "heck 0.4.1", "itertools", "lazy_static", "log", @@ -4678,39 +4869,38 @@ dependencies = [ "prost", "prost-types", "regex", - "syn", + "syn 1.0.109", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.11.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda8c0881ea9f722eb9629376db3d0b903b462477c1aafcb0566610ac28ac5d" +checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "prost-types" -version = "0.11.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e0526209433e96d83d750dd81a99118edbc55739e7e61a46764fd2ad537788" +checksum = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" dependencies = [ - "bytes 1.4.0", "prost", ] [[package]] name = "protobuf" -version = "2.27.1" +version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf7e6d18738ecd0902d30d1ad232c9125985a3422929b16c65517b38adc14f96" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "protoc-bin-vendored" @@ -4762,6 +4952,26 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9653c3ed92974e34c5a6e0a510864dab979760481714c172e0a34e437cb98804" +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "pulldown-cmark" version = "0.9.2" @@ -4779,12 +4989,12 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e31331286705f455e56cca62e0e717158474ff02b7936c1fa596d983f4ae27" dependencies = [ - "crossbeam-utils 0.8.11", + "crossbeam-utils 0.8.15", "libc", "mach", "once_cell", "raw-cpuid", - "wasi 0.10.0+wasi-snapshot-preview1", + "wasi 0.10.2+wasi-snapshot-preview1", "web-sys", "winapi", ] @@ -4793,7 +5003,7 @@ dependencies = [ name = "query_engine" version = "1.1.0" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", "async-trait", "chrono", "common_types", @@ -4801,7 +5011,7 @@ dependencies = [ "datafusion", "datafusion-expr", "df_operator", - "futures 0.3.25", + "futures 0.3.28", "log", "serde", "snafu 0.6.10", @@ -4810,6 +5020,15 @@ dependencies = [ "tokio", ] +[[package]] +name = "query_functions" +version = "0.1.0" +source = "git+https://github.com/CeresDB/influxql#36fc4d873e7d9b544560e465cfb2224883bddf98" +dependencies = [ + "regex", + "regex-syntax", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -4818,9 +5037,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quick-xml" -version = "0.23.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" +checksum = "7f50b1c63b38611e7d4d7f68b82d3ad0cc71a2ad2e7f61fc10f1328d917c93cd" dependencies = [ "memchr", ] @@ -4837,9 +5056,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.21" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -4924,7 +5143,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -4954,7 +5173,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -4983,11 +5202,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.8", ] [[package]] @@ -5072,25 +5291,23 @@ dependencies = [ [[package]] name = "rayon" -version = "1.5.3" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ - "autocfg 1.1.0", - "crossbeam-deque 0.8.2", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.9.3" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ - "crossbeam-channel 0.5.6", - "crossbeam-deque 0.8.2", - "crossbeam-utils 0.8.11", + "crossbeam-channel 0.5.7", + "crossbeam-deque 0.8.3", + "crossbeam-utils 0.8.15", "num_cpus", ] @@ -5112,22 +5329,31 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.7", - "redox_syscall", + "getrandom 0.2.8", + "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "regex" -version = "1.7.1" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", @@ -5145,9 +5371,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "remote_engine_client" @@ -5159,7 +5385,7 @@ dependencies = [ "clru", "common_types", "common_util", - "futures 0.3.25", + "futures 0.3.28", "log", "router", "serde", @@ -5170,21 +5396,21 @@ dependencies = [ ] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "rend" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" dependencies = [ - "winapi", + "bytecheck", ] [[package]] name = "reqwest" -version = "0.11.13" +version = "0.11.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" dependencies = [ - "base64 0.13.0", + "base64 0.21.0", "bytes 1.4.0", "encoding_rs", "futures-core", @@ -5213,6 +5439,7 @@ dependencies = [ "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "webpki-roots", "winreg", @@ -5220,9 +5447,9 @@ dependencies = [ [[package]] name = "rgb" -version = "0.8.34" +version = "0.8.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3603b7d71ca82644f79b5a06d1220e9a58ede60bd32255f698cb1af8838b8db3" +checksum = "20ec2d3e3fc7a92ced357df9cebd5a10b6fb2aa1ee797bf7e9ce2f17dffc8f59" dependencies = [ "bytemuck", ] @@ -5236,12 +5463,37 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", + "spin 0.5.2", "untrusted", "web-sys", "winapi", ] +[[package]] +name = "rkyv" +version = "0.7.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21499ed91807f07ae081880aabb2ccc0235e9d88011867d984525e9a4c3cfa3e" +dependencies = [ + "bytecheck", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1c672430eb41556291981f45ca900a0239ad007242d1cb4b4167af842db666" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "rocksdb" version = "0.3.0" @@ -5279,7 +5531,7 @@ dependencies = [ "chrono", "crc32c", "flate2", - "futures 0.3.25", + "futures 0.3.28", "integer-encoding 3.0.4", "lz4", "parking_lot 0.12.1", @@ -5301,26 +5553,26 @@ dependencies = [ "libc", "rand 0.3.23", "rustc-serialize", - "time 0.1.45", + "time 0.1.43", ] [[package]] name = "rust-fsm" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9ee4731a0f53c973772b83c43c57a26e146b6fa024af5aeab972b63d678b65" +checksum = "021d7de715253e45ad24a2fbb0725a0f7f271fd8d3163b130bd65ce2816a860d" dependencies = [ "rust-fsm-dsl", ] [[package]] name = "rust-fsm-dsl" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44237c429621e3606374941c3061fe95686bdaddb9b4f6524e4edc2d21da9c58" +checksum = "8a66b1273014079e4cf2b04aad1f3a2849e26e9a106f0411be2b1c15c23a791a" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -5333,20 +5585,27 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.26.0" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc129ab6000ab4037e7718703cdeab82a12c4ee23a238658f55372d80ef2b05" +checksum = "26bd36b60561ee1fb5ec2817f198b6fd09fa571c897a5e86d1487cfc2b096dfc" dependencies = [ "arrayvec 0.7.2", + "borsh", + "bytecheck", + "byteorder", + "bytes 1.4.0", "num-traits", + "rand 0.8.5", + "rkyv", "serde", + "serde_json", ] [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d4a36c42d1873f9a77c53bde094f9664d9891bc604a45b4798fd2c389ed12e5b" [[package]] name = "rustc-hash" @@ -5375,21 +5634,21 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.13", + "semver 1.0.17", ] [[package]] name = "rustix" -version = "0.36.7" +version = "0.37.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" +checksum = "0e78cc525325c06b4a7ff02db283472f3c042b7ff0c391f96c6d5ac6f4f91b75" dependencies = [ "bitflags", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -5410,7 +5669,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", ] [[package]] @@ -5424,15 +5683,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "safemem" @@ -5457,18 +5716,31 @@ checksum = "ece8e78b2f38ec51c51f5d475df0a7187ba5111b2a28bdc761ee05b075d40a71" [[package]] name = "scheduled-thread-pool" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "977a7519bff143a44f842fd07e80ad1329295bd71686457f18e496736f4bf9bf" +checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19" dependencies = [ "parking_lot 0.12.1", ] +[[package]] +name = "schema" +version = "0.1.0" +source = "git+https://github.com/CeresDB/influxql#36fc4d873e7d9b544560e465cfb2224883bddf98" +dependencies = [ + "arrow 34.0.0", + "hashbrown 0.13.2", + "indexmap", + "itertools", + "observability_deps", + "snafu 0.7.4", +] + [[package]] name = "scoped-tls" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" @@ -5478,9 +5750,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scratch" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" +checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "sct" @@ -5492,6 +5764,12 @@ dependencies = [ "untrusted", ] +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + [[package]] name = "semver" version = "0.9.0" @@ -5503,9 +5781,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.13" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" dependencies = [ "serde", ] @@ -5518,15 +5796,15 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "seq-macro" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0772c5c30e1a0d91f6834f8e545c69281c099dfa9a3ac58d96a9fd629c8d4898" +checksum = "e6b44e8fc93a14e66336d230954dda83d18b4605ccace8fe09bc7514a71ad0bc" [[package]] name = "serde" -version = "1.0.156" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" +checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" dependencies = [ "serde_derive", ] @@ -5552,22 +5830,22 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.156" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" +checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.12", ] [[package]] name = "serde_json" -version = "1.0.83" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" +checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" dependencies = [ - "itoa 1.0.3", + "itoa", "ryu", "serde", ] @@ -5588,7 +5866,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.3", + "itoa", "ryu", "serde", ] @@ -5598,19 +5876,20 @@ name = "server" version = "1.1.0" dependencies = [ "analytic_engine", - "arrow 32.0.0", + "arrow 34.0.0", "arrow_ext", "async-trait", "bytes 1.4.0", "catalog", "ceresdbproto 1.0.1 (git+https://github.com/CeresDB/ceresdbproto.git?rev=1c3bf4e803ef8b7a1fbc8c3d4a07fdd372e1830b)", + "clru", "cluster", "common_types", "common_util", "datafusion", "datafusion-expr", "df_operator", - "futures 0.3.25", + "futures 0.3.28", "http", "influxdb-line-protocol", "interpreters", @@ -5620,7 +5899,7 @@ dependencies = [ "logger", "meta_client", "opensrv-mysql", - "paste 1.0.8", + "paste 1.0.12", "profile", "prom-remote-api", "prometheus 0.12.0", @@ -5631,6 +5910,7 @@ dependencies = [ "serde", "serde_json", "snafu 0.6.10", + "spin 0.9.8", "sql", "system_catalog", "table_engine", @@ -5639,18 +5919,18 @@ dependencies = [ "tonic", "wal", "warp", - "zstd 0.12.1+zstd.1.5.2", + "zstd 0.12.3+zstd.1.5.2", ] [[package]] name = "sha-1" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.3", + "digest 0.10.6", ] [[package]] @@ -5664,13 +5944,13 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006769ba83e921b3085caa8334186b00cf92b4cb1a6cf4632fbccc8eff5c7549" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.3", + "digest 0.10.6", ] [[package]] @@ -5693,13 +5973,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.3", + "digest 0.10.6", ] [[package]] @@ -5725,9 +6005,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" +checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" dependencies = [ "libc", "signal-hook-registry", @@ -5735,9 +6015,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] @@ -5785,9 +6065,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg 1.1.0", ] @@ -5804,7 +6084,7 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "766c59b252e62a34651412870ff55d8c4e6d04df19b43eecb2703e417b097ffe" dependencies = [ - "crossbeam-channel 0.5.6", + "crossbeam-channel 0.5.7", "slog", "take_mut", "thread_local", @@ -5831,7 +6111,7 @@ dependencies = [ "slog", "term", "thread_local", - "time 0.3.15", + "time 0.3.20", ] [[package]] @@ -5842,7 +6122,7 @@ checksum = "a945ec7f7ce853e89ffa36be1e27dce9a43e82ff9093bf3461c30d5da74ed11b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -5864,12 +6144,12 @@ dependencies = [ [[package]] name = "snafu" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5177903bf45656592d9eb5c0e22f408fc023aae51dbe2088889b71633ba451f2" +checksum = "cb0656e7e3ffb70f6c39b3c2a86332bb74aa3c679da781642590f3c1118c5045" dependencies = [ "doc-comment", - "snafu-derive 0.7.1", + "snafu-derive 0.7.4", ] [[package]] @@ -5880,19 +6160,19 @@ checksum = "1508efa03c362e23817f96cde18abed596a25219a8b2c66e8db33c03543d315b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "snafu-derive" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "410b26ed97440d90ced3e2488c868d56a86e2064f5d7d6f417909b286afe25e5" +checksum = "475b3bbe5245c26f2d8a6f62d67c1f30eb9fffeccee721c45d162c3ebbdf81b2" dependencies = [ - "heck 0.4.0", + "heck 0.4.1", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -5913,9 +6193,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -5933,11 +6213,20 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + [[package]] name = "sql" version = "1.1.0" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", "async-trait", "catalog", "ceresdbproto 1.0.1 (git+https://github.com/CeresDB/ceresdbproto.git?rev=1c3bf4e803ef8b7a1fbc8c3d4a07fdd372e1830b)", @@ -5949,14 +6238,15 @@ dependencies = [ "datafusion-proto", "df_operator", "hashbrown 0.12.3", - "influxql-logical-planner", - "influxql-parser", + "influxdb_influxql_parser", + "iox_query_influxql", "itertools", "lazy_static", "log", - "paste 1.0.8", + "paste 1.0.12", "regex", "regex-syntax", + "schema", "snafu 0.6.10", "sqlparser", "table_engine", @@ -5965,25 +6255,25 @@ dependencies = [ [[package]] name = "sqlness" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc90b1d2e46d618148d3118ec25c3cb4c18563fef8589095fc21389952c54864" +checksum = "3f7a08af9e6ba9c662aae5f586b62fe8b23ef87f5a4c7a0c627af05cc6646667" dependencies = [ "async-trait", "derive_builder", "prettydiff", + "regex", "serde", "thiserror", - "tokio", - "toml 0.5.9", + "toml 0.5.11", "walkdir", ] [[package]] name = "sqlparser" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db67dc6ef36edb658196c3fef0464a80b53dbbc194a904e81f9bd4190f9ecc5b" +checksum = "0366f270dbabb5cc2e4c88427dc4c08bba144f81e32fbd459a013f26a4d16aa0" dependencies = [ "log", "serde", @@ -5998,7 +6288,7 @@ checksum = "55fe75cb4a364c7f7ae06c7dbbc8d84bddd85d6cdf9975963c3935bc1991761e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -6036,9 +6326,9 @@ dependencies = [ [[package]] name = "streaming-iterator" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4817bfdf8f0b576330b83b55bed0ec89204aa7da62c2fa11fad2119f33a70014" +checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520" [[package]] name = "strsim" @@ -6073,7 +6363,7 @@ dependencies = [ "proc-macro-error 1.0.4", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -6088,11 +6378,11 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck 0.4.0", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.109", ] [[package]] @@ -6145,6 +6435,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79d9531f94112cfc3e4c8f5f02cb2b58f72c97b7efd85f70203cc6d8efda5927" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn-mid" version = "0.5.3" @@ -6153,26 +6454,26 @@ checksum = "baa8e7560a164edb1621a55d18a0c59abf49d360f47aa7b821061dd7eea7fac9" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "sync_wrapper" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "system_catalog" version = "1.1.0" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", "async-trait", "catalog", "ceresdbproto 1.0.1 (git+https://github.com/CeresDB/ceresdbproto.git?rev=1c3bf4e803ef8b7a1fbc8c3d4a07fdd372e1830b)", "common_types", "common_util", - "futures 0.3.25", + "futures 0.3.28", "log", "prost", "snafu 0.6.10", @@ -6185,7 +6486,7 @@ dependencies = [ name = "table_engine" version = "1.1.0" dependencies = [ - "arrow 32.0.0", + "arrow 34.0.0", "arrow_ext", "async-trait", "ceresdbproto 1.0.1 (git+https://github.com/CeresDB/ceresdbproto.git?rev=1c3bf4e803ef8b7a1fbc8c3d4a07fdd372e1830b)", @@ -6196,7 +6497,7 @@ dependencies = [ "datafusion-proto", "df_operator", "env_logger", - "futures 0.3.25", + "futures 0.3.28", "itertools", "log", "prost", @@ -6239,16 +6540,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.3.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" dependencies = [ "cfg-if 1.0.0", "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.45.0", ] [[package]] @@ -6264,9 +6564,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] @@ -6288,30 +6588,31 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.12", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if 1.0.0", "once_cell", ] @@ -6350,32 +6651,42 @@ dependencies = [ [[package]] name = "time" -version = "0.1.45" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "wasi 0.10.0+wasi-snapshot-preview1", "winapi", ] [[package]] name = "time" -version = "0.3.15" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" dependencies = [ - "itoa 1.0.3", + "itoa", "libc", "num_threads", + "serde", + "time-core", "time-macros", ] +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + [[package]] name = "time-macros" -version = "0.2.4" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +dependencies = [ + "time-core", +] [[package]] name = "tiny-keccak" @@ -6407,20 +6718,19 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.25.0" +version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" dependencies = [ "autocfg 1.1.0", "bytes 1.4.0", "libc", - "memchr", "mio", "num_cpus", "parking_lot 0.12.1", @@ -6428,7 +6738,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -6465,13 +6775,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.12", ] [[package]] @@ -6487,9 +6797,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.9" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" dependencies = [ "futures-core", "pin-project-lite", @@ -6523,9 +6833,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" dependencies = [ "bytes 1.4.0", "futures-core", @@ -6537,9 +6847,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] @@ -6567,9 +6877,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.7" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc18466501acd8ac6a3f615dd29a3438f8ca6bb3b19537138b3106e575621274" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" dependencies = [ "indexmap", "serde", @@ -6580,14 +6890,14 @@ dependencies = [ [[package]] name = "tonic" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cd56bdb54ef93935a6a79dbd1d91f1ebd4c64150fd61654031fd6b8b775c91" +checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.13.0", + "base64 0.13.1", "bytes 1.4.0", "futures-core", "futures-util", @@ -6612,15 +6922,15 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.8.0" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fbcd2800e34e743b9ae795867d5f77b535d3a3be69fd731e39145719752df8c" +checksum = "5bf5e9b9c0f7e0a7c027dcfaba7b2c60816c7049171f679d99ee2ff65d0de8c4" dependencies = [ "prettyplease", "proc-macro2", "prost-build", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -6633,7 +6943,7 @@ dependencies = [ "common_types", "common_util", "env_logger", - "futures 0.3.25", + "futures 0.3.28", "object_store 1.1.0", "parquet", "parquet_ext", @@ -6661,30 +6971,11 @@ dependencies = [ "tracing", ] -[[package]] -name = "tower-http" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" -dependencies = [ - "bitflags", - "bytes 1.4.0", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", -] - [[package]] name = "tower-layer" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-service" @@ -6705,7 +6996,7 @@ version = "1.1.0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -6717,9 +7008,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "log", @@ -6735,26 +7026,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9965507e507f12c8901432a33e31131222abac31edd90cabbcf85cf544b7127a" dependencies = [ "chrono", - "crossbeam-channel 0.5.6", + "crossbeam-channel 0.5.7", "tracing-subscriber", ] [[package]] name = "tracing-attributes" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", "valuable", @@ -6832,9 +7123,9 @@ checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db" [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" @@ -6842,7 +7133,7 @@ version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "byteorder", "bytes 1.4.0", "http", @@ -6877,9 +7168,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicase" @@ -6892,36 +7183,36 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "untrusted" @@ -6931,13 +7222,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", ] @@ -6959,7 +7249,7 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.8", "rand 0.8.5", "uuid-macro-internal", ] @@ -6972,7 +7262,7 @@ checksum = "c1b300a878652a387d2a0de915bdae8f1a548f0c6d45e072fe2688794b656cc9" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -6995,9 +7285,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "vergen" -version = "7.3.2" +version = "7.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbc4fafd30514504c7593cfa52eaf4d6c4ef660386e2ec54edc17f14aa08e8d" +checksum = "f21b881cd6636ece9735721cf03c1fe1e774fe258683d084bb2812ab67435749" dependencies = [ "anyhow", "cfg-if 1.0.0", @@ -7007,7 +7297,7 @@ dependencies = [ "rustc_version 0.4.0", "rustversion", "thiserror", - "time 0.3.15", + "time 0.3.20", ] [[package]] @@ -7038,7 +7328,7 @@ dependencies = [ "common_types", "common_util", "env_logger", - "futures 0.3.25", + "futures 0.3.28", "log", "message_queue", "prost", @@ -7056,12 +7346,11 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -7114,9 +7403,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasi" @@ -7126,9 +7415,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.82" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -7136,24 +7425,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.82" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.32" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -7163,9 +7452,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.82" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7173,28 +7462,41 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.82" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.82" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" + +[[package]] +name = "wasm-streams" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] [[package]] name = "web-sys" -version = "0.3.59" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -7219,24 +7521,15 @@ dependencies = [ "webpki", ] -[[package]] -name = "wepoll-ffi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" -dependencies = [ - "cc", -] - [[package]] name = "which" -version = "4.2.5" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ "either", - "lazy_static", "libc", + "once_cell", ] [[package]] @@ -7271,16 +7564,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-sys" -version = "0.36.1" +name = "windows" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "2649ff315bee4c98757f15dac226efe3d81927adbb6e882084bb1ee3e0c330a7" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows-targets 0.47.0", ] [[package]] @@ -7289,92 +7578,143 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f8996d3f43b4b2d44327cd71b7b0efd1284ab60e6e9d0e8b630e18555d87d3e" +dependencies = [ + "windows_aarch64_gnullvm 0.47.0", + "windows_aarch64_msvc 0.47.0", + "windows_i686_gnu 0.47.0", + "windows_i686_msvc 0.47.0", + "windows_x86_64_gnu 0.47.0", + "windows_x86_64_gnullvm 0.47.0", + "windows_x86_64_msvc 0.47.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "831d567d53d4f3cb1db332b68e6e2b6260228eb4d99a777d8b2e8ed794027c90" [[package]] name = "windows_aarch64_msvc" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "6a42d54a417c60ce4f0e31661eed628f0fa5aca73448c093ec4d45fab4c51cdf" [[package]] name = "windows_i686_gnu" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "c1925beafdbb22201a53a483db861a5644123157c1c3cee83323a2ed565d71e3" [[package]] name = "windows_i686_msvc" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "3a8ef8f2f1711b223947d9b69b596cf5a4e452c930fb58b6fc3fdae7d0ec6b31" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "7acaa0c2cf0d2ef99b61c308a0c3dbae430a51b7345dedec470bd8f53f5a3642" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "e5a0628f71be1d11e17ca4a0e9e15b3a5180f6fbf1c2d55e3ba3f850378052c1" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "9d6e62c256dc6d40b8c8707df17df8d774e60e39db723675241e7c15e910bce7" [[package]] name = "winnow" -version = "0.3.6" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d020b441f92996c80d94ae9166e8501e59c7bb56121189dc9eab3bd8216966" +checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" dependencies = [ "memchr", ] @@ -7390,9 +7730,9 @@ dependencies = [ [[package]] name = "wyz" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ "tap", ] @@ -7424,7 +7764,7 @@ dependencies = [ "fail", "lazy_static", "num_cpus", - "parking_lot_core 0.8.5", + "parking_lot_core 0.8.6", "prometheus 0.10.0", "rand 0.7.3", ] @@ -7440,11 +7780,11 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.1+zstd.1.5.2" +version = "0.12.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c947d2adc84ff9a59f2e3c03b81aa4128acf28d6ad7d56273f7e8af14e47bea" +checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" dependencies = [ - "zstd-safe 6.0.2+zstd.1.5.2", + "zstd-safe 6.0.4+zstd.1.5.4", ] [[package]] @@ -7459,9 +7799,9 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.2+zstd.1.5.2" +version = "6.0.4+zstd.1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cf39f730b440bab43da8fb5faf5f254574462f73f260f85f7987f32154ff17" +checksum = "7afb4b54b8910cf5447638cb54bf4e8a65cbedd783af98b98c62ffe91f185543" dependencies = [ "libc", "zstd-sys", @@ -7469,10 +7809,11 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.1+zstd.1.5.2" +version = "2.0.7+zstd.1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" +checksum = "94509c3ba2fe55294d752b79842c530ccfab760192521df74a081a78d2b3c7f5" dependencies = [ "cc", "libc", + "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index e4cd6639a4..57e10abe42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,8 +54,8 @@ name = "ceresdb-server" path = "src/bin/ceresdb-server.rs" [workspace.dependencies] -arrow = { version = "32.0.0", features = ["prettyprint"] } -arrow_ipc = { version = "32.0.0" } +arrow = { version = "34.0.0", features = ["prettyprint"] } +arrow_ipc = { version = "34.0.0" } arrow_ext = { path = "components/arrow_ext" } analytic_engine = { path = "analytic_engine" } arena = { path = "components/arena" } @@ -73,10 +73,10 @@ cluster = { path = "cluster" } criterion = "0.3" common_types = { path = "common_types" } common_util = { path = "common_util" } -datafusion = "18.0.0" -datafusion-expr = "18.0.0" -datafusion-optimizer = "18.0.0" -datafusion-proto = "18.0.0" +datafusion = { git = "https://github.com/apache/arrow-datafusion.git", rev = "26e1b20ea3362ea62cb713004a0636b8af6a16d7" } +datafusion-expr = { git = "https://github.com/apache/arrow-datafusion.git", rev = "26e1b20ea3362ea62cb713004a0636b8af6a16d7" } +datafusion-optimizer = { git = "https://github.com/apache/arrow-datafusion.git", rev = "26e1b20ea3362ea62cb713004a0636b8af6a16d7" } +datafusion-proto = { git = "https://github.com/apache/arrow-datafusion.git", rev = "26e1b20ea3362ea62cb713004a0636b8af6a16d7" } df_operator = { path = "df_operator" } env_logger = "0.6" futures = "0.3" @@ -92,7 +92,7 @@ itertools = "0.10.5" meta_client = { path = "meta_client" } object_store = { path = "components/object_store" } parquet_ext = { path = "components/parquet_ext" } -parquet = { version = "32.0.0" } +parquet = { version = "34.0.0" } paste = "1.0" pin-project-lite = "0.2.8" profile = { path = "components/profile" } @@ -110,8 +110,9 @@ serde_json = "1.0.60" server = { path = "server" } smallvec = "1.6" slog = "2.7" +spin = "0.9.6" sql = { path = "sql" } -sqlparser = { version = "0.30", features = ["serde"] } +sqlparser = { version = "0.32", features = ["serde"] } system_catalog = { path = "system_catalog" } table_engine = { path = "table_engine" } table_kv = { path = "components/table_kv" } diff --git a/Makefile b/Makefile index 65fca8e929..b7afa7b805 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ SHELL = /bin/bash DIR=$(shell pwd) +.DEFAULT_GOAL := integration-test + init: echo "init" echo "Git branch: $GITBRANCH" diff --git a/common_types/src/time.rs b/common_types/src/time.rs index e785316ef5..9374834cb9 100644 --- a/common_types/src/time.rs +++ b/common_types/src/time.rs @@ -152,7 +152,7 @@ impl From<&i64> for Timestamp { /// /// The start time is inclusive and the end time is exclusive: [start, end). /// The range is empty if start equals end. -#[derive(Default, Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Default, Debug, Clone, Copy, Hash, PartialEq, Eq)] pub struct TimeRange { /// The start timestamp (inclusive) inclusive_start: Timestamp, diff --git a/common_util/src/lib.rs b/common_util/src/lib.rs index c46d0738f6..71ea431b7c 100644 --- a/common_util/src/lib.rs +++ b/common_util/src/lib.rs @@ -18,6 +18,7 @@ pub mod partitioned_lock; pub mod record_batch; pub mod runtime; pub mod time; +pub mod timed_task; pub mod toml; #[cfg(any(test, feature = "test"))] diff --git a/common_util/src/macros.rs b/common_util/src/macros.rs index 5ac5b6f1c8..343bd1fee1 100644 --- a/common_util/src/macros.rs +++ b/common_util/src/macros.rs @@ -10,6 +10,19 @@ macro_rules! define_result { }; } +#[macro_export] +macro_rules! hash_map( + { $($key:expr => $value:expr),+ } => { + { + let mut m = ::std::collections::HashMap::new(); + $( + m.insert($key, $value); + )+ + m + } + }; +); + #[cfg(test)] mod tests { #[test] @@ -22,4 +35,13 @@ mod tests { assert_eq!(Err(18), return_i32_error()); } + + #[test] + fn test_hash_map() { + let m = hash_map! { 1 => "hello", 2 => "world" }; + + assert_eq!(2, m.len()); + assert_eq!("hello", *m.get(&1).unwrap()); + assert_eq!("world", *m.get(&2).unwrap()); + } } diff --git a/wal/src/table_kv_impl/timed_task.rs b/common_util/src/timed_task.rs similarity index 95% rename from wal/src/table_kv_impl/timed_task.rs rename to common_util/src/timed_task.rs index 9fc835e867..580e222f43 100644 --- a/wal/src/table_kv_impl/timed_task.rs +++ b/common_util/src/timed_task.rs @@ -4,7 +4,6 @@ use std::{future::Future, time::Duration}; -use common_util::runtime::{JoinHandle, Runtime}; use log::info; use tokio::{ sync::{ @@ -14,6 +13,8 @@ use tokio::{ time, }; +use crate::runtime::{JoinHandle, Runtime}; + /// A task to run periodically. pub struct TimedTask { name: String, @@ -78,7 +79,7 @@ pub struct TaskHandle { impl TaskHandle { /// Explicit stop the task and wait util the task exits. - pub async fn stop_task(&self) -> std::result::Result<(), common_util::runtime::Error> { + pub async fn stop_task(&self) -> std::result::Result<(), crate::runtime::Error> { self.notify_exit(); let handle = self.handle.lock().await.take(); @@ -109,9 +110,8 @@ mod tests { Arc, }; - use common_util::runtime::Builder; - use super::*; + use crate::runtime::Builder; #[test] fn test_timed_task() { diff --git a/components/parquet_ext/src/prune/min_max.rs b/components/parquet_ext/src/prune/min_max.rs index 6695e3ac05..ccd27e3e97 100644 --- a/components/parquet_ext/src/prune/min_max.rs +++ b/components/parquet_ext/src/prune/min_max.rs @@ -4,7 +4,11 @@ use std::sync::Arc; use arrow::{array::ArrayRef, datatypes::Schema as ArrowSchema}; use datafusion::{ + common::ToDFSchema, + error::Result as DataFusionResult, + physical_expr::{create_physical_expr, execution_props::ExecutionProps}, physical_optimizer::pruning::{PruningPredicate, PruningStatistics}, + physical_plan::PhysicalExpr, prelude::{Column, Expr}, scalar::ScalarValue, }; @@ -40,9 +44,10 @@ fn filter_row_groups_inner( row_groups: &[RowGroupMetaData], ) -> Vec { let mut results = vec![true; row_groups.len()]; - // let arrow_schema: SchemaRef = schema.clone().into_arrow_schema_ref(); for expr in exprs { - match PruningPredicate::try_new(expr.clone(), schema.clone()) { + match logical2physical(expr, &schema) + .and_then(|physical_expr| PruningPredicate::try_new(physical_expr, schema.clone())) + { Ok(pruning_predicate) => { trace!("pruning_predicate is:{:?}", pruning_predicate); @@ -66,6 +71,14 @@ fn filter_row_groups_inner( results } +fn logical2physical(expr: &Expr, schema: &ArrowSchema) -> DataFusionResult> { + schema.clone().to_dfschema().and_then(|df_schema| { + // TODO: props should be an argument + let execution_props = ExecutionProps::new(); + create_physical_expr(expr, &df_schema, schema, &execution_props) + }) +} + fn build_row_group_predicate( predicate_builder: &PruningPredicate, row_group_metadata: &[RowGroupMetaData], diff --git a/integration_tests/Makefile b/integration_tests/Makefile index b48ac49ebc..43cdb60b87 100644 --- a/integration_tests/Makefile +++ b/integration_tests/Makefile @@ -55,3 +55,6 @@ run-go: run-rust: cd sdk/rust && cargo run + +run-mysql: + cd mysql && ./basic.sh diff --git a/integration_tests/cases/common/dml/issue-59.result b/integration_tests/cases/common/dml/issue-59.result index 624b5bb33a..131e8c13a5 100644 --- a/integration_tests/cases/common/dml/issue-59.result +++ b/integration_tests/cases/common/dml/issue-59.result @@ -24,8 +24,8 @@ FROM issue59 GROUP BY id+1; plan_type,plan, -String("logical_plan"),String("Projection: issue59.id + Int64(1), COUNT(DISTINCT issue59.account)\n Projection: group_alias_0 AS issue59.id + Int64(1), COUNT(alias1) AS COUNT(DISTINCT issue59.account)\n Aggregate: groupBy=[[group_alias_0]], aggr=[[COUNT(alias1)]]\n Aggregate: groupBy=[[CAST(issue59.id AS Int64) + Int64(1) AS group_alias_0, issue59.account AS alias1]], aggr=[[]]\n TableScan: issue59 projection=[id, account]"), -String("physical_plan"),String("ProjectionExec: expr=[issue59.id + Int64(1)@0 as issue59.id + Int64(1), COUNT(DISTINCT issue59.account)@1 as COUNT(DISTINCT issue59.account)]\n ProjectionExec: expr=[group_alias_0@0 as issue59.id + Int64(1), COUNT(alias1)@1 as COUNT(DISTINCT issue59.account)]\n AggregateExec: mode=FinalPartitioned, gby=[group_alias_0@0 as group_alias_0], aggr=[COUNT(alias1)]\n CoalesceBatchesExec: target_batch_size=8192\n RepartitionExec: partitioning=Hash([Column { name: \"group_alias_0\", index: 0 }], 8), input_partitions=8\n AggregateExec: mode=Partial, gby=[group_alias_0@0 as group_alias_0], aggr=[COUNT(alias1)]\n AggregateExec: mode=FinalPartitioned, gby=[group_alias_0@0 as group_alias_0, alias1@1 as alias1], aggr=[]\n CoalesceBatchesExec: target_batch_size=8192\n RepartitionExec: partitioning=Hash([Column { name: \"group_alias_0\", index: 0 }, Column { name: \"alias1\", index: 1 }], 8), input_partitions=8\n AggregateExec: mode=Partial, gby=[CAST(id@0 AS Int64) + 1 as group_alias_0, account@1 as alias1], aggr=[]\n ScanTable: table=issue59, parallelism=8, order=None, \n"), +String("logical_plan"),String("Projection: group_alias_0 AS issue59.id + Int64(1), COUNT(alias1) AS COUNT(DISTINCT issue59.account)\n Aggregate: groupBy=[[group_alias_0]], aggr=[[COUNT(alias1)]]\n Projection: group_alias_0, alias1\n Aggregate: groupBy=[[CAST(issue59.id AS Int64) + Int64(1) AS group_alias_0, issue59.account AS alias1]], aggr=[[]]\n Projection: issue59.id, issue59.account\n TableScan: issue59 projection=[id, account]"), +String("physical_plan"),String("ProjectionExec: expr=[group_alias_0@0 as issue59.id + Int64(1), COUNT(alias1)@1 as COUNT(DISTINCT issue59.account)]\n AggregateExec: mode=FinalPartitioned, gby=[group_alias_0@0 as group_alias_0], aggr=[COUNT(alias1)]\n CoalesceBatchesExec: target_batch_size=8192\n RepartitionExec: partitioning=Hash([Column { name: \"group_alias_0\", index: 0 }], 8), input_partitions=8\n AggregateExec: mode=Partial, gby=[group_alias_0@0 as group_alias_0], aggr=[COUNT(alias1)]\n ProjectionExec: expr=[group_alias_0@0 as group_alias_0, alias1@1 as alias1]\n AggregateExec: mode=FinalPartitioned, gby=[group_alias_0@0 as group_alias_0, alias1@1 as alias1], aggr=[]\n CoalesceBatchesExec: target_batch_size=8192\n RepartitionExec: partitioning=Hash([Column { name: \"group_alias_0\", index: 0 }, Column { name: \"alias1\", index: 1 }], 8), input_partitions=8\n AggregateExec: mode=Partial, gby=[CAST(id@0 AS Int64) + 1 as group_alias_0, account@1 as alias1], aggr=[]\n ProjectionExec: expr=[id@0 as id, account@1 as account]\n ScanTable: table=issue59, parallelism=8, order=None, \n"), DROP TABLE IF EXISTS issue59; diff --git a/integration_tests/cases/common/dummy/select_1.result b/integration_tests/cases/common/dummy/select_1.result index efda875069..b5e3c3069a 100644 --- a/integration_tests/cases/common/dummy/select_1.result +++ b/integration_tests/cases/common/dummy/select_1.result @@ -6,7 +6,7 @@ Int64(1), SELECT x; -Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query: SELECT x;. Caused by: Failed to create plan, err:Failed to generate datafusion plan, err:Schema error: No field named 'x'." }) +Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to create plan, query: SELECT x;. Caused by: Failed to create plan, err:Failed to generate datafusion plan, err:Schema error: No field named \"x\"." }) SELECT 'a'; diff --git a/integration_tests/cases/common/optimizer/optimizer.result b/integration_tests/cases/common/optimizer/optimizer.result index 81a1c18054..156a0c258c 100644 --- a/integration_tests/cases/common/optimizer/optimizer.result +++ b/integration_tests/cases/common/optimizer/optimizer.result @@ -9,8 +9,8 @@ affected_rows: 0 EXPLAIN SELECT max(value) AS c1, avg(value) AS c2 FROM `07_optimizer_t` GROUP BY name; plan_type,plan, -String("logical_plan"),String("Projection: MAX(07_optimizer_t.value) AS c1, AVG(07_optimizer_t.value) AS c2\n Aggregate: groupBy=[[07_optimizer_t.name]], aggr=[[MAX(07_optimizer_t.value), AVG(07_optimizer_t.value)]]\n TableScan: 07_optimizer_t projection=[name, value]"), -String("physical_plan"),String("ProjectionExec: expr=[MAX(07_optimizer_t.value)@1 as c1, AVG(07_optimizer_t.value)@2 as c2]\n AggregateExec: mode=FinalPartitioned, gby=[name@0 as name], aggr=[MAX(07_optimizer_t.value), AVG(07_optimizer_t.value)]\n CoalesceBatchesExec: target_batch_size=8192\n RepartitionExec: partitioning=Hash([Column { name: \"name\", index: 0 }], 8), input_partitions=8\n AggregateExec: mode=Partial, gby=[name@0 as name], aggr=[MAX(07_optimizer_t.value), AVG(07_optimizer_t.value)]\n ScanTable: table=07_optimizer_t, parallelism=8, order=None, \n"), +String("logical_plan"),String("Projection: MAX(07_optimizer_t.value) AS c1, AVG(07_optimizer_t.value) AS c2\n Aggregate: groupBy=[[07_optimizer_t.name]], aggr=[[MAX(07_optimizer_t.value), AVG(07_optimizer_t.value)]]\n Projection: 07_optimizer_t.name, 07_optimizer_t.value\n TableScan: 07_optimizer_t projection=[name, value]"), +String("physical_plan"),String("ProjectionExec: expr=[MAX(07_optimizer_t.value)@1 as c1, AVG(07_optimizer_t.value)@2 as c2]\n AggregateExec: mode=FinalPartitioned, gby=[name@0 as name], aggr=[MAX(07_optimizer_t.value), AVG(07_optimizer_t.value)]\n CoalesceBatchesExec: target_batch_size=8192\n RepartitionExec: partitioning=Hash([Column { name: \"name\", index: 0 }], 8), input_partitions=8\n AggregateExec: mode=Partial, gby=[name@0 as name], aggr=[MAX(07_optimizer_t.value), AVG(07_optimizer_t.value)]\n ProjectionExec: expr=[name@0 as name, value@1 as value]\n ScanTable: table=07_optimizer_t, parallelism=8, order=None, \n"), DROP TABLE `07_optimizer_t`; diff --git a/integration_tests/cases/env/local/influxql/basic.result b/integration_tests/cases/env/local/influxql/basic.result index dc956edfef..bbe51e2012 100644 --- a/integration_tests/cases/env/local/influxql/basic.result +++ b/integration_tests/cases/env/local/influxql/basic.result @@ -27,12 +27,12 @@ affected_rows: 6 -- SQLNESS ARG protocol=influxql SELECT * FROM "h2o_feet"; -{"results":[{"statement_id":0,"series":[{"name":"h2o_feet","columns":["time","level_description","location","water_level"],"values":[[1439827200000,"below 3 feet","santa_monica",2.064],[1439827200000,"between 6 and 9 feet","coyote_creek",8.12],[1439827560000,"below 3 feet","santa_monica",2.116],[1439827560000,"between 6 and 9 feet","coyote_creek",8.005],[1439827620000,"below 3 feet","santa_monica",2.028],[1439827620000,"between 6 and 9 feet","coyote_creek",7.887]]}]}]} +{"results":[{"statement_id":0,"series":[{"name":"h2o_feet","columns":["time","level_description","location","tsid","water_level"],"values":[[1439827200000,"below 3 feet","santa_monica",8247797837995683878,2.064],[1439827200000,"between 6 and 9 feet","coyote_creek",4483051411356144610,8.12],[1439827560000,"below 3 feet","santa_monica",8247797837995683878,2.116],[1439827560000,"between 6 and 9 feet","coyote_creek",4483051411356144610,8.005],[1439827620000,"below 3 feet","santa_monica",8247797837995683878,2.028],[1439827620000,"between 6 and 9 feet","coyote_creek",4483051411356144610,7.887]]}]}]} -- SQLNESS ARG protocol=influxql method=get SELECT * FROM "h2o_feet"; -{"results":[{"statement_id":0,"series":[{"name":"h2o_feet","columns":["time","level_description","location","water_level"],"values":[[1439827200000,"below 3 feet","santa_monica",2.064],[1439827200000,"between 6 and 9 feet","coyote_creek",8.12],[1439827560000,"below 3 feet","santa_monica",2.116],[1439827560000,"between 6 and 9 feet","coyote_creek",8.005],[1439827620000,"below 3 feet","santa_monica",2.028],[1439827620000,"between 6 and 9 feet","coyote_creek",7.887]]}]}]} +{"results":[{"statement_id":0,"series":[{"name":"h2o_feet","columns":["time","level_description","location","tsid","water_level"],"values":[[1439827200000,"below 3 feet","santa_monica",8247797837995683878,2.064],[1439827200000,"between 6 and 9 feet","coyote_creek",4483051411356144610,8.12],[1439827560000,"below 3 feet","santa_monica",8247797837995683878,2.116],[1439827560000,"between 6 and 9 feet","coyote_creek",4483051411356144610,8.005],[1439827620000,"below 3 feet","santa_monica",8247797837995683878,2.028],[1439827620000,"between 6 and 9 feet","coyote_creek",4483051411356144610,7.887]]}]}]} -- SQLNESS ARG protocol=influxql SELECT "level_description", location, water_level FROM "h2o_feet" where location = 'santa_monica'; @@ -44,6 +44,18 @@ show measurements; {"results":[{"statement_id":0,"series":[{"name":"measurements","columns":["name"],"values":[["h2o_feet"]]}]}]} +-- SQLNESS ARG protocol=influxql +SELECT count(water_level) FROM "h2o_feet" +group by location; + +{"results":[{"statement_id":0,"series":[{"name":"h2o_feet","columns":["time","location","count"],"values":[[0,"coyote_creek",3],[0,"santa_monica",3]]}]}]} + +-- SQLNESS ARG protocol=influxql +SELECT count(water_level) FROM "h2o_feet" +group by time(5m), location; + +{"code":500,"message":"UNKNOWN_ERROR: Rejection(InfluxDbHandlerWithCause { msg: \"failed to query by influxql\", source: CreatePlan { query: \" SELECT count(water_level) FROM \\\"h2o_feet\\\" \\n group by time(5m), location;\", source: CreatePlan { source: BuildInfluxqlPlan { source: BuildPlanWithCause { msg: \"planner stmt to plan\", source: NotImplemented(\"FILL(NULL)\") } } } } })"} + DROP TABLE IF EXISTS `h2o_feet`; affected_rows: 0 diff --git a/integration_tests/cases/env/local/influxql/basic.sql b/integration_tests/cases/env/local/influxql/basic.sql index a089bb4abb..5ec54708f1 100644 --- a/integration_tests/cases/env/local/influxql/basic.sql +++ b/integration_tests/cases/env/local/influxql/basic.sql @@ -38,4 +38,12 @@ SELECT "level_description", location, water_level FROM "h2o_feet" where location -- SQLNESS ARG protocol=influxql show measurements; +-- SQLNESS ARG protocol=influxql +SELECT count(water_level) FROM "h2o_feet" +group by location; + +-- SQLNESS ARG protocol=influxql +SELECT count(water_level) FROM "h2o_feet" +group by time(5m), location; + DROP TABLE IF EXISTS `h2o_feet`; diff --git a/integration_tests/mysql/basic.sh b/integration_tests/mysql/basic.sh new file mode 100755 index 0000000000..e4ef13e963 --- /dev/null +++ b/integration_tests/mysql/basic.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# This only ensure query by mysql protocol is OK, +# Full SQL test in ensured by sqlness tests. +mysql -h 127.0.0.1 -P 3307 -e 'show tables' + +mysql -h 127.0.0.1 -P 3307 -e 'select 1, now()' diff --git a/interpreters/src/show.rs b/interpreters/src/show.rs index 932989b434..4586a5f1d4 100644 --- a/interpreters/src/show.rs +++ b/interpreters/src/show.rs @@ -145,7 +145,7 @@ impl ShowInterpreter { QueryType::InfluxQL => { // TODO: refactor those constants let schema = DataSchema::new(vec![ - Field::new("ceresdb::measurement", DataType::Utf8, false), + Field::new("iox::measurement", DataType::Utf8, false), Field::new("name", DataType::Utf8, false), ]); diff --git a/interpreters/src/tests.rs b/interpreters/src/tests.rs index 3808d6da12..59408728e8 100644 --- a/interpreters/src/tests.rs +++ b/interpreters/src/tests.rs @@ -139,8 +139,8 @@ where "+------------+---------------------+--------+--------+------------+--------------+", "| key1 | key2 | field1 | field2 | field3 | field4 |", "+------------+---------------------+--------+--------+------------+--------------+", - "| 7461676b | 2021-12-02T07:00:34 | 100 | hello3 | 2022-10-10 | 10:10:10.234 |", - "| 7461676b32 | 2021-12-02T07:00:34 | 100 | hello3 | 2022-10-11 | 11:10:10.234 |", + "| 7461676b | 2021-12-02T07:00:34 | 100.0 | hello3 | 2022-10-10 | 10:10:10.234 |", + "| 7461676b32 | 2021-12-02T07:00:34 | 100.0 | hello3 | 2022-10-11 | 11:10:10.234 |", "+------------+---------------------+--------+--------+------------+--------------+", ]; common_util::record_batch::assert_record_batches_eq(&expected, records); diff --git a/query_engine/src/context.rs b/query_engine/src/context.rs index 52cb4e19fa..2bf1110fbd 100644 --- a/query_engine/src/context.rs +++ b/query_engine/src/context.rs @@ -57,7 +57,7 @@ impl Context { ) .with_target_partitions(config.read_parallelism); df_session_config - .config_options_mut() + .options_mut() .extensions .insert(ceresdb_options); diff --git a/query_engine/src/df_planner_extension/table_scan_by_primary_key.rs b/query_engine/src/df_planner_extension/table_scan_by_primary_key.rs index 2ccdba8f06..f4a4fdf8be 100644 --- a/query_engine/src/df_planner_extension/table_scan_by_primary_key.rs +++ b/query_engine/src/df_planner_extension/table_scan_by_primary_key.rs @@ -3,6 +3,7 @@ use std::{ any::Any, fmt::{Debug, Formatter}, + hash::{Hash, Hasher}, sync::Arc, }; @@ -50,7 +51,7 @@ impl ExtensionPlanner for Planner { /// It differs from the default [`TableScan`] in its corresponding /// [`ExecutionPlan`] is a special [`ScanTable`] which can controls the scan /// order. -#[derive(Clone)] +#[derive(Clone, Hash, PartialEq)] pub struct TableScanByPrimaryKey { asc: bool, scan_plan: Arc, @@ -154,4 +155,20 @@ impl UserDefinedLogicalNode for TableScanByPrimaryKey { scan_plan: self.scan_plan.clone(), }) } + + fn name(&self) -> &str { + "ScanTableInPrimaryKeyOrder" + } + + fn dyn_hash(&self, state: &mut dyn Hasher) { + let mut s = state; + self.hash(&mut s); + } + + fn dyn_eq(&self, other: &dyn UserDefinedLogicalNode) -> bool { + match other.as_any().downcast_ref::() { + Some(o) => self == o, + None => false, + } + } } diff --git a/query_engine/src/logical_optimizer/tests.rs b/query_engine/src/logical_optimizer/tests.rs index 950ec03f5f..ea68160acb 100644 --- a/query_engine/src/logical_optimizer/tests.rs +++ b/query_engine/src/logical_optimizer/tests.rs @@ -136,7 +136,7 @@ impl LogicalPlanNodeBuilder { let projected_schema = self.df_schema_ref(); let plan = LogicalPlan::TableScan(TableScan { - table_name: self.table_name.clone(), + table_name: self.table_name.clone().into(), source: Arc::new(provider), projection: None, projected_schema, diff --git a/query_engine/src/logical_optimizer/type_conversion.rs b/query_engine/src/logical_optimizer/type_conversion.rs index 9389ec6375..c7420c6dff 100644 --- a/query_engine/src/logical_optimizer/type_conversion.rs +++ b/query_engine/src/logical_optimizer/type_conversion.rs @@ -31,6 +31,7 @@ pub struct TypeConversion; impl OptimizerRule for TypeConversion { #[allow(clippy::only_used_in_recursion)] + #[allow(deprecated)] fn try_optimize( &self, plan: &LogicalPlan, @@ -374,13 +375,12 @@ mod tests { Arc::new( DFSchema::new_with_metadata( vec![ - DFField::new(None, "c1", DataType::Utf8, true), - DFField::new(None, "c2", DataType::Int64, true), - DFField::new(None, "c3", DataType::Float64, true), - DFField::new(None, "c4", DataType::Float32, true), - DFField::new(None, "c5", DataType::Boolean, true), - DFField::new( - None, + DFField::new_unqualified("c1", DataType::Utf8, true), + DFField::new_unqualified("c2", DataType::Int64, true), + DFField::new_unqualified("c3", DataType::Float64, true), + DFField::new_unqualified("c4", DataType::Float32, true), + DFField::new_unqualified("c5", DataType::Boolean, true), + DFField::new_unqualified( "c6", DataType::Timestamp(TimeUnit::Millisecond, None), false, diff --git a/server/Cargo.toml b/server/Cargo.toml index c61569ff11..062291b800 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -18,6 +18,7 @@ async-trait = { workspace = true } bytes = { workspace = true } catalog = { workspace = true } ceresdbproto = { workspace = true } +clru = { workspace = true } cluster = { workspace = true } common_types = { workspace = true } common_util = { workspace = true } @@ -44,6 +45,7 @@ router = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } snafu = { workspace = true } +spin = { workspace = true } sql = { workspace = true } system_catalog = { workspace = true } table_engine = { workspace = true } diff --git a/server/src/config.rs b/server/src/config.rs index c6dff8c12d..1d401133a4 100644 --- a/server/src/config.rs +++ b/server/src/config.rs @@ -15,7 +15,10 @@ use router::{ use serde::{Deserialize, Serialize}; use table_engine::ANALYTIC_ENGINE_TYPE; -use crate::{http::DEFAULT_MAX_BODY_SIZE, proxy::forward}; +use crate::{ + http::DEFAULT_MAX_BODY_SIZE, + proxy::{forward, hotspot}, +}; #[derive(Clone, Debug, Default, Deserialize, Serialize)] #[serde(default)] @@ -115,6 +118,9 @@ pub struct ServerConfig { // Config of route pub route_cache: router::RouteCacheConfig, + + /// record hotspot query or write requests + pub hotspot: hotspot::Config, } impl Default for ServerConfig { @@ -132,6 +138,7 @@ impl Default for ServerConfig { auto_create_table: true, default_schema_config: Default::default(), route_cache: router::RouteCacheConfig::default(), + hotspot: hotspot::Config::default(), } } } diff --git a/server/src/context.rs b/server/src/context.rs index 8a3fa25f7e..0d22ce4bc8 100644 --- a/server/src/context.rs +++ b/server/src/context.rs @@ -5,6 +5,7 @@ use std::{sync::Arc, time::Duration}; use common_util::runtime::Runtime; +use router::{Router, RouterRef}; use snafu::{ensure, Backtrace, OptionExt, Snafu}; #[allow(clippy::enum_variant_names)] @@ -18,6 +19,9 @@ pub enum Error { #[snafu(display("Missing runtime.\nBacktrace:\n{}", backtrace))] MissingRuntime { backtrace: Backtrace }, + + #[snafu(display("Missing router.\nBacktrace:\n{}", backtrace))] + MissingRouter { backtrace: Backtrace }, } define_result!(Error); @@ -38,6 +42,8 @@ pub struct RequestContext { pub enable_partition_table_access: bool, /// Request timeout pub timeout: Option, + /// router + pub router: Arc, } impl RequestContext { @@ -53,6 +59,7 @@ pub struct Builder { runtime: Option>, enable_partition_table_access: bool, timeout: Option, + router: Option>, } impl Builder { @@ -81,11 +88,17 @@ impl Builder { self } + pub fn router(mut self, router: RouterRef) -> Self { + self.router = Some(router); + self + } + pub fn build(self) -> Result { ensure!(!self.catalog.is_empty(), MissingCatalog); ensure!(!self.schema.is_empty(), MissingSchema); let runtime = self.runtime.context(MissingRuntime)?; + let router = self.router.context(MissingRouter)?; Ok(RequestContext { catalog: self.catalog, @@ -93,6 +106,7 @@ impl Builder { runtime, enable_partition_table_access: self.enable_partition_table_access, timeout: self.timeout, + router, }) } } diff --git a/server/src/grpc/mod.rs b/server/src/grpc/mod.rs index 26b4c08afc..71d71542d3 100644 --- a/server/src/grpc/mod.rs +++ b/server/src/grpc/mod.rs @@ -37,7 +37,7 @@ use crate::{ storage_service::StorageServiceImpl, }, instance::InstanceRef, - proxy::{forward, Proxy}, + proxy::{forward, hotspot, Proxy}, schema_config_provider::{self, SchemaConfigProviderRef}, }; @@ -215,6 +215,7 @@ pub struct Builder { schema_config_provider: Option, forward_config: Option, auto_create_table: bool, + hotspot_config: Option, } impl Builder { @@ -232,6 +233,7 @@ impl Builder { schema_config_provider: None, forward_config: None, auto_create_table: true, + hotspot_config: None, } } @@ -287,6 +289,11 @@ impl Builder { self } + pub fn hotspot_config(mut self, config: hotspot::Config) -> Self { + self.hotspot_config = Some(config); + self + } + pub fn timeout(mut self, timeout: Option) -> Self { self.timeout = timeout; self @@ -327,7 +334,8 @@ impl Builder { }; let forward_config = self.forward_config.unwrap_or_default(); - let bg_runtime = runtimes.bg_runtime.clone(); + let hotspot_config = self.hotspot_config.unwrap_or_default(); + let runtime = runtimes.bg_runtime.clone(); let proxy = Proxy::try_new( router, instance, @@ -336,6 +344,8 @@ impl Builder { self.resp_compress_min_length, self.auto_create_table, schema_config_provider, + hotspot_config, + runtime.clone(), ) .box_err() .context(Internal { @@ -355,7 +365,7 @@ impl Builder { rpc_server, meta_rpc_server, remote_engine_server, - runtime: bg_runtime, + runtime, stop_tx: None, join_handle: None, }) diff --git a/server/src/grpc/storage_service/mod.rs b/server/src/grpc/storage_service/mod.rs index ab6b8a6591..5e3ce8e31e 100644 --- a/server/src/grpc/storage_service/mod.rs +++ b/server/src/grpc/storage_service/mod.rs @@ -147,6 +147,7 @@ impl StorageServiceImpl { runtime: self.runtimes.read_runtime.clone(), timeout: self.timeout, }; + let join_handle = self .runtimes .read_runtime @@ -176,6 +177,7 @@ impl StorageServiceImpl { runtime: self.runtimes.write_runtime.clone(), timeout: self.timeout, }; + let join_handle = self.runtimes.write_runtime.spawn(async move { if req.context.is_none() { return WriteResponse { diff --git a/server/src/handlers/error.rs b/server/src/handlers/error.rs index a75def41c0..de6d68b339 100644 --- a/server/src/handlers/error.rs +++ b/server/src/handlers/error.rs @@ -78,6 +78,12 @@ pub enum Error { #[snafu(display("InfluxDb handler failed, msg:{}.\nBacktrace:\n{}", msg, backtrace))] InfluxDbHandlerNoCause { msg: String, backtrace: Backtrace }, + + #[snafu(display("Route handler failed, table:{:?}, source:{}", table, source))] + RouteHandler { + table: String, + source: router::Error, + }, } define_result!(Error); diff --git a/server/src/handlers/influxdb.rs b/server/src/handlers/influxdb.rs index 89d44f58e7..a2bda6e7e5 100644 --- a/server/src/handlers/influxdb.rs +++ b/server/src/handlers/influxdb.rs @@ -909,7 +909,7 @@ mod tests { let arrow_schema = schema.to_arrow_schema_ref(); let fields = arrow_schema.fields.to_owned(); let measurement_field = ArrowField::new( - "ceresdb::measurement".to_string(), + CERESDB_MEASUREMENT_COLUMN_NAME.to_string(), schema::DataType::Utf8, false, ); diff --git a/server/src/handlers/mod.rs b/server/src/handlers/mod.rs index cf0f264c67..6f7fe190a9 100644 --- a/server/src/handlers/mod.rs +++ b/server/src/handlers/mod.rs @@ -7,6 +7,7 @@ pub mod error; pub mod influxdb; pub mod prom; pub mod query; +pub mod route; mod prelude { pub use catalog::manager::Manager as CatalogManager; diff --git a/server/src/handlers/query.rs b/server/src/handlers/query.rs index 20dd23c787..a121fab077 100644 --- a/server/src/handlers/query.rs +++ b/server/src/handlers/query.rs @@ -196,7 +196,11 @@ pub async fn handle_query( ); frontend - .influxql_stmt_to_plan(&mut sql_ctx, stmts.remove(0)) + .influxql_stmt_to_plan( + &mut sql_ctx, + stmts.remove(0), + instance.catalog_manager.clone(), + ) .context(CreatePlan { query: &request.query, })? diff --git a/server/src/handlers/route.rs b/server/src/handlers/route.rs new file mode 100644 index 0000000000..a3a179b53e --- /dev/null +++ b/server/src/handlers/route.rs @@ -0,0 +1,51 @@ +// Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0. + +//! route request handler +use ceresdbproto::storage::RouteRequest; +use router::endpoint::Endpoint; + +use crate::handlers::{error::RouteHandler, prelude::*}; + +#[derive(Serialize)] +pub struct RouteResponse { + routes: Vec, +} + +#[derive(Serialize)] +pub struct RouteItem { + pub table: String, + pub endpoint: Option, +} + +pub async fn handle_route( + ctx: &RequestContext, + _: InstanceRef, + table: &str, +) -> Result { + if table.is_empty() { + return Ok(RouteResponse { routes: vec![] }); + } + + let route_req = RouteRequest { + context: Some(ceresdbproto::storage::RequestContext { + database: ctx.schema.clone(), + }), + tables: vec![table.to_string()], + }; + + let routes = ctx.router.route(route_req).await.context(RouteHandler { + table: table.to_string(), + })?; + + let mut route_items = Vec::with_capacity(1); + for route in routes { + route_items.push(RouteItem { + table: route.table, + endpoint: route.endpoint.map(|endpoint| endpoint.into()), + }); + } + + Ok(RouteResponse { + routes: route_items, + }) +} diff --git a/server/src/http.rs b/server/src/http.rs index 975b782761..8528ed761f 100644 --- a/server/src/http.rs +++ b/server/src/http.rs @@ -14,7 +14,7 @@ use logger::RuntimeLevel; use profile::Profiler; use prom_remote_api::{types::RemoteStorageRef, web}; use query_engine::executor::Executor as QueryExecutor; -use router::endpoint::Endpoint; +use router::{endpoint::Endpoint, Router, RouterRef}; use serde::Serialize; use snafu::{Backtrace, OptionExt, ResultExt, Snafu}; use table_engine::{engine::EngineRuntimes, table::FlushRequest}; @@ -105,6 +105,9 @@ pub enum Error { #[snafu(display("Server already started.\nBacktrace:\n{}", backtrace))] AlreadyStarted { backtrace: Backtrace }, + + #[snafu(display("Missing router.\nBacktrace:\n{}", backtrace))] + MissingRouter { backtrace: Backtrace }, } define_result!(Error); @@ -128,6 +131,7 @@ pub struct Service { rx: Option>, config: HttpConfig, config_content: String, + router: Arc, } impl Service { @@ -178,6 +182,7 @@ impl Service { .or(self.sql()) .or(self.influxdb_api()) .or(self.prom_api()) + .or(self.route()) // admin APIs .or(self.admin_block()) // debug APIs @@ -253,6 +258,30 @@ impl Service { }) } + // GET /route + fn route(&self) -> impl Filter + Clone { + warp::path!("route" / String) + .and(warp::get()) + .and(self.with_context()) + .and(self.with_instance()) + .and_then(|table: String, ctx, instance| async move { + let result = handlers::route::handle_route(&ctx, instance, &table) + .await + .map_err(|e| { + error!( + "Http service Failed to find route of table:{}, err:{:?}", + table, e + ); + Box::new(e) + }) + .context(HandleRequest); + match result { + Ok(res) => Ok(reply::json(&res)), + Err(e) => Err(reject::custom(e)), + } + }) + } + /// for write api: /// POST `/influxdb/v1/write` /// @@ -446,6 +475,7 @@ impl Service { //TODO(boyan) use read/write runtime by sql type. let runtime = self.engine_runtimes.bg_runtime.clone(); let timeout = self.config.timeout; + let router = self.router.clone(); header::optional::(consts::CATALOG_HEADER) .and(header::optional::(consts::SCHEMA_HEADER)) @@ -456,6 +486,7 @@ impl Service { let default_catalog = default_catalog.clone(); let runtime = runtime.clone(); let schema = schema.unwrap_or_else(|| default_schema.clone()); + let router = router.clone(); async move { RequestContext::builder() .catalog(catalog.unwrap_or(default_catalog)) @@ -463,6 +494,7 @@ impl Service { .runtime(runtime) .timeout(timeout) .enable_partition_table_access(true) + .router(router) .build() .context(CreateContext) .map_err(reject::custom) @@ -506,6 +538,7 @@ pub struct Builder { instance: Option>, schema_config_provider: Option, config_content: Option, + router: Option, } impl Builder { @@ -517,6 +550,7 @@ impl Builder { instance: None, schema_config_provider: None, config_content: None, + router: None, } } @@ -544,6 +578,11 @@ impl Builder { self.config_content = Some(content); self } + + pub fn router(mut self, router: RouterRef) -> Self { + self.router = Some(router); + self + } } impl Builder { @@ -556,6 +595,7 @@ impl Builder { let schema_config_provider = self .schema_config_provider .context(MissingSchemaConfigProvider)?; + let router = self.router.context(MissingRouter)?; let prom_remote_storage = Arc::new(CeresDBStorage::new( instance.clone(), schema_config_provider.clone(), @@ -574,6 +614,7 @@ impl Builder { rx: Some(rx), config: self.config.clone(), config_content, + router, }; Ok(service) @@ -610,6 +651,7 @@ fn error_to_status_code(err: &Error) -> StatusCode { | Error::JoinAsyncTask { .. } | Error::AlreadyStarted { .. } | Error::HandleUpdateLogLevel { .. } => StatusCode::INTERNAL_SERVER_ERROR, + Error::MissingRouter { .. } => StatusCode::INTERNAL_SERVER_ERROR, } } diff --git a/server/src/mysql/builder.rs b/server/src/mysql/builder.rs index 55db019fa8..61f1265fd7 100644 --- a/server/src/mysql/builder.rs +++ b/server/src/mysql/builder.rs @@ -3,13 +3,14 @@ use std::{net::SocketAddr, sync::Arc, time::Duration}; use query_engine::executor::Executor as QueryExecutor; +use router::RouterRef; use snafu::{OptionExt, ResultExt}; use table_engine::engine::EngineRuntimes; use crate::{ instance::InstanceRef, mysql::{ - error::{MissingInstance, MissingRuntimes, ParseIpAddr, Result}, + error::{MissingInstance, MissingRouter, MissingRuntimes, ParseIpAddr, Result}, service::MysqlService, }, }; @@ -18,6 +19,7 @@ pub struct Builder { config: Config, runtimes: Option>, instance: Option>, + router: Option, } #[derive(Debug)] @@ -33,6 +35,7 @@ impl Builder { config, runtimes: None, instance: None, + router: None, } } @@ -45,18 +48,25 @@ impl Builder { self.instance = Some(instance); self } + + pub fn router(mut self, router: RouterRef) -> Self { + self.router = Some(router); + self + } } impl Builder { pub fn build(self) -> Result> { let runtimes = self.runtimes.context(MissingRuntimes)?; let instance = self.instance.context(MissingInstance)?; + let router = self.router.context(MissingRouter)?; let addr: SocketAddr = format!("{}:{}", self.config.ip, self.config.port) .parse() .context(ParseIpAddr { ip: self.config.ip })?; - let mysql_handler = MysqlService::new(instance, runtimes, addr, self.config.timeout); + let mysql_handler = + MysqlService::new(instance, runtimes, router, addr, self.config.timeout); Ok(mysql_handler) } } diff --git a/server/src/mysql/error.rs b/server/src/mysql/error.rs index 11efd60389..863e721684 100644 --- a/server/src/mysql/error.rs +++ b/server/src/mysql/error.rs @@ -12,6 +12,9 @@ pub enum Error { #[snafu(display("Missing instance to build service.\nBacktrace:\n{}", backtrace))] MissingInstance { backtrace: Backtrace }, + #[snafu(display("Missing router to build service.\nBacktrace:\n{}", backtrace))] + MissingRouter { backtrace: Backtrace }, + #[snafu(display( "Failed to parse ip addr, ip:{}, err:{}.\nBacktrace:\n{}", ip, diff --git a/server/src/mysql/service.rs b/server/src/mysql/service.rs index 1c481bb8aa..ede653cd2d 100644 --- a/server/src/mysql/service.rs +++ b/server/src/mysql/service.rs @@ -6,6 +6,7 @@ use common_util::runtime::JoinHandle; use log::{error, info}; use opensrv_mysql::AsyncMysqlIntermediary; use query_engine::executor::Executor as QueryExecutor; +use router::RouterRef; use table_engine::engine::EngineRuntimes; use tokio::sync::oneshot::{self, Receiver, Sender}; @@ -17,6 +18,7 @@ use crate::{ pub struct MysqlService { instance: InstanceRef, runtimes: Arc, + router: RouterRef, socket_addr: SocketAddr, join_handler: Option>, tx: Option>, @@ -27,12 +29,14 @@ impl MysqlService { pub fn new( instance: Arc>, runtimes: Arc, + router: RouterRef, socket_addr: SocketAddr, timeout: Option, ) -> MysqlService { Self { instance, runtimes, + router, socket_addr, join_handler: None, tx: None, @@ -53,6 +57,7 @@ impl MysqlService { self.join_handler = Some(rt.bg_runtime.spawn(Self::loop_accept( self.instance.clone(), self.runtimes.clone(), + self.router.clone(), self.socket_addr, self.timeout, rx, @@ -69,6 +74,7 @@ impl MysqlService { async fn loop_accept( instance: InstanceRef, runtimes: Arc, + router: RouterRef, socket_addr: SocketAddr, timeout: Option, mut rx: Receiver<()>, @@ -90,10 +96,11 @@ impl MysqlService { }; let instance = instance.clone(); let runtimes = runtimes.clone(); + let router = router.clone(); let rt = runtimes.read_runtime.clone(); rt.spawn(AsyncMysqlIntermediary::run_on( - MysqlWorker::new(instance, runtimes, timeout), + MysqlWorker::new(instance, runtimes, router, timeout), stream, )); }, diff --git a/server/src/mysql/worker.rs b/server/src/mysql/worker.rs index 82f7c81eae..d87b326ce5 100644 --- a/server/src/mysql/worker.rs +++ b/server/src/mysql/worker.rs @@ -6,6 +6,7 @@ use interpreters::interpreter::Output; use log::{error, info}; use opensrv_mysql::{AsyncMysqlShim, ErrorKind, QueryResultWriter, StatementMetaWriter}; use query_engine::executor::Executor as QueryExecutor; +use router::RouterRef; use snafu::ResultExt; use table_engine::engine::EngineRuntimes; @@ -26,6 +27,7 @@ pub struct MysqlWorker { generic_hold: PhantomData, instance: Arc>, runtimes: Arc, + router: RouterRef, timeout: Option, } @@ -37,12 +39,14 @@ where pub fn new( instance: Arc>, runtimes: Arc, + router: RouterRef, timeout: Option, ) -> Self { Self { generic_hold: PhantomData::default(), instance, runtimes, + router, timeout, } } @@ -144,6 +148,7 @@ where .runtime(runtime) .enable_partition_table_access(false) .timeout(self.timeout) + .router(self.router.clone()) .build() .context(CreateContext) } diff --git a/server/src/proxy/grpc/prom_query.rs b/server/src/proxy/grpc/prom_query.rs index e413497997..b7dd712b9f 100644 --- a/server/src/proxy/grpc/prom_query.rs +++ b/server/src/proxy/grpc/prom_query.rs @@ -41,6 +41,7 @@ impl Proxy { ctx: Context, req: PrometheusQueryRequest, ) -> PrometheusQueryResponse { + self.hotspot_recorder.inc_promql_reqs(&req).await; match self.handle_prom_query_internal(ctx, req).await { Err(e) => { error!("Failed to handle prom query, err:{e}"); diff --git a/server/src/proxy/grpc/sql_query.rs b/server/src/proxy/grpc/sql_query.rs index f140d8876c..83650b2c94 100644 --- a/server/src/proxy/grpc/sql_query.rs +++ b/server/src/proxy/grpc/sql_query.rs @@ -39,6 +39,7 @@ const STREAM_QUERY_CHANNEL_LEN: usize = 20; impl Proxy { pub async fn handle_sql_query(&self, ctx: Context, req: SqlQueryRequest) -> SqlQueryResponse { + self.hotspot_recorder.inc_sql_query_reqs(&req).await; match self.handle_sql_query_internal(ctx, req).await { Err(e) => { error!("Failed to handle sql query, err:{e}"); @@ -56,6 +57,7 @@ impl Proxy { ctx: Context, req: SqlQueryRequest, ) -> BoxStream<'static, SqlQueryResponse> { + self.hotspot_recorder.inc_sql_query_reqs(&req).await; match self.clone().handle_stream_query_internal(ctx, req).await { Err(e) => stream::once(async { error!("Failed to handle stream sql query, err:{e}"); diff --git a/server/src/proxy/grpc/write.rs b/server/src/proxy/grpc/write.rs index 19d90272a8..b55d532393 100644 --- a/server/src/proxy/grpc/write.rs +++ b/server/src/proxy/grpc/write.rs @@ -70,6 +70,7 @@ impl WriteContext { impl Proxy { pub async fn handle_write(&self, ctx: Context, req: WriteRequest) -> WriteResponse { + self.hotspot_recorder.inc_write_reqs(&req).await; match self.handle_write_internal(ctx, req).await { Err(e) => { error!("Failed to handle write, err:{e}"); diff --git a/server/src/proxy/hotspot.rs b/server/src/proxy/hotspot.rs new file mode 100644 index 0000000000..ba9c32dda6 --- /dev/null +++ b/server/src/proxy/hotspot.rs @@ -0,0 +1,442 @@ +// Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0. + +//! hotspot recorder +use std::{fmt::Write, sync::Arc, time::Duration}; + +use ceresdbproto::storage::{ + PrometheusQueryRequest, RequestContext, SqlQueryRequest, WriteRequest, +}; +use common_util::{runtime::Runtime, timed_task::TimedTask}; +use log::{info, warn}; +use serde::{Deserialize, Serialize}; +use spin::Mutex as SpinMutex; +use tokio::sync::mpsc::{self, Sender}; + +use crate::proxy::{hotspot_lru::HotspotLru, util}; + +type QueryKey = String; +type WriteKey = String; +const TAG: &str = "hotspot autodump"; +const RECODER_CHANNEL_CAP: usize = 64 * 1024; + +#[derive(Debug, Clone, Deserialize, Serialize)] +#[serde(default)] +pub struct Config { + /// Max items size for query hotspot + query_cap: Option, + /// Max items size for write hotspot + write_cap: Option, + dump_interval: Duration, + auto_dump_interval: bool, + /// Max items for dump hotspot + auto_dump_len: usize, +} + +impl Default for Config { + fn default() -> Self { + Self { + query_cap: Some(10_000), + write_cap: Some(10_000), + dump_interval: Duration::from_secs(5), + auto_dump_interval: true, + auto_dump_len: 10, + } + } +} + +enum Message { + Query(QueryKey), + Write { + key: WriteKey, + row_count: usize, + field_count: usize, + }, +} + +#[derive(Clone)] +pub struct HotspotRecorder { + tx: Arc>, + stat: HotspotStat, +} + +#[derive(Clone)] +pub struct HotspotStat { + hotspot_query: Option>>>, + hotspot_write: Option>>>, + hotspot_field_write: Option>>>, +} + +impl HotspotStat { + /// return read count / write row count / write field count + pub fn dump(&self) -> Dump { + Dump { + read_hots: self + .pop_read_hots() + .map_or_else(Vec::new, HotspotStat::format_hots), + write_hots: self + .pop_write_hots() + .map_or_else(Vec::new, HotspotStat::format_hots), + write_field_hots: self + .pop_write_field_hots() + .map_or_else(Vec::new, HotspotStat::format_hots), + } + } + + fn format_hots(hots: Vec<(String, u64)>) -> Vec { + hots.into_iter() + .map(|(k, v)| format!("metric={k}, heats={v}")) + .collect() + } + + fn pop_read_hots(&self) -> Option> { + HotspotStat::pop_hots(&self.hotspot_query) + } + + fn pop_write_hots(&self) -> Option> { + HotspotStat::pop_hots(&self.hotspot_write) + } + + fn pop_write_field_hots(&self) -> Option> { + HotspotStat::pop_hots(&self.hotspot_field_write) + } + + fn pop_hots(target: &Option>>>) -> Option> { + target.as_ref().map(|hotspot| { + let mut hots = hotspot.lock().pop_all(); + hots.sort_by(|a, b| b.1.cmp(&a.1)); + hots + }) + } +} + +#[derive(Clone)] +pub struct Dump { + pub read_hots: Vec, + pub write_hots: Vec, + pub write_field_hots: Vec, +} + +impl HotspotRecorder { + pub fn new(config: Config, runtime: Arc) -> Self { + let hotspot_query = Self::init_lru(config.query_cap); + let hotspot_write = Self::init_lru(config.write_cap); + let hotspot_field_write = Self::init_lru(config.write_cap); + + let stat = HotspotStat { + hotspot_query: hotspot_query.clone(), + hotspot_write: hotspot_write.clone(), + hotspot_field_write: hotspot_field_write.clone(), + }; + + let task_handle = if config.auto_dump_interval { + let interval = config.dump_interval; + let dump_len = config.auto_dump_len; + let stat_clone = stat.clone(); + let builder = move || { + let stat_in_builder = stat_clone.clone(); + async move { + let Dump { + read_hots, + write_hots, + write_field_hots, + } = stat_in_builder.dump(); + + read_hots + .into_iter() + .take(dump_len) + .for_each(|hot| info!("{} query {}", TAG, hot)); + write_hots + .into_iter() + .take(dump_len) + .for_each(|hot| info!("{} write rows {}", TAG, hot)); + write_field_hots + .into_iter() + .take(dump_len) + .for_each(|hot| info!("{} write fields {}", TAG, hot)); + } + }; + + Some(TimedTask::start_timed_task( + String::from("hotspot_dump"), + &runtime, + interval, + builder, + )) + } else { + None + }; + + let (tx, mut rx) = mpsc::channel(RECODER_CHANNEL_CAP); + runtime.spawn(async move { + loop { + match rx.recv().await { + None => { + warn!("Hotspot recoder sender stopped"); + if let Some(handle) = task_handle { + handle.stop_task().await.unwrap(); + } + break; + } + Some(msg) => match msg { + Message::Query(read_key) => { + if let Some(hotspot) = &hotspot_query { + hotspot.lock().inc(&read_key, 1); + } + } + Message::Write { + key, + row_count, + field_count, + } => { + if let Some(hotspot) = &hotspot_write { + hotspot.lock().inc(&key, row_count as u64); + } + + if let Some(hotspot) = &hotspot_field_write { + hotspot.lock().inc(&key, field_count as u64); + } + } + }, + } + } + }); + + Self { + tx: Arc::new(tx), + stat, + } + } + + #[inline] + fn init_lru(cap: Option) -> Option>>> { + HotspotLru::new(cap?).map(|lru| Arc::new(SpinMutex::new(lru))) + } + + fn key_prefix(context: &Option) -> String { + let mut prefix = String::new(); + match context { + Some(ctx) => { + // use database as prefix + if !ctx.database.is_empty() { + write!(prefix, "{}/", ctx.database).unwrap(); + } + } + None => {} + } + + prefix + } + + #[inline] + fn table_hot_key(context: &Option, table: &String) -> String { + let prefix = Self::key_prefix(context); + prefix + table + } + + pub async fn inc_sql_query_reqs(&self, req: &SqlQueryRequest) { + if self.stat.hotspot_query.is_none() { + return; + } + + for table in &req.tables { + self.send_msg_or_log( + "inc_query_reqs", + Message::Query(Self::table_hot_key(&req.context, table)), + ) + .await; + } + } + + pub async fn inc_write_reqs(&self, req: &WriteRequest) { + if self.stat.hotspot_write.is_some() && self.stat.hotspot_field_write.is_some() { + for table_request in &req.table_requests { + let hot_key = Self::table_hot_key(&req.context, &table_request.table); + let mut row_count = 0; + let mut field_count = 0; + for entry in &table_request.entries { + row_count += 1; + for field_group in &entry.field_groups { + field_count += field_group.fields.len(); + } + } + self.send_msg_or_log( + "inc_write_reqs", + Message::Write { + key: hot_key, + row_count, + field_count, + }, + ) + .await; + } + } + } + + pub async fn inc_promql_reqs(&self, req: &PrometheusQueryRequest) { + if self.stat.hotspot_query.is_none() { + return; + } + + if let Some(expr) = &req.expr { + if let Some(table) = util::table_from_expr(expr) { + let hot_key = Self::table_hot_key(&req.context, &table); + self.send_msg_or_log("inc_query_reqs", Message::Query(hot_key)) + .await + } + } + } + + async fn send_msg_or_log(&self, method: &str, msg: Message) { + if let Err(e) = self.tx.send(msg).await { + warn!( + "HotspotRecoder::{} fail to send \ + measurement to recoder, err:{}", + method, e + ); + } + } +} + +#[cfg(test)] +mod test { + use std::thread; + + use ceresdbproto::{ + storage, + storage::{ + value::Value::StringValue, Field, FieldGroup, Value, WriteSeriesEntry, + WriteTableRequest, + }, + }; + use common_util::runtime::Builder; + + fn new_runtime() -> Arc { + let runtime = Builder::default() + .worker_threads(4) + .enable_all() + .build() + .unwrap(); + + Arc::new(runtime) + } + + use super::*; + + #[test] + #[allow(clippy::redundant_clone)] + fn test_hotspot() { + let hotspot_runtime = new_runtime(); + let basic_runtime = new_runtime(); + let runtime = hotspot_runtime.clone(); + basic_runtime.block_on(async move { + let read_cap: Option = Some(3); + let write_cap: Option = Some(3); + let options = Config { + query_cap: read_cap, + write_cap, + auto_dump_interval: false, + dump_interval: Duration::from_millis(5000), + auto_dump_len: 10, + }; + let recorder = HotspotRecorder::new(options, runtime.clone()); + assert!(recorder.stat.pop_read_hots().unwrap().is_empty()); + assert!(recorder.stat.pop_write_hots().unwrap().is_empty()); + let table = String::from("table1"); + let context = mock_context(); + let req = SqlQueryRequest { + context, + tables: vec![table], + sql: String::from("select * from table1 limit 10"), + }; + + recorder.inc_sql_query_reqs(&req).await; + thread::sleep(Duration::from_millis(100)); + + let vec = recorder.stat.pop_read_hots().unwrap(); + assert_eq!(1, vec.len()); + assert_eq!("public/table1", vec.get(0).unwrap().0); + }) + } + + #[test] + #[allow(clippy::redundant_clone)] + fn test_hotspot_dump() { + let hotspot_runtime = new_runtime(); + let basic_runtime = new_runtime(); + let runtime = hotspot_runtime.clone(); + basic_runtime.block_on(async move { + let read_cap: Option = Some(10); + let write_cap: Option = Some(10); + let options = Config { + query_cap: read_cap, + write_cap, + auto_dump_interval: false, + dump_interval: Duration::from_millis(5000), + auto_dump_len: 10, + }; + + let recorder = HotspotRecorder::new(options, runtime.clone()); + + assert!(recorder.stat.pop_read_hots().unwrap().is_empty()); + assert!(recorder.stat.pop_write_hots().unwrap().is_empty()); + + let table = String::from("table1"); + let context = mock_context(); + let query_req = SqlQueryRequest { + context, + tables: vec![table.clone()], + sql: String::from("select * from table1 limit 10"), + }; + recorder.inc_sql_query_reqs(&query_req).await; + + let write_req = WriteRequest { + context: mock_context(), + table_requests: vec![WriteTableRequest { + table, + tag_names: vec![String::from("name")], + field_names: vec![String::from("value1"), String::from("value2")], + entries: vec![WriteSeriesEntry { + tags: vec![storage::Tag { + name_index: 0, + value: Some(Value { + value: Some(StringValue(String::from("name1"))), + }), + }], + field_groups: vec![FieldGroup { + timestamp: 1679647020000, + fields: vec![ + Field { + name_index: 0, + value: Some(Value { value: None }), + }, + Field { + name_index: 1, + value: Some(Value { value: None }), + }, + ], + }], + }], + }], + }; + recorder.inc_write_reqs(&write_req).await; + + thread::sleep(Duration::from_millis(100)); + let Dump { + read_hots, + write_hots, + write_field_hots, + } = recorder.stat.dump(); + assert_eq!(vec!["metric=public/table1, heats=1",], write_hots); + assert_eq!(vec!["metric=public/table1, heats=1"], read_hots); + assert_eq!(vec!["metric=public/table1, heats=2",], write_field_hots); + thread::sleep(Duration::from_millis(100)); + }); + drop(hotspot_runtime); + } + + fn mock_context() -> Option { + Some(RequestContext { + database: String::from("public"), + }) + } +} diff --git a/server/src/proxy/hotspot_lru.rs b/server/src/proxy/hotspot_lru.rs new file mode 100644 index 0000000000..60fd76a3b1 --- /dev/null +++ b/server/src/proxy/hotspot_lru.rs @@ -0,0 +1,107 @@ +// Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0. + +//! hotspot LRU +use std::{hash::Hash, num::NonZeroUsize}; + +use clru::CLruCache; + +pub struct HotspotLru { + heats: CLruCache, +} + +impl HotspotLru { + /// Creates a new LRU Hotspot that holds at most `cap` items + pub fn new(cap: usize) -> Option> { + NonZeroUsize::new(cap).map(|cap| Self { + heats: CLruCache::new(cap), + }) + } + + /// Incs heat into hotspot cache, If the key already exists it + /// updates its heat value + pub fn inc(&mut self, key: &K, heat: u64) { + match self.heats.get_mut(key) { + Some(val) => *val += heat, + None => { + self.heats.put(key.clone(), heat); + } + } + } + + /// Removes and returns all items. + pub fn pop_all(&mut self) -> Vec<(K, u64)> { + let mut values = Vec::with_capacity(self.heats.len()); + + while let Some(value) = self.heats.pop_back() { + values.push(value); + } + + self.heats.clear(); + values + } +} + +#[cfg(test)] +mod tests { + use crate::proxy::hotspot_lru::HotspotLru; + + #[test] + fn test_inc_and_pop() { + let mut hotspot = HotspotLru::new(10).unwrap(); + hotspot.inc(&"apple", 1); + hotspot.inc(&"banana", 2); + hotspot.inc(&"orange", 3); + hotspot.inc(&"peach", 4); + hotspot.inc(&"cherry", 5); + + let result = hotspot.pop_all(); + assert_eq!(result.len(), 5); + assert_eq!(result[0], ("apple", 1)); + assert_eq!(result[1], ("banana", 2)); + assert_eq!(result[2], ("orange", 3)); + assert_eq!(result[3], ("peach", 4)); + assert_eq!(result[4], ("cherry", 5)); + } + + #[test] + fn test_update() { + let mut hotspot = HotspotLru::new(1).unwrap(); + + hotspot.inc(&"apple", 2); + hotspot.inc(&"apple", 1); + + let result = hotspot.pop_all(); + assert_eq!(result.len(), 1); + assert_eq!(result[0], ("apple", 3)); + } + + #[test] + fn test_removes_oldest() { + let mut hotspot = HotspotLru::new(2).unwrap(); + + hotspot.inc(&"apple", 1); + hotspot.inc(&"banana", 1); + hotspot.inc(&"pear", 2); + + let result = hotspot.pop_all(); + assert_eq!(result.len(), 2); + assert_eq!(result[0], ("banana", 1)); + assert_eq!(result[1], ("pear", 2)); + } + + #[test] + fn test_send() { + use std::thread; + + let mut hotspot = HotspotLru::new(4).unwrap(); + hotspot.inc(&"apple", 2); + + let handle = thread::spawn(move || { + let result = hotspot.pop_all(); + assert_eq!(result.len(), 1); + assert_eq!(result[0], ("apple", 2)); + }); + + assert!(handle.join().is_ok()); + } +} diff --git a/server/src/proxy/mod.rs b/server/src/proxy/mod.rs index d35c638573..c7ce5b104b 100644 --- a/server/src/proxy/mod.rs +++ b/server/src/proxy/mod.rs @@ -7,6 +7,9 @@ pub(crate) mod error; #[allow(dead_code)] pub mod forward; pub(crate) mod grpc; +pub mod hotspot; +pub mod hotspot_lru; +pub mod util; use std::{str::FromStr, sync::Arc, time::Duration}; @@ -20,6 +23,7 @@ use crate::{ proxy::{ error::{Internal, Result}, forward::{Forwarder, ForwarderRef}, + hotspot::HotspotRecorder, }, schema_config_provider::SchemaConfigProviderRef, }; @@ -31,9 +35,11 @@ pub struct Proxy { resp_compress_min_length: usize, auto_create_table: bool, schema_config_provider: SchemaConfigProviderRef, + hotspot_recorder: Arc, } impl Proxy { + #[allow(clippy::too_many_arguments)] pub fn try_new( router: Arc, instance: InstanceRef, @@ -42,6 +48,8 @@ impl Proxy { resp_compress_min_length: usize, auto_create_table: bool, schema_config_provider: SchemaConfigProviderRef, + hotspot_config: hotspot::Config, + runtime: Arc, ) -> Result { let local_endpoint = Endpoint::from_str(&local_endpoint).with_context(|| Internal { msg: format!("invalid local endpoint, input:{local_endpoint}"), @@ -53,6 +61,7 @@ impl Proxy { msg: "fail to init forward", })?, ); + let hotspot_recorder = Arc::new(HotspotRecorder::new(hotspot_config, runtime)); Ok(Self { router, instance, @@ -60,6 +69,7 @@ impl Proxy { resp_compress_min_length, auto_create_table, schema_config_provider, + hotspot_recorder, }) } } diff --git a/server/src/proxy/util.rs b/server/src/proxy/util.rs new file mode 100644 index 0000000000..40a77a6522 --- /dev/null +++ b/server/src/proxy/util.rs @@ -0,0 +1,70 @@ +// Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0. + +use ceresdbproto::prometheus::{ + expr::{Node, Node::Operand}, + operand::Value::Selector, + sub_expr::OperatorType, + Expr, SubExpr, +}; + +fn table_from_sub_expr(expr: &SubExpr) -> Option { + if expr.op_type == OperatorType::Aggr as i32 || expr.op_type == OperatorType::Func as i32 { + return table_from_expr(&expr.operands[0]); + } + + None +} + +pub fn table_from_expr(expr: &Expr) -> Option { + if let Some(node) = &expr.node { + match node { + Operand(operand) => { + if let Some(op_value) = &operand.value { + match op_value { + Selector(sel) => return Some(sel.measurement.to_string()), + _ => return None, + } + } + } + Node::SubExpr(sub_expr) => return table_from_sub_expr(sub_expr), + } + } + + None +} + +#[cfg(test)] +mod tests { + use ceresdbproto::prometheus::{expr, operand::Value::Selector, Expr, Operand}; + + use crate::proxy::util::table_from_expr; + + #[test] + fn test_measurement_from_expr() { + let expr = { + let selector = ceresdbproto::prometheus::Selector { + measurement: "aaa".to_string(), + filters: vec![], + start: 0, + end: 12345678, + align_start: 0, + align_end: 12345678, + step: 1, + range: 1, + offset: 1, + field: "value".to_string(), + }; + + let oprand = Operand { + value: Some(Selector(selector)), + }; + + Expr { + node: Some(expr::Node::Operand(oprand)), + } + }; + + let measurement = table_from_expr(&expr); + assert_eq!(measurement, Some("aaa".to_owned())); + } +} diff --git a/server/src/server.rs b/server/src/server.rs index e534ddb5cd..b5d9911385 100644 --- a/server/src/server.rs +++ b/server/src/server.rs @@ -328,6 +328,8 @@ impl Builder { let engine_runtimes = self.engine_runtimes.context(MissingEngineRuntimes)?; let log_runtime = self.log_runtime.context(MissingLogRuntime)?; let config_content = self.config_content.expect("Missing config content"); + let router = self.router.clone().context(MissingRouter)?; + let provider = self .schema_config_provider .context(MissingSchemaConfigProvider)?; @@ -337,6 +339,7 @@ impl Builder { .instance(instance.clone()) .schema_config_provider(provider.clone()) .config_content(config_content) + .router(router.clone()) .build() .context(HttpService { msg: "build failed", @@ -351,6 +354,7 @@ impl Builder { let mysql_service = mysql::Builder::new(mysql_config) .runtimes(engine_runtimes.clone()) .instance(instance.clone()) + .router(router.clone()) .build() .context(BuildMysqlService)?; @@ -374,6 +378,7 @@ impl Builder { .opened_wals(opened_wals) .schema_config_provider(provider) .forward_config(self.server_config.forward) + .hotspot_config(self.server_config.hotspot) .timeout(self.server_config.timeout.map(|v| v.0)) .auto_create_table(self.server_config.auto_create_table) .build() diff --git a/sql/Cargo.toml b/sql/Cargo.toml index 8023be5ad0..01ddc762d0 100644 --- a/sql/Cargo.toml +++ b/sql/Cargo.toml @@ -27,8 +27,9 @@ datafusion-expr = { workspace = true } datafusion-proto = { workspace = true } df_operator = { workspace = true } hashbrown = { version = "0.12", features = ["raw"] } -influxql-logical-planner = { git = "https://github.com/Rachelint/influxql-logical-planner.git", rev = "6057f72cd07336b9d641fcfcb98fb69b60fec1eb" } -influxql-parser = { git = "https://github.com/Rachelint/influxql-parser.git", rev = "6fd5d946843682c3559e1c172cf23a14d61495b9" } +influxql-logical-planner = { git = "https://github.com/CeresDB/influxql", package = "iox_query_influxql" } +influxql-parser = { git = "https://github.com/CeresDB/influxql", package = "influxdb_influxql_parser" } +influxql-schema = { git = "https://github.com/CeresDB/influxql", package = "schema" } itertools = { workspace = true } lazy_static = { workspace = true } log = { workspace = true } diff --git a/sql/src/frontend.rs b/sql/src/frontend.rs index 1000e441dd..7ee9e8374a 100644 --- a/sql/src/frontend.rs +++ b/sql/src/frontend.rs @@ -4,9 +4,11 @@ use std::{sync::Arc, time::Instant}; +use catalog::manager::ManagerRef; use ceresdbproto::{prometheus::Expr as PromExpr, storage::WriteTableRequest}; use cluster::config::SchemaConfig; use common_types::request_id::RequestId; +use common_util::error::{BoxError, GenericError}; use influxql_parser::statement::Statement as InfluxqlStatement; use snafu::{Backtrace, OptionExt, ResultExt, Snafu}; use table_engine::table; @@ -45,6 +47,12 @@ pub enum Error { influxql: String, parse_err: influxql_parser::common::ParseError, }, + + #[snafu(display("Failed to build influxql plan, msg:{}, err:{}", msg, source))] + InfluxqlPlanWithCause { msg: String, source: GenericError }, + + #[snafu(display("Failed to build influxql plan, msg:{}", msg,))] + InfluxqlPlan { msg: String }, } define_result!(Error); @@ -137,10 +145,39 @@ impl Frontend

{ &self, ctx: &mut Context, stmt: InfluxqlStatement, + manager: ManagerRef, ) -> Result { let planner = Planner::new(&self.provider, ctx.request_id, ctx.read_parallelism); + let catalog_name = self.provider.default_catalog_name(); + let catalog = manager + .catalog_by_name(catalog_name) + .box_err() + .context(InfluxqlPlanWithCause { + msg: format!("get catalog failed, value:{catalog_name}"), + })? + .context(InfluxqlPlan { + msg: format!("catalog is none, value:{catalog_name}"), + })?; + let schema_name = self.provider.default_schema_name(); + let schema = catalog + .schema_by_name(schema_name) + .box_err() + .context(InfluxqlPlanWithCause { + msg: format!("get schema failed, value:{schema_name}"), + })? + .context(InfluxqlPlan { + msg: format!("schema is none, value:{schema_name}"), + })?; + let all_tables = schema + .all_tables() + .box_err() + .context(InfluxqlPlanWithCause { + msg: format!("get all tables failed, catalog:{catalog_name}, schema:{schema_name}"), + })?; - planner.influxql_stmt_to_plan(stmt).context(CreatePlan) + planner + .influxql_stmt_to_plan(stmt, all_tables) + .context(CreatePlan) } pub fn write_req_to_plan( diff --git a/sql/src/influxql/mod.rs b/sql/src/influxql/mod.rs index 3f1ee584aa..b5b6e625eb 100644 --- a/sql/src/influxql/mod.rs +++ b/sql/src/influxql/mod.rs @@ -3,7 +3,6 @@ //! Influxql processing pub mod planner; -pub(crate) mod provider; pub mod error { use common_util::error::GenericError; diff --git a/sql/src/influxql/planner.rs b/sql/src/influxql/planner.rs index 57a16d35be..85d1e0c702 100644 --- a/sql/src/influxql/planner.rs +++ b/sql/src/influxql/planner.rs @@ -1,34 +1,102 @@ // Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0. -//! Influxql planner +//! InfluxQL planner -use std::sync::Arc; +use std::{collections::HashMap, sync::Arc}; use common_util::error::BoxError; -use influxql_logical_planner::planner::InfluxQLToLogicalPlan; +use datafusion::{error::DataFusionError, sql::planner::ContextProvider}; +use datafusion_expr::TableSource; +use influxql_logical_planner::plan::{ + ceresdb_schema_to_influxdb, InfluxQLToLogicalPlan, SchemaProvider, +}; use influxql_parser::{ common::{MeasurementName, QualifiedMeasurementName}, select::{MeasurementSelection, SelectStatement}, show_measurements::ShowMeasurementsStatement, statement::Statement as InfluxqlStatement, }; +use influxql_schema::Schema; use snafu::{ensure, ResultExt}; +use table_engine::table::TableRef; use crate::{ - influxql::{error::*, provider::InfluxSchemaProviderImpl}, + influxql::error::*, plan::{Plan, QueryPlan, QueryType, ShowPlan, ShowTablesPlan}, provider::{ContextProviderAdapter, MetaProvider}, }; -pub const CERESDB_MEASUREMENT_COLUMN_NAME: &str = "ceresdb::measurement"; +// Same with iox +pub const CERESDB_MEASUREMENT_COLUMN_NAME: &str = "iox::measurement"; -pub(crate) struct Planner<'a, P: MetaProvider> { +// Port from https://github.com/ceresdb/influxql/blob/36fc4d873e/iox_query_influxql/src/frontend/planner.rs#L28 +struct InfluxQLSchemaProvider<'a, P: MetaProvider> { context_provider: ContextProviderAdapter<'a, P>, + // TODO: avoid load all tables. + // if we can ensure `table_names` is only called once, then load tables lazily is better. + tables: HashMap, Schema)>, +} + +impl<'a, P: MetaProvider> SchemaProvider for InfluxQLSchemaProvider<'a, P> { + fn get_table_provider(&self, name: &str) -> datafusion::error::Result> { + self.tables + .get(name) + .map(|(t, _)| Arc::clone(t)) + .ok_or_else(|| DataFusionError::Plan(format!("measurement does not exist: {name}"))) + } + + fn get_function_meta(&self, name: &str) -> Option> { + self.context_provider.get_function_meta(name) + } + + fn get_aggregate_meta(&self, name: &str) -> Option> { + self.context_provider.get_aggregate_meta(name) + } + + fn table_names(&self) -> Vec<&'_ str> { + self.tables.keys().map(|k| k.as_str()).collect::>() + } + + fn table_schema(&self, name: &str) -> Option { + self.tables.get(name).map(|(_, s)| s.clone()) + } +} + +pub(crate) struct Planner<'a, P: MetaProvider> { + schema_provider: InfluxQLSchemaProvider<'a, P>, +} + +fn convert_influxql_schema(ceresdb_schema: common_types::schema::Schema) -> Result { + let arrow_schema = ceresdb_schema.into_arrow_schema_ref(); + ceresdb_schema_to_influxdb(arrow_schema) + .box_err() + .and_then(|s| Schema::try_from(s).box_err()) + .context(BuildPlanWithCause { + msg: "build influxql schema", + }) } impl<'a, P: MetaProvider> Planner<'a, P> { - pub fn new(context_provider: ContextProviderAdapter<'a, P>) -> Self { - Self { context_provider } + pub fn try_new( + context_provider: ContextProviderAdapter<'a, P>, + all_tables: Vec, + ) -> Result { + let tables = all_tables + .into_iter() + .map(|t| { + let table_name = t.name().to_string(); + let schema = convert_influxql_schema(t.schema())?; + let table_source = context_provider.table_source(t); + Ok((table_name, (table_source, schema))) + }) + .collect::>>()?; + + Ok(Self { + schema_provider: InfluxQLSchemaProvider { + context_provider, + tables, + }, + }) } /// Build sql logical plan from [InfluxqlStatement]. @@ -38,20 +106,29 @@ impl<'a, P: MetaProvider> Planner<'a, P> { /// and build plan then. pub fn statement_to_plan(self, stmt: InfluxqlStatement) -> Result { match stmt { - InfluxqlStatement::Select(_) => self.select_to_plan(stmt), + // TODO: show measurement is a temp workaround, it should be implemented in influxql + // crates. InfluxqlStatement::ShowMeasurements(stmt) => self.show_measurements_to_plan(*stmt), - InfluxqlStatement::CreateDatabase(_) - | InfluxqlStatement::ShowDatabases(_) - | InfluxqlStatement::ShowRetentionPolicies(_) - | InfluxqlStatement::ShowTagKeys(_) - | InfluxqlStatement::ShowTagValues(_) - | InfluxqlStatement::ShowFieldKeys(_) - | InfluxqlStatement::Delete(_) - | InfluxqlStatement::DropMeasurement(_) - | InfluxqlStatement::Explain(_) => Unimplemented { - msg: stmt.to_string(), + _ => { + let planner = InfluxQLToLogicalPlan::new(&self.schema_provider); + let df_plan = + planner + .statement_to_plan(stmt) + .box_err() + .context(BuildPlanWithCause { + msg: "planner stmt to plan", + })?; + let tables = Arc::new( + self.schema_provider + .context_provider + .try_into_container() + .box_err() + .context(BuildPlanWithCause { + msg: "get tables from context_provider", + })?, + ); + Ok(Plan::Query(QueryPlan { df_plan, tables })) } - .fail(), } } @@ -63,39 +140,6 @@ impl<'a, P: MetaProvider> Planner<'a, P> { }; Ok(Plan::Show(ShowPlan::ShowTablesPlan(plan))) } - - fn select_to_plan(self, stmt: InfluxqlStatement) -> Result { - if let InfluxqlStatement::Select(select_stmt) = &stmt { - check_select_statement(select_stmt)?; - } else { - unreachable!("select statement here has been ensured by caller"); - } - - let influx_schema_provider = InfluxSchemaProviderImpl { - context_provider: &self.context_provider, - }; - let influxql_logical_planner = InfluxQLToLogicalPlan::new( - &influx_schema_provider, - CERESDB_MEASUREMENT_COLUMN_NAME.to_string(), - ); - - let df_plan = influxql_logical_planner - .statement_to_plan(stmt) - .box_err() - .context(BuildPlanWithCause { - msg: "build df plan for influxql select statement", - })?; - let tables = Arc::new( - self.context_provider - .try_into_container() - .box_err() - .context(BuildPlanWithCause { - msg: "get tables from df plan of select", - })?, - ); - - Ok(Plan::Query(QueryPlan { df_plan, tables })) - } } pub fn check_select_statement(select_stmt: &SelectStatement) -> Result<()> { diff --git a/sql/src/influxql/provider.rs b/sql/src/influxql/provider.rs deleted file mode 100644 index 7a90f16dfa..0000000000 --- a/sql/src/influxql/provider.rs +++ /dev/null @@ -1,490 +0,0 @@ -// Copyright 2023 CeresDB Project Authors. Licensed under Apache-2.0. - -//! Influxql schema provider - -use std::sync::Arc; - -use arrow::datatypes::Field as ArrowField; -use common_types::{column_schema::ColumnSchema, datum::DatumKind, schema::Schema}; -use common_util::error::BoxError; -use datafusion::sql::planner::ContextProvider; -use influxql_logical_planner::{ - provider::{InfluxColumnType, InfluxFieldType, Schema as InfluxSchema, SchemaProvider}, - DataFusionError, Result as DatafusionResult, -}; - -use crate::{ - influxql::error::*, - provider::{ContextProviderAdapter, MetaProvider}, -}; - -/// Influx schema used for build logical plan -pub struct InfluxSchemaImpl { - columns: Vec, - time_column_idx: usize, -} - -impl InfluxSchemaImpl { - /// New influx schema by ceresdb inner schema. - /// - /// NOTICE: The compatible ceresdb inner schema is required as following: - /// + Only one timestamp column named "time" - /// + Tag column only can be string type and nullable - /// + Field column only can be int64/uint64/float64/string/boolean type - /// and nullable - fn new(schema: &Schema) -> Result { - let cols = schema.columns(); - let timestamp_key_idx = schema.timestamp_index(); - let tsid_idx_opt = schema.index_of_tsid(); - let arrow_fields = &schema.to_arrow_schema_ref().fields; - - let influx_columns = arrow_fields - .iter() - .zip(cols.iter().enumerate()) - .filter_map(|(arrow_col, (col_idx, col))| { - if matches!(tsid_idx_opt, Some(tsid_idx) if col_idx == tsid_idx) { - None - } else { - let influx_type_res = - map_column_to_influx_column(col, col_idx == timestamp_key_idx); - Some(influx_type_res.map(|influx_type| InfluxColumnSchema { - influx_type, - arrow_field: arrow_col.clone(), - })) - } - }) - .collect::>>()?; - - // Schema is ensured to have timestamp key. - let time_column_idx = influx_columns - .iter() - .enumerate() - .find(|(_, column)| matches!(column.influx_type, InfluxColumnType::Timestamp)) - .map(|(idx, _)| idx) - .unwrap(); - - Ok(Self { - columns: influx_columns, - time_column_idx, - }) - } -} - -impl InfluxSchema for InfluxSchemaImpl { - fn columns(&self) -> Vec<(InfluxColumnType, &ArrowField)> { - self.columns - .iter() - .map(|column| (column.influx_type, &column.arrow_field)) - .collect() - } - - fn tags(&self) -> Vec<&ArrowField> { - self.columns - .iter() - .filter_map(|column| { - if matches!(column.influx_type, InfluxColumnType::Tag) { - Some(&column.arrow_field) - } else { - None - } - }) - .collect() - } - - fn fields(&self) -> Vec<&ArrowField> { - self.columns - .iter() - .filter_map(|column| { - if matches!(column.influx_type, InfluxColumnType::Field(..)) { - Some(&column.arrow_field) - } else { - None - } - }) - .collect() - } - - fn time(&self) -> &ArrowField { - // Time column must exist, has checked it when building. - let time_column = &self.columns[self.time_column_idx]; - - &time_column.arrow_field - } - - fn column(&self, idx: usize) -> (InfluxColumnType, &ArrowField) { - let column = &self.columns[idx]; - - (column.influx_type, &column.arrow_field) - } - - fn find_index_of(&self, name: &str) -> Option { - self.columns - .iter() - .enumerate() - .find(|(_, column)| column.arrow_field.name() == name) - .map(|(index, _)| index) - } -} - -fn map_column_to_influx_column( - column: &ColumnSchema, - is_timestamp_key: bool, -) -> Result { - if is_timestamp_key { - return map_column_to_influx_time_column(column); - } - - if column.is_tag { - return map_column_to_influx_tag_column(column); - } - - map_column_to_influx_field_column(column) -} - -// TODO: don't restrict the time column name. -fn map_column_to_influx_time_column(column: &ColumnSchema) -> Result { - if column.name == "time" && !column.is_nullable { - Ok(InfluxColumnType::Timestamp) - } else { - BuildSchema { - msg: format!("invalid time column, column:{column:?}"), - } - .fail() - } -} - -// TODO: support more tag types. -fn map_column_to_influx_tag_column(column: &ColumnSchema) -> Result { - if matches!(column.data_type, DatumKind::String) && column.is_nullable { - Ok(InfluxColumnType::Tag) - } else { - BuildSchema { - msg: format!("invalid tag column, column:{column:?}"), - } - .fail() - } -} - -// TODO: support more field types. -fn map_column_to_influx_field_column(column: &ColumnSchema) -> Result { - if column.is_nullable { - match column.data_type { - DatumKind::Int64 => Ok(InfluxColumnType::Field(InfluxFieldType::Integer)), - DatumKind::UInt64 => Ok(InfluxColumnType::Field(InfluxFieldType::UInteger)), - DatumKind::Double => Ok(InfluxColumnType::Field(InfluxFieldType::Float)), - DatumKind::String => Ok(InfluxColumnType::Field(InfluxFieldType::String)), - DatumKind::Boolean => Ok(InfluxColumnType::Field(InfluxFieldType::Boolean)), - DatumKind::Null - | DatumKind::Timestamp - | DatumKind::Float - | DatumKind::Varbinary - | DatumKind::UInt32 - | DatumKind::UInt16 - | DatumKind::UInt8 - | DatumKind::Int32 - | DatumKind::Int16 - | DatumKind::Int8 - | DatumKind::Date - | DatumKind::Time => BuildSchema { - msg: format!("invalid field column, column:{column:?}"), - } - .fail(), - } - } else { - BuildSchema { - msg: format!("invalid field column, column:{column:?}"), - } - .fail() - } -} - -struct InfluxColumnSchema { - influx_type: InfluxColumnType, - arrow_field: ArrowField, -} - -/// Influx schema provider used for building logical plan -pub(crate) struct InfluxSchemaProviderImpl<'a, P: MetaProvider> { - pub(crate) context_provider: &'a ContextProviderAdapter<'a, P>, -} - -impl<'a, P: MetaProvider> SchemaProvider for InfluxSchemaProviderImpl<'a, P> { - fn get_table_provider( - &self, - name: &str, - ) -> DatafusionResult> { - self.context_provider - .get_table_provider(name.into()) - .box_err() - .map_err(|e| DataFusionError::External(e)) - } - - fn table_names(&self) -> DatafusionResult> { - Err(DataFusionError::NotImplemented( - "get all table names".to_string(), - )) - } - - fn table_schema( - &self, - name: &str, - ) -> DatafusionResult>> { - let table_opt = self - .context_provider - .table(name.into()) - .box_err() - .map_err(|e| DataFusionError::External(e))?; - - Ok(match table_opt { - Some(table) => { - let influx_schema = InfluxSchemaImpl::new(&table.schema()) - .box_err() - .map_err(|e| DataFusionError::External(e))?; - Some(Arc::new(influx_schema)) - } - None => None, - }) - } - - fn table_exists(&self, name: &str) -> DatafusionResult { - Ok(self.table_schema(name)?.is_some()) - } -} - -#[cfg(test)] -mod test { - use arrow::datatypes::{DataType, TimeUnit}; - use common_types::{ - column_schema, - datum::DatumKind, - schema::{self, Schema, TSID_COLUMN}, - }; - use influxql_logical_planner::provider::{ - InfluxColumnType, InfluxFieldType, Schema as InfluxSchema, - }; - - use super::InfluxSchemaImpl; - - #[test] - fn test_build_influx_schema() { - let cases = vec![ - Case::Compatible, - Case::TimeNameInvalid, - Case::TagNotNull, - Case::FieldNotNull, - Case::TagTypeInvalid, - Case::FieldTypeInvalid, - ]; - - for case in cases { - let schema = build_test_schema(case); - let influx_schema = InfluxSchemaImpl::new(&schema); - match case { - Case::Compatible => { - let influx_schema = influx_schema.unwrap(); - let columns = influx_schema.columns(); - for column in columns { - match column { - (InfluxColumnType::Timestamp, field) => { - assert_eq!(field.name(), "time"); - assert_eq!( - field.data_type(), - &DataType::Timestamp(TimeUnit::Millisecond, None) - ); - assert!(!field.is_nullable()); - } - (InfluxColumnType::Tag, field) => { - assert_eq!(field.name(), "tag"); - assert_eq!(field.data_type(), &DataType::Utf8); - assert!(field.is_nullable()); - } - (InfluxColumnType::Field(InfluxFieldType::Integer), field) => { - assert_eq!(field.name(), "int_field"); - assert_eq!(field.data_type(), &DataType::Int64); - assert!(field.is_nullable()); - } - (InfluxColumnType::Field(InfluxFieldType::UInteger), field) => { - assert_eq!(field.name(), "uint_field"); - assert_eq!(field.data_type(), &DataType::UInt64); - assert!(field.is_nullable()); - } - (InfluxColumnType::Field(InfluxFieldType::Float), field) => { - assert_eq!(field.name(), "float_field"); - assert_eq!(field.data_type(), &DataType::Float64); - assert!(field.is_nullable()); - } - (InfluxColumnType::Field(InfluxFieldType::String), field) => { - assert_eq!(field.name(), "str_field"); - assert_eq!(field.data_type(), &DataType::Utf8); - assert!(field.is_nullable()); - } - (InfluxColumnType::Field(InfluxFieldType::Boolean), field) => { - assert_eq!(field.name(), "bool_field"); - assert_eq!(field.data_type(), &DataType::Boolean); - assert!(field.is_nullable()); - } - } - } - } - Case::TimeNameInvalid => { - assert!(influx_schema.is_err()); - assert!(influx_schema - .err() - .unwrap() - .to_string() - .contains("invalid time column")); - } - Case::TagNotNull => { - assert!(influx_schema.is_err()); - assert!(influx_schema - .err() - .unwrap() - .to_string() - .contains("invalid tag column")); - } - Case::FieldNotNull => { - assert!(influx_schema.is_err()); - assert!(influx_schema - .err() - .unwrap() - .to_string() - .contains("invalid field column")); - } - Case::TagTypeInvalid => { - assert!(influx_schema.is_err()); - assert!(influx_schema - .err() - .unwrap() - .to_string() - .contains("invalid tag column")); - } - Case::FieldTypeInvalid => { - assert!(influx_schema.is_err()); - assert!(influx_schema - .err() - .unwrap() - .to_string() - .contains("invalid field column")); - } - } - } - } - - #[derive(Clone, Copy)] - enum Case { - Compatible, - TimeNameInvalid, - TagNotNull, - FieldNotNull, - TagTypeInvalid, - FieldTypeInvalid, - } - - fn build_test_schema(case: Case) -> Schema { - let time_column_name = if matches!(case, Case::TimeNameInvalid) { - "not_time" - } else { - "time" - }; - - let base_schema_builder = schema::Builder::new() - .auto_increment_column_id(true) - .add_key_column( - column_schema::Builder::new(time_column_name.to_string(), DatumKind::Timestamp) - .is_nullable(false) - .build() - .expect("should succeed build column schema"), - ) - .unwrap() - .add_key_column( - column_schema::Builder::new(TSID_COLUMN.to_owned(), DatumKind::UInt64) - .is_nullable(false) - .build() - .expect("should succeed build column schema"), - ) - .unwrap() - .add_normal_column( - column_schema::Builder::new("tag".to_string(), DatumKind::String) - .is_nullable(true) - .is_tag(true) - .build() - .expect("should succeed build column schema"), - ) - .unwrap() - .add_normal_column( - column_schema::Builder::new("str_field".to_string(), DatumKind::String) - .is_nullable(true) - .build() - .expect("should succeed build column schema"), - ) - .unwrap() - .add_normal_column( - column_schema::Builder::new("int_field".to_string(), DatumKind::Int64) - .is_nullable(true) - .build() - .expect("should succeed build column schema"), - ) - .unwrap() - .add_normal_column( - column_schema::Builder::new("uint_field".to_string(), DatumKind::UInt64) - .is_nullable(true) - .build() - .expect("should succeed build column schema"), - ) - .unwrap() - .add_normal_column( - column_schema::Builder::new("float_field".to_string(), DatumKind::Double) - .is_nullable(true) - .build() - .expect("should succeed build column schema"), - ) - .unwrap() - .add_normal_column( - column_schema::Builder::new("bool_field".to_string(), DatumKind::Boolean) - .is_nullable(true) - .build() - .expect("should succeed build column schema"), - ) - .unwrap(); - - let schema_builder = match case { - Case::TagNotNull => base_schema_builder - .add_normal_column( - column_schema::Builder::new("tag_not_null".to_string(), DatumKind::String) - .is_nullable(false) - .is_tag(true) - .build() - .expect("should succeed build column schema"), - ) - .unwrap(), - Case::FieldNotNull => base_schema_builder - .add_normal_column( - column_schema::Builder::new("field_not_null".to_string(), DatumKind::Int64) - .is_nullable(false) - .build() - .expect("should succeed build column schema"), - ) - .unwrap(), - Case::TagTypeInvalid => base_schema_builder - .add_normal_column( - column_schema::Builder::new("tag_invaild".to_string(), DatumKind::Varbinary) - .is_nullable(true) - .is_tag(true) - .build() - .expect("should succeed build column schema"), - ) - .unwrap(), - Case::FieldTypeInvalid => base_schema_builder - .add_normal_column( - column_schema::Builder::new("field_invalid".to_string(), DatumKind::Varbinary) - .is_nullable(true) - .build() - .expect("should succeed build column schema"), - ) - .unwrap(), - _ => base_schema_builder, - }; - - schema_builder.build().expect("should succeed build schema") - } -} diff --git a/sql/src/planner.rs b/sql/src/planner.rs index 7f7e653577..650e7e1603 100644 --- a/sql/src/planner.rs +++ b/sql/src/planner.rs @@ -330,12 +330,15 @@ impl<'a, P: MetaProvider> Planner<'a, P> { .context(BuildPromPlanError) } - pub fn influxql_stmt_to_plan(&self, statement: InfluxqlStatement) -> Result { + pub fn influxql_stmt_to_plan( + &self, + statement: InfluxqlStatement, + all_tables: Vec, + ) -> Result { let adapter = ContextProviderAdapter::new(self.provider, self.read_parallelism); - let influxql_planner = crate::influxql::planner::Planner::new(adapter); - influxql_planner - .statement_to_plan(statement) + crate::influxql::planner::Planner::try_new(adapter, all_tables) + .and_then(|planner| planner.statement_to_plan(statement)) .context(BuildInfluxqlPlan) } @@ -872,8 +875,7 @@ impl<'a, P: MetaProvider> PlannerDelegate<'a, P> { .columns() .iter() .map(|column_schema| { - DFField::new( - None, + DFField::new_unqualified( &column_schema.name, column_schema.data_type.to_arrow_data_type(), column_schema.is_nullable, @@ -1171,6 +1173,9 @@ pub fn parse_for_option(value: Value) -> Result> { Value::Null | Value::Placeholder(_) | Value::EscapedStringLiteral(_) + | Value::SingleQuotedByteStringLiteral(_) + | Value::DoubleQuotedByteStringLiteral(_) + | Value::RawStringLiteral(_) | Value::DollarQuotedString(_) => None, }; diff --git a/sql/src/promql/datafusion_util.rs b/sql/src/promql/datafusion_util.rs index 525b285c35..f6efcc477f 100644 --- a/sql/src/promql/datafusion_util.rs +++ b/sql/src/promql/datafusion_util.rs @@ -1,6 +1,11 @@ // Copyright 2022 CeresDB Project Authors. Licensed under Apache-2.0. -use std::{any::Any, fmt, sync::Arc}; +use std::{ + any::Any, + fmt, + hash::{Hash, Hasher}, + sync::Arc, +}; use common_types::{schema::TSID_COLUMN, time::TimeRange}; use datafusion::common::DFSchemaRef; @@ -11,7 +16,7 @@ use datafusion_expr::{ use crate::promql::pushdown::{AlignParameter, Func}; /// ColumnNames represents meaning of columns in one table. -#[derive(Debug)] +#[derive(Debug, Hash, PartialEq)] pub struct ColumnNames { pub timestamp: String, pub tag_keys: Vec, @@ -35,6 +40,7 @@ pub fn default_sort_exprs(timestamp_column: &str) -> Vec { ] } +#[derive(Hash, PartialEq)] pub struct PromAlignNode { pub input: LogicalPlan, pub column_name: Arc, @@ -55,6 +61,10 @@ impl UserDefinedLogicalNode for PromAlignNode { self } + fn name(&self) -> &str { + "PromAlignNode" + } + fn inputs(&self) -> Vec<&LogicalPlan> { vec![&self.input] } @@ -103,4 +113,16 @@ impl UserDefinedLogicalNode for PromAlignNode { read_parallelism: self.read_parallelism, }) } + + fn dyn_hash(&self, state: &mut dyn Hasher) { + let mut s = state; + self.hash(&mut s); + } + + fn dyn_eq(&self, other: &dyn UserDefinedLogicalNode) -> bool { + match other.as_any().downcast_ref::() { + Some(o) => self == o, + None => false, + } + } } diff --git a/sql/src/promql/pushdown.rs b/sql/src/promql/pushdown.rs index f9c0a279d9..dbcaab04f3 100644 --- a/sql/src/promql/pushdown.rs +++ b/sql/src/promql/pushdown.rs @@ -13,7 +13,7 @@ pub enum Error { define_result!(Error); -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, Hash, PartialEq)] pub enum Func { Instant, // used to simulate instant query Rate, @@ -40,7 +40,7 @@ impl TryFrom<&str> for Func { } } -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, Hash, PartialEq)] pub struct AlignParameter { pub align_range: TimeRange, pub step: Timestamp, diff --git a/sql/src/provider.rs b/sql/src/provider.rs index 81eb931720..ff5ab0d7e5 100644 --- a/sql/src/provider.rs +++ b/sql/src/provider.rs @@ -190,7 +190,7 @@ impl<'a, P: MetaProvider> ContextProviderAdapter<'a, P> { } } - fn table_source(&self, table_ref: TableRef) -> Arc<(dyn TableSource + 'static)> { + pub fn table_source(&self, table_ref: TableRef) -> Arc<(dyn TableSource + 'static)> { let table_adapter = Arc::new(TableProviderAdapter::new(table_ref)); Arc::new(DefaultTableSource { diff --git a/table_engine/src/predicate.rs b/table_engine/src/predicate.rs index 34f9fc8f58..c1cddeed37 100644 --- a/table_engine/src/predicate.rs +++ b/table_engine/src/predicate.rs @@ -419,6 +419,7 @@ impl<'a> TimeRangeExtractor<'a> { | Expr::QualifiedWildcard { .. } | Expr::GroupingSet(_) | Expr::GetIndexedField { .. } + | Expr::OuterReferenceColumn { .. } | Expr::Placeholder { .. } => TimeRange::min_to_max(), } } diff --git a/wal/src/message_queue_impl/namespace.rs b/wal/src/message_queue_impl/namespace.rs index be7d30e6c1..7a43a54734 100644 --- a/wal/src/message_queue_impl/namespace.rs +++ b/wal/src/message_queue_impl/namespace.rs @@ -5,7 +5,11 @@ use std::{collections::HashMap, fmt, sync::Arc, time::Duration}; use common_types::SequenceNumber; -use common_util::{define_result, runtime::Runtime}; +use common_util::{ + define_result, + runtime::Runtime, + timed_task::{TaskHandle, TimedTask}, +}; use log::{debug, error, info}; use message_queue::{ConsumeIterator, MessageQueue}; use snafu::{ensure, Backtrace, OptionExt, ResultExt, Snafu}; @@ -22,7 +26,6 @@ use crate::{ encoding::MetaEncoding, region::{self, MessageQueueLogIterator, Region}, }, - table_kv_impl::timed_task::{TaskHandle, TimedTask}, }; #[derive(Debug, Snafu)] diff --git a/wal/src/table_kv_impl/mod.rs b/wal/src/table_kv_impl/mod.rs index 8190a8e01a..6de5c8d183 100644 --- a/wal/src/table_kv_impl/mod.rs +++ b/wal/src/table_kv_impl/mod.rs @@ -11,7 +11,6 @@ pub mod model; mod namespace; mod table_unit; -pub mod timed_task; pub mod wal; diff --git a/wal/src/table_kv_impl/namespace.rs b/wal/src/table_kv_impl/namespace.rs index 18d399d9d3..97bc891ac4 100644 --- a/wal/src/table_kv_impl/namespace.rs +++ b/wal/src/table_kv_impl/namespace.rs @@ -15,6 +15,7 @@ use common_util::{ define_result, error::{BoxError, GenericError}, runtime::Runtime, + timed_task::{TaskHandle, TimedTask}, }; use log::{debug, error, info, trace, warn}; use snafu::{Backtrace, OptionExt, ResultExt, Snafu}; @@ -33,7 +34,6 @@ use crate::{ consts, encoding, model::{BucketEntry, NamespaceConfig, NamespaceEntry}, table_unit::{TableLogIterator, TableUnit, TableUnitRef}, - timed_task::{TaskHandle, TimedTask}, WalRuntimes, }, };