diff --git a/Cargo.lock b/Cargo.lock index 1c3f2a3..904cc32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,11 +72,23 @@ version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "arrow" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2feeebd77b34b0bc88f224e06d01c27da4733997cc4789a4e056196656cdc59a" +checksum = "7fab9e93ba8ce88a37d5a30dce4b9913b75413dc1ac56cb5d72e5a840543f829" dependencies = [ "ahash", "arrow-arith", @@ -96,9 +108,9 @@ dependencies = [ [[package]] name = "arrow-arith" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7173f5dc49c0ecb5135f52565af33afd3fdc9a12d13bd6f9973e8b96305e4b2e" +checksum = "bc1d4e368e87ad9ee64f28b9577a3834ce10fe2703a26b28417d485bbbdff956" dependencies = [ "arrow-array", "arrow-buffer", @@ -111,9 +123,9 @@ dependencies = [ [[package]] name = "arrow-array" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63d7ea725f7d1f8bb2cffc53ef538557e95fc802e217d5be25122d402e22f3d0" +checksum = "d02efa7253ede102d45a4e802a129e83bcc3f49884cab795b1ac223918e4318d" dependencies = [ "ahash", "arrow-buffer", @@ -128,19 +140,20 @@ dependencies = [ [[package]] name = "arrow-buffer" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbe439e077f484e5000b9e1d47b5e4c0d15f2b311a8f5bcc682553d5d67a722" +checksum = "fda119225204141138cb0541c692fbfef0e875ba01bfdeaed09e9d354f9d6195" dependencies = [ + "bytes", "half", "num", ] [[package]] name = "arrow-cast" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93913cc14875770aa1eef5e310765e855effa352c094cb1c7c00607d0f37b4e1" +checksum = "1d825d51b9968868d50bc5af92388754056796dbc62a4e25307d588a1fc84dee" dependencies = [ "arrow-array", "arrow-buffer", @@ -156,9 +169,9 @@ dependencies = [ [[package]] name = "arrow-csv" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef55b67c55ed877e6fe7b923121c19dae5e31ca70249ea2779a17b58fb0fbd9a" +checksum = "43ef855dc6b126dc197f43e061d4de46b9d4c033aa51c2587657f7508242cef1" dependencies = [ "arrow-array", "arrow-buffer", @@ -175,9 +188,9 @@ dependencies = [ [[package]] name = "arrow-data" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4f4f4a3c54614126a71ab91f6631c9743eb4643d6e9318b74191da9dc6e028b" +checksum = "475a4c3699c8b4095ca61cecf15da6f67841847a5f5aac983ccb9a377d02f73a" dependencies = [ "arrow-buffer", "arrow-schema", @@ -187,9 +200,9 @@ dependencies = [ [[package]] name = "arrow-ipc" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41a3659f984a524ef1c2981d43747b24d8eec78e2425267fcd0ef34ce71cd18" +checksum = "1248005c8ac549f869b7a840859d942bf62471479c1a2d82659d453eebcd166a" dependencies = [ "arrow-array", "arrow-buffer", @@ -201,9 +214,9 @@ dependencies = [ [[package]] name = "arrow-json" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10b95faa95a378f56ef32d84cc0104ea998c39ef7cd1faaa6b4cebf8ea92846d" +checksum = "f03d7e3b04dd688ccec354fe449aed56b831679f03e44ee2c1cfc4045067b69c" dependencies = [ "arrow-array", "arrow-buffer", @@ -221,9 +234,9 @@ dependencies = [ [[package]] name = "arrow-ord" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68549a4284d9f8b39586afb8d5ff8158b8f0286353a4844deb1d11cf1ba1f26" +checksum = "03b87aa408ea6a6300e49eb2eba0c032c88ed9dc19e0a9948489c55efdca71f4" dependencies = [ "arrow-array", "arrow-buffer", @@ -236,9 +249,9 @@ dependencies = [ [[package]] name = "arrow-row" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a75a4a757afc301ce010adadff54d79d66140c4282ed3de565f6ccb716a5cf3" +checksum = "114a348ab581e7c9b6908fcab23cb39ff9f060eb19e72b13f8fb8eaa37f65d22" dependencies = [ "ahash", "arrow-array", @@ -251,16 +264,17 @@ dependencies = [ [[package]] name = "arrow-schema" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bebcb57eef570b15afbcf2d07d813eb476fde9f6dd69c81004d6476c197e87e" +checksum = "5d1d179c117b158853e0101bfbed5615e86fe97ee356b4af901f1c5001e1ce4b" [[package]] name = "arrow-select" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e2943fa433a48921e914417173816af64eef61c0a3d448280e6c40a62df221" +checksum = "d5c71e003202e67e9db139e5278c79f5520bb79922261dfe140e4637ee8b6108" dependencies = [ + "ahash", "arrow-array", "arrow-buffer", "arrow-data", @@ -270,9 +284,9 @@ dependencies = [ [[package]] name = "arrow-string" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbc92ed638851774f6d7af1ad900b92bc1486746497511868b4298fcbcfa35af" +checksum = "c4cebbb282d6b9244895f4a9a912e55e57bce112554c7fa91fcec5459cb421ab" dependencies = [ "arrow-array", "arrow-buffer", @@ -310,13 +324,13 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.38", ] [[package]] @@ -343,6 +357,37 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "blake3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "brotli" version = "3.3.4" @@ -399,14 +444,14 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "winapi", + "windows-targets 0.48.0", ] [[package]] @@ -487,12 +532,27 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + [[package]] name = "core-foundation-sys" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.3.2" @@ -508,6 +568,16 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "csv" version = "1.2.2" @@ -544,8 +614,8 @@ dependencies = [ [[package]] name = "datafusion" -version = "27.0.0" -source = "git+https://github.com/CeresDB/arrow-datafusion.git?rev=a6dcd943051a083693c352c6b4279156548490a0#a6dcd943051a083693c352c6b4279156548490a0" +version = "32.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=219cfb4ccb36045c73409127db51377d66ca0f33#219cfb4ccb36045c73409127db51377d66ca0f33" dependencies = [ "ahash", "arrow", @@ -560,14 +630,14 @@ dependencies = [ "datafusion-expr", "datafusion-optimizer", "datafusion-physical-expr", - "datafusion-row", + "datafusion-physical-plan", "datafusion-sql", "futures", "glob", + "half", "hashbrown 0.14.0", "indexmap 2.0.0", "itertools 0.11.0", - "lazy_static", "log", "num_cpus", "object_store", @@ -576,7 +646,6 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rand", - "smallvec", "sqlparser", "tempfile", "tokio", @@ -587,12 +656,16 @@ dependencies = [ [[package]] name = "datafusion-common" -version = "27.0.0" -source = "git+https://github.com/CeresDB/arrow-datafusion.git?rev=a6dcd943051a083693c352c6b4279156548490a0#a6dcd943051a083693c352c6b4279156548490a0" +version = "32.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=219cfb4ccb36045c73409127db51377d66ca0f33#219cfb4ccb36045c73409127db51377d66ca0f33" dependencies = [ + "ahash", "arrow", "arrow-array", + "arrow-buffer", + "arrow-schema", "chrono", + "half", "num_cpus", "object_store", "parquet", @@ -601,12 +674,15 @@ dependencies = [ [[package]] name = "datafusion-execution" -version = "27.0.0" -source = "git+https://github.com/CeresDB/arrow-datafusion.git?rev=a6dcd943051a083693c352c6b4279156548490a0#a6dcd943051a083693c352c6b4279156548490a0" +version = "32.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=219cfb4ccb36045c73409127db51377d66ca0f33#219cfb4ccb36045c73409127db51377d66ca0f33" dependencies = [ + "arrow", + "chrono", "dashmap", "datafusion-common", "datafusion-expr", + "futures", "hashbrown 0.14.0", "log", "object_store", @@ -618,13 +694,13 @@ dependencies = [ [[package]] name = "datafusion-expr" -version = "27.0.0" -source = "git+https://github.com/CeresDB/arrow-datafusion.git?rev=a6dcd943051a083693c352c6b4279156548490a0#a6dcd943051a083693c352c6b4279156548490a0" +version = "32.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=219cfb4ccb36045c73409127db51377d66ca0f33#219cfb4ccb36045c73409127db51377d66ca0f33" dependencies = [ "ahash", "arrow", + "arrow-array", "datafusion-common", - "lazy_static", "sqlparser", "strum 0.25.0", "strum_macros 0.25.1", @@ -632,8 +708,8 @@ dependencies = [ [[package]] name = "datafusion-optimizer" -version = "27.0.0" -source = "git+https://github.com/CeresDB/arrow-datafusion.git?rev=a6dcd943051a083693c352c6b4279156548490a0#a6dcd943051a083693c352c6b4279156548490a0" +version = "32.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=219cfb4ccb36045c73409127db51377d66ca0f33#219cfb4ccb36045c73409127db51377d66ca0f33" dependencies = [ "arrow", "async-trait", @@ -649,46 +725,71 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" -version = "27.0.0" -source = "git+https://github.com/CeresDB/arrow-datafusion.git?rev=a6dcd943051a083693c352c6b4279156548490a0#a6dcd943051a083693c352c6b4279156548490a0" +version = "32.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=219cfb4ccb36045c73409127db51377d66ca0f33#219cfb4ccb36045c73409127db51377d66ca0f33" dependencies = [ "ahash", "arrow", "arrow-array", "arrow-buffer", "arrow-schema", + "base64 0.21.2", + "blake2", + "blake3", "chrono", "datafusion-common", "datafusion-expr", - "datafusion-row", "half", "hashbrown 0.14.0", + "hex", "indexmap 2.0.0", "itertools 0.11.0", - "lazy_static", "libc", "log", + "md-5", "paste", "petgraph", "rand", + "regex", + "sha2", + "unicode-segmentation", "uuid", ] [[package]] -name = "datafusion-row" -version = "27.0.0" -source = "git+https://github.com/CeresDB/arrow-datafusion.git?rev=a6dcd943051a083693c352c6b4279156548490a0#a6dcd943051a083693c352c6b4279156548490a0" +name = "datafusion-physical-plan" +version = "32.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=219cfb4ccb36045c73409127db51377d66ca0f33#219cfb4ccb36045c73409127db51377d66ca0f33" dependencies = [ + "ahash", "arrow", + "arrow-array", + "arrow-buffer", + "arrow-schema", + "async-trait", + "chrono", "datafusion-common", - "paste", + "datafusion-execution", + "datafusion-expr", + "datafusion-physical-expr", + "futures", + "half", + "hashbrown 0.14.0", + "indexmap 2.0.0", + "itertools 0.11.0", + "log", + "once_cell", + "parking_lot", + "pin-project-lite", "rand", + "tokio", + "uuid", ] [[package]] name = "datafusion-sql" -version = "27.0.0" -source = "git+https://github.com/CeresDB/arrow-datafusion.git?rev=a6dcd943051a083693c352c6b4279156548490a0#a6dcd943051a083693c352c6b4279156548490a0" +version = "32.0.0" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=219cfb4ccb36045c73409127db51377d66ca0f33#219cfb4ccb36045c73409127db51377d66ca0f33" dependencies = [ "arrow", "arrow-schema", @@ -712,6 +813,17 @@ dependencies = [ "tokio-stream", ] +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "doc-comment" version = "0.3.3" @@ -863,7 +975,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.38", ] [[package]] @@ -909,6 +1021,16 @@ dependencies = [ "tonic-build", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.2.10" @@ -982,6 +1104,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "humantime" version = "2.1.0" @@ -1326,6 +1454,16 @@ dependencies = [ "regex-automata", ] +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + [[package]] name = "memchr" version = "2.5.0" @@ -1375,9 +1513,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" dependencies = [ "num-bigint", "num-complex", @@ -1462,16 +1600,16 @@ dependencies = [ [[package]] name = "object_store" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27c776db4f332b571958444982ff641d2531417a326ca368995073b639205d58" +checksum = "f930c88a43b1c3f6e776dfe495b4afab89882dbc81530c632db2ed65451ebcb4" dependencies = [ "async-trait", "bytes", "chrono", "futures", "humantime", - "itertools 0.10.5", + "itertools 0.11.0", "parking_lot", "percent-encoding", "snafu", @@ -1537,9 +1675,9 @@ dependencies = [ [[package]] name = "parquet" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7267a9607c3f955d4d0ac41b88a67cecc0d8d009173ad3da390699a6cb3750" +checksum = "0463cc3b256d5f50408c49a4be3a16674f4c8ceef60941709620a062b1f6bf4d" dependencies = [ "ahash", "arrow-array", @@ -1692,7 +1830,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.38", ] [[package]] @@ -1737,9 +1875,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" dependencies = [ "unicode-ident", ] @@ -1818,9 +1956,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1987,7 +2125,7 @@ checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.38", ] [[package]] @@ -2001,6 +2139,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sharded-slab" version = "0.1.4" @@ -2067,9 +2216,9 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "sqlparser" -version = "0.35.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca597d77c98894be1f965f2e4e2d2a61575d4998088e655476c73715c54b2b43" +checksum = "0272b7bb0a225320170c99901b4b5fb3a4384e255a7f2cc228f61e2ba3893e75" dependencies = [ "log", "sqlparser_derive", @@ -2130,9 +2279,15 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.22", + "syn 2.0.38", ] +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + [[package]] name = "syn" version = "1.0.109" @@ -2146,9 +2301,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.22" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -2251,7 +2406,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.38", ] [[package]] @@ -2311,7 +2466,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.38", ] [[package]] @@ -2363,6 +2518,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + [[package]] name = "unicode-bidi" version = "0.3.13" @@ -2384,6 +2545,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + [[package]] name = "unicode-width" version = "0.1.10" @@ -2459,7 +2626,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -2481,7 +2648,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/Cargo.toml b/Cargo.toml index 66ac3b2..0d744ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = ["datafusion_util", "influxdb_influxql_parser", "iox_query_influxql", "observability_deps", "schema", "test_helpers"] +resolver = "2" [workspace.package] version = "0.1.0" @@ -8,6 +9,6 @@ edition = "2021" license = "MIT OR Apache-2.0" [workspace.dependencies] -arrow = { version = "43.0.0" } -datafusion = { git = "https://github.com/CeresDB/arrow-datafusion.git", rev = "9c3a537e25e5ab3299922864034f67fb2f79805d", default-features = false } +arrow = { version = "47.0.0" } +datafusion = { git = "https://github.com/apache/arrow-datafusion.git", rev = "219cfb4ccb36045c73409127db51377d66ca0f33", default-features = false } hashbrown = { version = "0.13.2" } diff --git a/arrow_util/Cargo.toml b/arrow_util/Cargo.toml index 2202bd4..89b8897 100644 --- a/arrow_util/Cargo.toml +++ b/arrow_util/Cargo.toml @@ -8,8 +8,7 @@ license.workspace = true [dependencies] ahash = { version = "0.8", default-features = false, features = ["runtime-rng"] } -# need dyn_cmp_dict feature for comparing dictionary arrays -arrow = { workspace = true, features = ["prettyprint", "dyn_cmp_dict"] } +arrow = { workspace = true, features = ["prettyprint"] } # used by arrow anyway (needed for printing workaround) chrono = { version = "0.4", default-features = false } comfy-table = { version = "6.1", default-features = false } diff --git a/arrow_util/src/display.rs b/arrow_util/src/display.rs index d723d12..cba4b91 100644 --- a/arrow_util/src/display.rs +++ b/arrow_util/src/display.rs @@ -40,7 +40,7 @@ fn array_value_to_string(column: &ArrayRef, row: usize) -> Result { ) })?; // treat as UTC - let ts = DateTime::::from_utc(ts, Utc); + let ts = DateTime::::from_naive_utc_and_offset(ts, Utc); // convert to string in preferred influx format let use_z = true; Ok(ts.to_rfc3339_opts(SecondsFormat::AutoSi, use_z)) diff --git a/iox_query/src/exec/gapfill/algo.rs b/iox_query/src/exec/gapfill/algo.rs index 9040f83..511bd5a 100644 --- a/iox_query/src/exec/gapfill/algo.rs +++ b/iox_query/src/exec/gapfill/algo.rs @@ -6,8 +6,8 @@ mod interpolate; use std::{ops::Range, sync::Arc}; use arrow::{ - array::{Array, ArrayRef, TimestampNanosecondArray, UInt64Array}, - compute::{kernels::take, SortColumn}, + array::{Array, ArrayRef, PrimitiveArray, TimestampNanosecondArray, UInt64Array}, + compute::kernels::take, datatypes::SchemaRef, record_batch::RecordBatch, }; @@ -151,13 +151,11 @@ impl GapFiller { let sort_columns = group_arr .iter() - .map(|(_, arr)| SortColumn { - values: Arc::clone(arr), - options: None, - }) + .map(|(_, arr)| Arc::clone(arr)) .collect::>(); - let mut ranges = arrow::compute::lexicographical_partition_ranges(&sort_columns) - .map_err(DataFusionError::ArrowError)?; + let mut ranges = arrow::compute::partition(&sort_columns)? + .ranges() + .into_iter(); let mut series_ends = vec![]; let mut cursor = self.cursor.clone_for_aggr_col(None)?; @@ -941,7 +939,7 @@ impl StashedAggrBuilder<'_> { /// `input_aggr_array` at `offset` for use with the [`interleave`](arrow::compute::interleave) /// kernel. fn create_stash(input_aggr_array: &ArrayRef, offset: u64) -> Result { - let take_arr = vec![None, Some(offset)].into(); + let take_arr: PrimitiveArray<_> = vec![None, Some(offset)].into(); let stash = take::take(input_aggr_array, &take_arr, None).map_err(DataFusionError::ArrowError)?; Ok(stash) diff --git a/iox_query/src/exec/gapfill/exec_tests.rs b/iox_query/src/exec/gapfill/exec_tests.rs index e2f8789..e10c996 100644 --- a/iox_query/src/exec/gapfill/exec_tests.rs +++ b/iox_query/src/exec/gapfill/exec_tests.rs @@ -1083,7 +1083,7 @@ struct TestCase { impl TestCase { fn run(self) -> Result> { block_on(async { - let session_ctx = SessionContext::with_config( + let session_ctx = SessionContext::new_with_config( SessionConfig::default().with_batch_size(self.output_batch_size), ) .into(); @@ -1093,7 +1093,7 @@ impl TestCase { fn run_with_memory_limit(self, limit: usize) -> Result> { block_on(async { - let session_ctx = SessionContext::with_config_rt( + let session_ctx = SessionContext::new_with_config_rt( SessionConfig::default().with_batch_size(self.output_batch_size), RuntimeEnv::new(RuntimeConfig::default().with_memory_limit(limit, 1.0))?.into(), ) diff --git a/iox_query/src/exec/split.rs b/iox_query/src/exec/split.rs index d30a4bc..a22dd15 100644 --- a/iox_query/src/exec/split.rs +++ b/iox_query/src/exec/split.rs @@ -490,7 +490,7 @@ fn negate(v: &ColumnarValue) -> Result { } else { let msg = format!( "Expected boolean literal, but got type {:?}", - val.get_datatype() + val.data_type() ); Err(DataFusionError::Internal(msg)) } @@ -515,8 +515,8 @@ fn and(left: &ColumnarValue, right: &ColumnarValue) -> Result { } else { let msg = format!( "Expected two boolean literals, but got type {:?} and type {:?}", - val_left.get_datatype(), - val_right.get_datatype() + val_left.data_type(), + val_right.data_type() ); Err(DataFusionError::Internal(msg)) } diff --git a/iox_query/src/logical_optimizer/handle_gapfill.rs b/iox_query/src/logical_optimizer/handle_gapfill.rs index 999e536..6d59d31 100644 --- a/iox_query/src/logical_optimizer/handle_gapfill.rs +++ b/iox_query/src/logical_optimizer/handle_gapfill.rs @@ -193,7 +193,12 @@ fn build_gapfill_node( let time_column = col(new_aggr_plan.schema().fields()[date_bin_gapfill_index].qualified_column()); - let aggr = Aggregate::try_from_plan(&new_aggr_plan)?; + let aggr = match &new_aggr_plan { + LogicalPlan::Aggregate(it) => Ok(it), + _ => Err(DataFusionError::Plan( + "Could not coerce into Aggregate!".to_string(), + )), + }?; let mut new_group_expr: Vec<_> = aggr .schema .fields() @@ -363,7 +368,7 @@ fn handle_projection(proj: &Projection) -> Result> { }) else { // If this is not a projection that is a parent to a GapFill node, // then there is nothing to do. - return Ok(None) + return Ok(None); }; let fill_cols: Vec<(&Expr, FillStrategy)> = proj_exprs diff --git a/iox_query/src/logical_optimizer/influx_regex_to_datafusion_regex.rs b/iox_query/src/logical_optimizer/influx_regex_to_datafusion_regex.rs index 799e382..75ae7d0 100644 --- a/iox_query/src/logical_optimizer/influx_regex_to_datafusion_regex.rs +++ b/iox_query/src/logical_optimizer/influx_regex_to_datafusion_regex.rs @@ -2,8 +2,7 @@ use datafusion::{ common::{tree_node::TreeNodeRewriter, DFSchema}, error::DataFusionError, logical_expr::{ - expr::ScalarUDF, expr_rewriter::rewrite_preserving_name, utils::from_plan, LogicalPlan, - Operator, + expr::ScalarUDF, expr_rewriter::rewrite_preserving_name, LogicalPlan, Operator, }, optimizer::{OptimizerConfig, OptimizerRule}, prelude::{binary_expr, lit, Expr}, @@ -67,7 +66,7 @@ fn optimize(plan: &LogicalPlan) -> Result { .map(|expr| rewrite_preserving_name(expr, &mut expr_rewriter)) .collect::, DataFusionError>>()?; - from_plan(plan, new_exprs.as_slice(), new_inputs.as_slice()) + plan.with_new_exprs(new_exprs, &new_inputs) } impl TreeNodeRewriter for InfluxRegexToDataFusionRegex { diff --git a/iox_query_influxql/src/plan/planner.rs b/iox_query_influxql/src/plan/planner.rs index 94b915b..3781c5a 100644 --- a/iox_query_influxql/src/plan/planner.rs +++ b/iox_query_influxql/src/plan/planner.rs @@ -23,10 +23,10 @@ use datafusion::logical_expr::logical_plan::Analyze; use datafusion::logical_expr::utils::{expr_as_column_expr, find_aggregate_exprs}; use datafusion::logical_expr::{ binary_expr, col, date_bin, expr, expr::WindowFunction, lit, lit_timestamp_nano, now, - window_function, Aggregate, AggregateFunction, AggregateUDF, Between, BinaryExpr, - BuiltInWindowFunction, BuiltinScalarFunction, EmptyRelation, Explain, Expr, ExprSchemable, - Extension, LogicalPlan, LogicalPlanBuilder, Operator, PlanType, ScalarUDF, TableSource, - ToStringifiedPlan, WindowFrame, WindowFrameBound, WindowFrameUnits, + window_function, AggregateFunction, AggregateUDF, Between, BinaryExpr, BuiltInWindowFunction, + BuiltinScalarFunction, EmptyRelation, Explain, Expr, ExprSchemable, Extension, LogicalPlan, + LogicalPlanBuilder, Operator, PlanType, ScalarUDF, TableSource, ToStringifiedPlan, WindowFrame, + WindowFrameBound, WindowFrameUnits, }; use datafusion_util::{lit_dict, AsExpr}; use generated_types::influxdata::iox::querier::v1::InfluxQlMetadata; @@ -561,7 +561,9 @@ impl<'a> InfluxQLToLogicalPlan<'a> { } let Some(time_column_index) = find_time_column_index(fields) else { - return Err(DataFusionError::Internal("unable to find time column".to_owned())) + return Err(DataFusionError::Internal( + "unable to find time column".to_owned(), + )); }; // Find a list of unique aggregate expressions from the projection. @@ -1153,7 +1155,10 @@ impl<'a> InfluxQLToLogicalPlan<'a> { MeasurementSelection::Subquery(_) => Err(DataFusionError::NotImplemented( "subquery in FROM clause".into(), )), - }? else { continue }; + }? + else { + continue; + }; table_projs.push_back(table_proj); } Ok(table_projs) @@ -1230,7 +1235,12 @@ fn build_gap_fill_node( ))); }; - let aggr = Aggregate::try_from_plan(&input)?; + let aggr = match &input { + LogicalPlan::Aggregate(ref it) => Ok(it), + _ => Err(DataFusionError::Plan( + "Could not coerce into Aggregate!".to_string(), + )), + }?; let mut new_group_expr: Vec<_> = aggr .schema .fields() diff --git a/iox_query_influxql/src/plan/planner_time_range_expression.rs b/iox_query_influxql/src/plan/planner_time_range_expression.rs index dcf7a95..b0edcde 100644 --- a/iox_query_influxql/src/plan/planner_time_range_expression.rs +++ b/iox_query_influxql/src/plan/planner_time_range_expression.rs @@ -143,7 +143,7 @@ fn reduce_expr(expr: &Expr, tz: Option) -> ExprResult { Literal::Float(v) => Ok(lit(*v)), Literal::String(v) => Ok(lit(v.clone())), Literal::Timestamp(v) => Ok(lit(ScalarValue::TimestampNanosecond( - Some(v.timestamp_nanos()), + v.timestamp_nanos_opt(), None, ))), Literal::Duration(v) => Ok(lit(ScalarValue::new_interval_mdn(0, 0, **v))), @@ -415,7 +415,7 @@ fn reduce_binary_lhs_string_df_expr( fn parse_timestamp_nanos(s: &str, tz: Option) -> Result { parse_timestamp(s, tz) - .map(|ts| ts.timestamp_nanos()) + .map(|ts| ts.timestamp_nanos_opt().unwrap()) .map_err(|_| DataFusionError::Plan(format!("'{s}' is not a valid timestamp"))) } diff --git a/iox_query_influxql/src/plan/timestamp.rs b/iox_query_influxql/src/plan/timestamp.rs index 0776413..c2f66f2 100644 --- a/iox_query_influxql/src/plan/timestamp.rs +++ b/iox_query_influxql/src/plan/timestamp.rs @@ -1,6 +1,5 @@ use chrono::{DateTime, FixedOffset, NaiveDate, NaiveDateTime, NaiveTime, Offset, TimeZone}; use datafusion::common::{DataFusionError, Result}; - /// Parse the timestamp string and return a DateTime in UTC. fn parse_timestamp_utc(s: &str) -> Result> { // 1a. Try a date time format string with nanosecond precision and then without @@ -18,7 +17,7 @@ fn parse_timestamp_utc(s: &str) -> Result> { NaiveDate::parse_from_str(s, "%Y-%m-%d") .map(|nd| nd.and_time(NaiveTime::default())), ) - .map(|ts| DateTime::from_utc(ts, chrono::Utc.fix())) + .map(|ts| DateTime::from_naive_utc_and_offset(ts, chrono::Utc.fix())) .map_err(|_| DataFusionError::Plan("invalid timestamp string".into())) } diff --git a/iox_query_influxql/src/plan/util_copy.rs b/iox_query_influxql/src/plan/util_copy.rs index b88582f..c37ff09 100644 --- a/iox_query_influxql/src/plan/util_copy.rs +++ b/iox_query_influxql/src/plan/util_copy.rs @@ -273,10 +273,10 @@ where })), Expr::Wildcard => Ok(Expr::Wildcard), Expr::QualifiedWildcard { .. } => Ok(expr.clone()), - Expr::GetIndexedField(GetIndexedField { key, expr }) => { + Expr::GetIndexedField(GetIndexedField { expr, field }) => { Ok(Expr::GetIndexedField(GetIndexedField::new( Box::new(clone_with_replacement(expr.as_ref(), replacement_fn)?), - key.clone(), + field.clone(), ))) } Expr::GroupingSet(set) => match set { diff --git a/query_functions/src/selectors/internal.rs b/query_functions/src/selectors/internal.rs index c2d9262..af66b97 100644 --- a/query_functions/src/selectors/internal.rs +++ b/query_functions/src/selectors/internal.rs @@ -109,8 +109,8 @@ impl ToState for &str { fn make_scalar_struct(data_fields: Vec) -> ScalarValue { let fields = vec![ - Field::new("value", data_fields[0].get_datatype(), true), - Field::new("time", data_fields[1].get_datatype(), true), + Field::new("value", data_fields[0].data_type(), true), + Field::new("time", data_fields[1].data_type(), true), ]; ScalarValue::Struct(Some(data_fields), Fields::from(fields)) diff --git a/query_functions/src/window/internal.rs b/query_functions/src/window/internal.rs index 8061507..7c08c4b 100644 --- a/query_functions/src/window/internal.rs +++ b/query_functions/src/window/internal.rs @@ -146,7 +146,7 @@ fn timestamp_to_datetime(ts: i64) -> DateTime { // Note that nsec as u32 is safe here because modulo on a negative ts value // still produces a positive remainder. let datetime = NaiveDateTime::from_timestamp_opt(secs, nsec as u32).expect("ts in range"); - DateTime::from_utc(datetime, Utc) + DateTime::from_naive_utc_and_offset(datetime, Utc) } /// Original: @@ -198,8 +198,8 @@ fn to_timestamp_nanos_utc( NaiveTime::from_hms_nano_opt(hour, min, sec, nano).expect("hour-min-sec-nano in range"); let ndatetime = NaiveDateTime::new(ndate, ntime); - let datetime = DateTime::::from_utc(ndatetime, Utc); - datetime.timestamp_nanos() + let datetime = DateTime::::from_naive_utc_and_offset(ndatetime, Utc); + datetime.timestamp_nanos_opt().unwrap() } impl Add for i64 { @@ -386,7 +386,7 @@ mod tests { /// t: mustParseTime("1970-02-01T00:00:00Z"), fn must_parse_time(s: &str) -> i64 { let datetime = DateTime::parse_from_rfc3339(s).unwrap(); - datetime.timestamp_nanos() + datetime.timestamp_nanos_opt().unwrap() } /// TestWindow_GetEarliestBounds diff --git a/rust-toolchain b/rust-toolchain index 3f36906..5f169ab 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2023-02-02 +nightly-2023-08-28 diff --git a/test_helpers/Cargo.toml b/test_helpers/Cargo.toml index 86bba9d..9b77324 100644 --- a/test_helpers/Cargo.toml +++ b/test_helpers/Cargo.toml @@ -12,7 +12,7 @@ tempfile = "3.4.0" tracing-log = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } observability_deps = { path = "../observability_deps" } -async-trait = { version = "0.1.66", optional = true } +async-trait = { version = "0.1.73", optional = true } tokio = { version = "1.26.0", optional = true, default_features = false, features = ["time"] } [features]