diff --git a/Cargo.lock b/Cargo.lock index 85a2585282..7958e9739b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -947,7 +947,7 @@ dependencies = [ "common-telemetry", "common-test-util", "digest 0.10.7", - "sha1", + "sha1 0.10.6", "snafu 0.8.6", "sql", "tokio", @@ -987,9 +987,9 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.16.3" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ec6fb3fe69024a75fa7e1bfb48aa6cf59706a101658ea01bfd33b2b248a038f" +checksum = "5ec2f1fc3ec205783a5da9a7e6c1509cc69dedf09a1949e412c1e18469326d00" dependencies = [ "aws-lc-sys", "untrusted 0.7.1", @@ -998,9 +998,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.40.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50037ee5e1e41e7b8f9d161680a725bd1626cb6f8c7e901f91f942850852fe7" +checksum = "1a2f9779ce85b93ab6170dd940ad0169b5766ff848247aff13bb788b832fe3f4" dependencies = [ "cc", "cmake", @@ -1278,7 +1278,7 @@ version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f72209734318d0b619a5e0f5129918b848c416e122a3c4ce054e03cb87b726f" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "cexpr", "clang-sys", "itertools 0.13.0", @@ -1313,9 +1313,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.11.1" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" +checksum = "84d7ced0ae9557296835c32bf1b1e02b44c746701f898460fb000d7eaa84f00a" dependencies = [ "serde_core", ] @@ -1688,9 +1688,9 @@ checksum = "060303ef31ef4a522737e1b1ab68c67916f2a787bb2f4f54f383279adba962b5" [[package]] name = "cedarwood" -version = "0.4.6" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d910bedd62c24733263d0bed247460853c9d22e8956bd4cd964302095e04e90" +checksum = "c0524a528a6a0288df1863c3c20fe92c301875b4941e7b6c4b394ab08c5a4c55" dependencies = [ "smallvec", ] @@ -1701,12 +1701,6 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f4c707c6a209cbe82d10abd08e1ea8995e9ea937d2550646e02798948992be0" -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - [[package]] name = "cexpr" version = "0.6.0" @@ -1987,7 +1981,7 @@ dependencies = [ "paste", "query", "rand 0.9.4", - "reqwest 0.13.2", + "reqwest 0.13.4", "serde", "serde_json", "servers", @@ -2147,7 +2141,7 @@ dependencies = [ "query", "rand 0.9.4", "regex", - "reqwest 0.13.2", + "reqwest 0.13.4", "serde", "serde_json", "servers", @@ -2167,6 +2161,12 @@ dependencies = [ "tracing-appender", ] +[[package]] +name = "cmov" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a" + [[package]] name = "codespan-reporting" version = "0.12.0" @@ -2454,7 +2454,7 @@ dependencies = [ "common-test-util", "common-version", "hyper 0.14.32", - "reqwest 0.13.2", + "reqwest 0.13.4", "serde", "tempfile", "tokio", @@ -2929,7 +2929,7 @@ dependencies = [ "hex", "lazy_static", "num_enum 0.6.1", - "sha1", + "sha1 0.10.6", ] [[package]] @@ -3367,9 +3367,9 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77727bb15fa921304124b128af125e7e3b968275d1b108b379190264f4423710" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" dependencies = [ "hybrid-array", ] @@ -3412,9 +3412,9 @@ dependencies = [ [[package]] name = "ctor" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "378f0974ae2468eaf63aa036dbe9c926b0dc7ea64c156f2ea618bc2f75b934f0" +checksum = "01334b89b69ff726750c5ce5073fc8bd860e99aa9a8fc5ca11b04730e3aee97a" dependencies = [ "link-section", "linktime-proc-macro", @@ -3429,6 +3429,15 @@ dependencies = [ "cipher", ] +[[package]] +name = "ctutils" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e" +dependencies = [ + "cmov", +] + [[package]] name = "cxx" version = "1.0.190" @@ -4394,7 +4403,7 @@ dependencies = [ "prometheus 0.14.0", "prost 0.14.1", "query", - "reqwest 0.13.2", + "reqwest 0.13.4", "serde", "serde_json", "servers", @@ -4710,7 +4719,8 @@ checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" dependencies = [ "block-buffer 0.12.0", "const-oid 0.10.2", - "crypto-common 0.2.1", + "crypto-common 0.2.2", + "ctutils", ] [[package]] @@ -5223,7 +5233,7 @@ version = "25.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1045398c1bfd89168b5fd3f1fc11f6e70b34f6f66300c87d44d3de849463abf1" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "rustc_version", ] @@ -5497,7 +5507,7 @@ dependencies = [ "prost 0.14.1", "query", "rand 0.9.4", - "reqwest 0.13.2", + "reqwest 0.13.4", "serde", "serde_json", "servers", @@ -5891,7 +5901,7 @@ version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b88256088d75a56f8ecfa070513a775dd9107f6530ef14919dac831af9cfe2b" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "libc", "libgit2-sys", "log", @@ -6113,7 +6123,7 @@ dependencies = [ "http 1.3.1", "httpdate", "mime", - "sha1", + "sha1 0.10.6", ] [[package]] @@ -6165,7 +6175,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "hmac", + "hmac 0.12.1", ] [[package]] @@ -6177,6 +6187,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "hmac" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" +dependencies = [ + "digest 0.11.3", +] + [[package]] name = "home" version = "0.5.11" @@ -6322,9 +6341,9 @@ dependencies = [ [[package]] name = "hybrid-array" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3944cf8cf766b40e2a1a333ee5e9b563f854d5fa49d6a8ca2764e97c6eddb214" +checksum = "9155a582abd142abc056962c29e3ce5ff2ad5469f4246b537ed42c5deba857da" dependencies = [ "typenum", ] @@ -6872,7 +6891,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "inotify-sys", "libc", ] @@ -6950,16 +6969,6 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" -[[package]] -name = "iri-string" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "is-terminal" version = "0.4.16" @@ -7039,19 +7048,20 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jieba-macros" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "661344b2412fb00aee1841d2405c9a31f7c91cf6e578a8e953647c43dd1a8b0a" +checksum = "46adade69b634535a8f495cf87710ed893cff53e1dbc9dd750c2ab81c5defb82" dependencies = [ "phf_codegen 0.13.1", ] [[package]] name = "jieba-rs" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ef90d6209fcff084a01b488c4199d882e3764b15ff0e7a6b5d7efaa46e1e4f" +checksum = "11b53580aaa8ec8b713da271da434f8947409242c537a9ab3f7b76bdbb19e8a9" dependencies = [ + "bytecount", "cedarwood", "include-flate", "jieba-macros", @@ -7062,9 +7072,9 @@ dependencies = [ [[package]] name = "jiff" -version = "0.2.23" +version = "0.2.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" +checksum = "4603d3033e49e2b0e31229fcab20a5d40089c607d975cd9c80551dc69eed9102" dependencies = [ "jiff-static", "jiff-tzdb-platform", @@ -7074,14 +7084,14 @@ dependencies = [ "portable-atomic-util", "serde_core", "wasm-bindgen", - "windows-sys 0.61.2", + "windows-link 0.2.1", ] [[package]] name = "jiff-static" -version = "0.2.23" +version = "0.2.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" +checksum = "782d32378dddf207193ac91cefb848ad41abb58195c95168e1291227a0832b47" dependencies = [ "proc-macro2", "quote", @@ -7103,22 +7113,6 @@ dependencies = [ "jiff-tzdb", ] -[[package]] -name = "jni" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" -dependencies = [ - "cesu8", - "cfg-if", - "combine", - "jni-sys 0.3.1", - "log", - "thiserror 1.0.69", - "walkdir", - "windows-sys 0.45.0", -] - [[package]] name = "jni" version = "0.22.4" @@ -7128,7 +7122,7 @@ dependencies = [ "cfg-if", "combine", "jni-macros", - "jni-sys 0.4.1", + "jni-sys", "log", "simd_cesu8", "thiserror 2.0.17", @@ -7149,15 +7143,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "jni-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" -dependencies = [ - "jni-sys 0.4.1", -] - [[package]] name = "jni-sys" version = "0.4.1" @@ -7189,9 +7174,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.95" +version = "0.3.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" +checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11" dependencies = [ "cfg-if", "futures-util", @@ -7304,23 +7289,6 @@ dependencies = [ "uuid-simd", ] -[[package]] -name = "jsonwebtoken" -version = "10.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0529410abe238729a60b108898784df8984c87f6054c9c4fcacc47e4803c1ce1" -dependencies = [ - "aws-lc-rs", - "base64 0.22.1", - "getrandom 0.2.16", - "js-sys", - "pem", - "serde", - "serde_json", - "signature", - "simple_asn1", -] - [[package]] name = "k8s-openapi" version = "0.22.0" @@ -7747,7 +7715,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "libc", "redox_syscall 0.5.13", ] @@ -7785,9 +7753,9 @@ dependencies = [ [[package]] name = "link-section" -version = "0.16.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8600ca3dbe044f07955b443ff606c50f45295b863289bbe7d0844d50cf11e4" +checksum = "014e440054ce8170890229eeef5bcda955305e056ec713de40ed366944483f09" [[package]] name = "linked-hash-map" @@ -7797,9 +7765,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linktime-proc-macro" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44cd706ff0d503ee32b2071166510ca27e281228de10cd3aa8d35ff94560f81" +checksum = "8c7b0a3383c2a1002d11349c92c85a666a5fb679e96c79d782cf0dbe557fd6ee" [[package]] name = "linux-raw-sys" @@ -8134,9 +8102,9 @@ checksum = "ae960838283323069879657ca3de837e9f7bbb4c7bf6ea7f1b290d5e9476d2e0" [[package]] name = "mea" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6747f54621d156e1b47eb6b25f39a941b9fc347f98f67d25d8881ff99e8ed832" +checksum = "2640d335e7273dacdcf51044026139b2e269c3bb0dfc3f8cb3496b85e3f6a42c" dependencies = [ "slab", ] @@ -8289,7 +8257,7 @@ dependencies = [ "toml 0.8.23", "tonic 0.14.2", "tower 0.5.2", - "tower-http 0.6.8", + "tower-http 0.6.11", "tracing", "tracing-subscriber", "typetag", @@ -8716,7 +8684,7 @@ dependencies = [ "base64 0.21.7", "bigdecimal 0.4.8", "bindgen", - "bitflags 2.11.1", + "bitflags 2.12.1", "bitvec", "btoi", "byteorder", @@ -8737,7 +8705,7 @@ dependencies = [ "saturating", "serde", "serde_json", - "sha1", + "sha1 0.10.6", "sha2 0.10.9", "smallvec", "subprocess", @@ -8754,7 +8722,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34a9141e735d5bb02414a7ac03add09522466d4db65bdd827069f76ae0850e58" dependencies = [ "base64 0.22.1", - "bitflags 2.11.1", + "bitflags 2.12.1", "btoi", "byteorder", "bytes", @@ -8771,7 +8739,7 @@ dependencies = [ "saturating", "serde", "serde_json", - "sha1", + "sha1 0.10.6", "sha2 0.10.9", "subprocess", "thiserror 1.0.69", @@ -8872,7 +8840,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "cfg-if", "cfg_aliases 0.1.1", "libc", @@ -8884,7 +8852,7 @@ version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "cfg-if", "cfg_aliases 0.2.1", "libc", @@ -8939,7 +8907,7 @@ version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "filetime", "fsevent-sys", "inotify", @@ -9203,7 +9171,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "objc2", ] @@ -9247,7 +9215,7 @@ dependencies = [ "opendal", "prometheus 0.14.0", "rand 0.9.4", - "reqwest 0.13.2", + "reqwest 0.13.4", "serde", "snafu 0.8.6", "tempfile", @@ -9342,7 +9310,7 @@ version = "6.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "336b9c63443aceef14bea841b899035ae3abe89b7c486aaf4c5bd8aafedac3f0" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "libc", "once_cell", "onig_sys", @@ -9411,7 +9379,7 @@ dependencies = [ "percent-encoding", "quick-xml 0.39.4", "reqsign-core", - "reqwest 0.13.2", + "reqwest 0.13.4", "serde", "serde_json", "tokio", @@ -9684,7 +9652,7 @@ dependencies = [ "bytes", "http 1.3.1", "opentelemetry 0.30.0", - "reqwest 0.12.28", + "reqwest 0.12.24", ] [[package]] @@ -9699,7 +9667,7 @@ dependencies = [ "opentelemetry-proto 0.30.0", "opentelemetry_sdk 0.30.0", "prost 0.13.5", - "reqwest 0.12.28", + "reqwest 0.12.24", "thiserror 2.0.17", "tokio", "tonic 0.13.1", @@ -10215,7 +10183,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", - "hmac", + "hmac 0.12.1", ] [[package]] @@ -10734,7 +10702,7 @@ dependencies = [ "byteorder", "bytes", "fallible-iterator", - "hmac", + "hmac 0.12.1", "md-5 0.10.6", "memchr", "rand 0.9.4", @@ -10955,7 +10923,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "hex", "procfs-core", "rustix 0.38.44", @@ -10967,7 +10935,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "hex", ] @@ -11062,7 +11030,7 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bee689443a2bd0a16ab0348b52ee43e3b2d1b1f931c8aa5c9f8de4c86fbe8c40" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "num-traits", "rand 0.9.4", "rand_chacha 0.9.0", @@ -11376,7 +11344,7 @@ dependencies = [ "async-walkdir", "auto_impl", "base64 0.22.1", - "bitflags 2.11.1", + "bitflags 2.12.1", "bytes", "common-base", "common-error", @@ -11405,7 +11373,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e8bbe1a966bd2f362681a44f6edce3c2310ac21e4d5067a6e7ec396297a6ea0" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "memchr", "unicase", ] @@ -11537,6 +11505,16 @@ dependencies = [ "serde", ] +[[package]] +name = "quick-xml" +version = "0.40.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2474bd2e5029e7ccb6abb2ba48cf2383a333851dedf495901544281590c7da7f" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "quinn" version = "0.11.8" @@ -11818,7 +11796,7 @@ version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", ] [[package]] @@ -11958,9 +11936,9 @@ checksum = "51743d3e274e2b18df81c4dc6caf8a5b8e15dbe799e0dca05c7617380094e884" [[package]] name = "reqsign-aliyun-oss" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ac2757f3140aa2e213b554148ae0b52733e624fc6723f0cc6bb3d440176c95" +checksum = "372266b4733756738eeb199a98188037d27a0989980e2600ae7ce1faf00a867d" dependencies = [ "anyhow", "form_urlencoded", @@ -11975,37 +11953,37 @@ dependencies = [ [[package]] name = "reqsign-aws-v4" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44eaca382e94505a49f1a4849658d153aebf79d9c1a58e5dd3b10361511e9f43" +checksum = "7b75624bd8a466e37ddc0a7b6c33ac859a85347c153a916e1dd9d0b68338f74a" dependencies = [ "anyhow", "bytes", "form_urlencoded", + "hex", "http 1.3.1", "log", "percent-encoding", - "quick-xml 0.39.4", + "quick-xml 0.40.1", "reqsign-core", "rust-ini 0.21.1", "serde", "serde_json", "serde_urlencoded", - "sha1", + "sha1 0.11.0", ] [[package]] name = "reqsign-azure-storage" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a321980405d596bd34aaf95c4722a3de4128a67fd19e74a81a83aa3fdf082e6" +checksum = "62b96928e73ad984de1d99e382749d09e5dab7dd707b767974f7e40aa926b82f" dependencies = [ "anyhow", "base64 0.22.1", "bytes", "form_urlencoded", "http 1.3.1", - "jsonwebtoken", "log", "pem", "percent-encoding", @@ -12013,14 +11991,14 @@ dependencies = [ "rsa", "serde", "serde_json", - "sha1", + "sha1 0.11.0", ] [[package]] name = "reqsign-core" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10302cf0a7d7e7352ba211fc92c3c5bebf1286153e49cc5aa87348078a8e102" +checksum = "a5fa5cb48808693614d1701fcd3db0b30fa292e0f18e122ae068b6d32eaeed3f" dependencies = [ "anyhow", "base64 0.22.1", @@ -12028,21 +12006,24 @@ dependencies = [ "form_urlencoded", "futures", "hex", - "hmac", + "hmac 0.13.0", "http 1.3.1", "jiff", "log", "percent-encoding", - "sha1", - "sha2 0.10.9", + "rsa", + "serde", + "serde_json", + "sha1 0.11.0", + "sha2 0.11.0", "windows-sys 0.61.2", ] [[package]] name = "reqsign-file-read-tokio" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d89295b3d17abea31851cc8de55d843d89c52132c864963c38d41920613dc5" +checksum = "6a4b6f3a3fd29ffcc99a90aec585a65217783badfd73acddf847b63ae683bda9" dependencies = [ "anyhow", "reqsign-core", @@ -12051,13 +12032,12 @@ dependencies = [ [[package]] name = "reqsign-google" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35cc609b49c69e76ecaceb775a03f792d1ed3e7755ab3548d4534fd801e3242e" +checksum = "eb215d0876a18b6bd9cdd380b589e5292aaa638ca15266de794b1122d898b6b2" dependencies = [ "form_urlencoded", "http 1.3.1", - "jsonwebtoken", "log", "percent-encoding", "reqsign-aws-v4", @@ -12065,15 +12045,14 @@ dependencies = [ "rsa", "serde", "serde_json", - "sha2 0.10.9", "tokio", ] [[package]] name = "reqwest" -version = "0.12.28" +version = "0.12.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f" dependencies = [ "base64 0.22.1", "bytes", @@ -12103,7 +12082,7 @@ dependencies = [ "tokio-rustls", "tokio-util", "tower 0.5.2", - "tower-http 0.6.8", + "tower-http 0.6.11", "tower-service", "url", "wasm-bindgen", @@ -12115,9 +12094,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.13.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" +checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" dependencies = [ "base64 0.22.1", "bytes", @@ -12146,7 +12125,7 @@ dependencies = [ "tokio-rustls", "tokio-util", "tower 0.5.2", - "tower-http 0.6.8", + "tower-http 0.6.11", "tower-service", "url", "wasm-bindgen", @@ -12164,7 +12143,7 @@ dependencies = [ "anyhow", "async-trait", "http 1.3.1", - "reqwest 0.12.28", + "reqwest 0.12.24", "serde", "thiserror 1.0.69", "tower-service", @@ -12182,7 +12161,7 @@ dependencies = [ "getrandom 0.2.16", "http 1.3.1", "hyper 1.6.0", - "reqwest 0.12.28", + "reqwest 0.12.24", "reqwest-middleware", "retry-policies", "thiserror 2.0.17", @@ -12323,7 +12302,7 @@ dependencies = [ "base64 0.22.1", "core2", "digest 0.10.7", - "hmac", + "hmac 0.12.1", "pbkdf2", "rand 0.8.5", "serde", @@ -12525,7 +12504,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "errno", "libc", "linux-raw-sys 0.4.15", @@ -12538,7 +12517,7 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "errno", "libc", "linux-raw-sys 0.9.4", @@ -12607,13 +12586,13 @@ dependencies = [ [[package]] name = "rustls-platform-verifier" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" dependencies = [ "core-foundation 0.10.1", "core-foundation-sys", - "jni 0.21.1", + "jni", "log", "once_cell", "rustls", @@ -12634,9 +12613,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" -version = "0.103.13" +version = "0.103.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" dependencies = [ "aws-lc-rs", "ring", @@ -12656,7 +12635,7 @@ version = "17.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e902948a25149d50edc1a8e0141aad50f54e22ba83ff988cf8f7c9ef07f50564" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "cfg-if", "clipboard-win", "libc", @@ -12842,7 +12821,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -12855,7 +12834,7 @@ version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "core-foundation 0.10.1", "core-foundation-sys", "libc", @@ -13158,7 +13137,7 @@ dependencies = [ "quoted-string", "rand 0.9.4", "regex", - "reqwest 0.13.2", + "reqwest 0.13.4", "rust-embed", "rust_decimal", "rustls", @@ -13189,7 +13168,7 @@ dependencies = [ "tonic-reflection", "tonic-web", "tower 0.5.2", - "tower-http 0.6.8", + "tower-http 0.6.11", "tracing", "tracing-opentelemetry", "urlencoding", @@ -13243,6 +13222,17 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha1" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", +] + [[package]] name = "sha2" version = "0.10.9" @@ -13379,18 +13369,6 @@ dependencies = [ "similar", ] -[[package]] -name = "simple_asn1" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" -dependencies = [ - "num-bigint", - "num-traits", - "thiserror 2.0.17", - "time", -] - [[package]] name = "siphasher" version = "1.0.1" @@ -13630,7 +13608,7 @@ dependencies = [ "local-ip-address", "mysql", "num_cpus", - "reqwest 0.12.28", + "reqwest 0.12.24", "serde", "serde_json", "sha2 0.10.9", @@ -13774,7 +13752,7 @@ checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.11.1", + "bitflags 2.12.1", "byteorder", "bytes", "chrono", @@ -13789,7 +13767,7 @@ dependencies = [ "generic-array", "hex", "hkdf", - "hmac", + "hmac 0.12.1", "itoa", "log", "md-5 0.10.6", @@ -13800,7 +13778,7 @@ dependencies = [ "rsa", "rust_decimal", "serde", - "sha1", + "sha1 0.10.6", "sha2 0.10.9", "smallvec", "sqlx-core", @@ -13818,7 +13796,7 @@ checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.11.1", + "bitflags 2.12.1", "byteorder", "chrono", "crc", @@ -13829,7 +13807,7 @@ dependencies = [ "futures-util", "hex", "hkdf", - "hmac", + "hmac 0.12.1", "home", "itoa", "log", @@ -14468,9 +14446,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.46" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840" +checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973" dependencies = [ "filetime", "libc", @@ -14564,7 +14542,7 @@ dependencies = [ "paste", "rand 0.9.4", "rand_chacha 0.9.0", - "reqwest 0.13.2", + "reqwest 0.13.4", "rustls", "schemars", "serde", @@ -15277,7 +15255,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ "base64 0.21.7", - "bitflags 2.11.1", + "bitflags 2.12.1", "bytes", "http 1.3.1", "http-body 1.0.1", @@ -15291,13 +15269,13 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" dependencies = [ "async-compression", "base64 0.22.1", - "bitflags 2.11.1", + "bitflags 2.12.1", "bytes", "futures-core", "futures-util", @@ -15306,7 +15284,6 @@ dependencies = [ "http-body-util", "http-range-header", "httpdate", - "iri-string", "mime", "mime_guess", "percent-encoding", @@ -15317,6 +15294,7 @@ dependencies = [ "tower-layer", "tower-service", "tracing", + "url", "uuid", ] @@ -15463,9 +15441,9 @@ checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" [[package]] name = "typenum" -version = "1.18.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "typetag" @@ -15826,9 +15804,9 @@ dependencies = [ [[package]] name = "vrl" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925a4d3321b18a200c82c3ec02ee2be2b4bf16db07a5ce7e2a9a888b795ea862" +checksum = "772206835b5bca8719825d2ab9e6fb160cbfce8ac1dc0e5dffe22cbe77254468" dependencies = [ "aes", "aes-siv", @@ -15864,7 +15842,7 @@ dependencies = [ "getrandom 0.3.4", "grok", "hex", - "hmac", + "hmac 0.12.1", "hostname 0.4.1", "iana-time-zone", "idna", @@ -15898,7 +15876,7 @@ dependencies = [ "rand 0.9.4", "regex", "relative-path 2.0.1", - "reqwest 0.12.28", + "reqwest 0.12.24", "reqwest-middleware", "reqwest-retry", "roxmltree", @@ -16000,9 +15978,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.118" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" +checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409" dependencies = [ "cfg-if", "once_cell", @@ -16014,9 +15992,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.68" +version = "0.4.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8" +checksum = "9473dbd2991ae90b6291c3c32c30c6187ac49aa32f9905d1cce280ec1e110b0f" dependencies = [ "js-sys", "wasm-bindgen", @@ -16024,9 +16002,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.118" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -16034,9 +16012,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.118" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e" dependencies = [ "bumpalo", "proc-macro2", @@ -16047,9 +16025,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437" dependencies = [ "unicode-ident", ] @@ -16108,7 +16086,7 @@ version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.12.1", "hashbrown 0.15.4", "indexmap 2.13.0", "semver", @@ -16130,9 +16108,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.95" +version = "0.3.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" +checksum = "6d621441cfc37b84979402712047321980c178f299193a3589d05b99e8763436" dependencies = [ "js-sys", "wasm-bindgen", @@ -16155,7 +16133,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc95580916af1e68ff6a7be07446fc5db73ebf71cf092de939bbf5f7e189f72" dependencies = [ "core-foundation 0.10.1", - "jni 0.22.4", + "jni", "log", "ndk-context", "objc2", @@ -16414,15 +16392,6 @@ dependencies = [ "windows-link 0.1.3", ] -[[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-sys" version = "0.48.0" @@ -16468,21 +16437,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[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.48.5" @@ -16540,12 +16494,6 @@ dependencies = [ "windows-link 0.1.3", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -16564,12 +16512,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -16588,12 +16530,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -16624,12 +16560,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -16648,12 +16578,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -16672,12 +16596,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -16696,12 +16614,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -16805,7 +16717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", - "bitflags 2.11.1", + "bitflags 2.12.1", "indexmap 2.13.0", "log", "serde", diff --git a/src/common/error/src/ext.rs b/src/common/error/src/ext.rs index 3f95c5fe1a..edd49fed35 100644 --- a/src/common/error/src/ext.rs +++ b/src/common/error/src/ext.rs @@ -13,8 +13,11 @@ // limitations under the License. use std::any::Any; +use std::fmt::{Debug, Formatter}; use std::sync::Arc; +use snafu::{FromString, Snafu}; + use crate::status_code::StatusCode; /// Extension to [`Error`](std::error::Error) in std. @@ -116,6 +119,39 @@ impl StackError for Box { } } +/// A simple [Result] of which the error is convertible from [ErrorExt] (which every GreptimeDB +/// error implements). Use this if you are tired of writing `unwrap`s in test codes, that you can +/// use the `?` on all GreptimeDB errors. +pub type WhateverResult = Result; + +#[derive(Snafu)] +#[snafu(display("{inner}"))] +pub struct Whatever { + inner: snafu::Whatever, +} + +impl Debug for Whatever { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.inner) + } +} + +impl From for Whatever { + fn from(e: E) -> Self { + Self { + inner: FromString::without_source(format!("{e:?}")), + } + } +} + +impl From for Whatever { + fn from(s: String) -> Self { + Self { + inner: FromString::without_source(s), + } + } +} + /// An opaque boxed error based on errors that implement [ErrorExt] trait. pub struct BoxedError { inner: Box, diff --git a/src/common/error/tests/ext.rs b/src/common/error/tests/ext.rs index d22ad96a43..c9e6137729 100644 --- a/src/common/error/tests/ext.rs +++ b/src/common/error/tests/ext.rs @@ -14,7 +14,7 @@ use std::any::Any; -use common_error::ext::{ErrorExt, PlainError, StackError}; +use common_error::ext::{ErrorExt, PlainError, StackError, WhateverResult}; use common_error::status_code::StatusCode; use common_macro::stack_trace_debug; use snafu::{Location, ResultExt, Snafu}; @@ -60,6 +60,34 @@ fn transparent_error() -> Result<(), MyError> { Err(plain_error)? } +#[test] +fn test_into_whatever_error() { + fn f(g: fn() -> Result<(), MyError>) -> WhateverResult<()> { + g()?; + Ok(()) + } + + let whatever = f(normal_error).unwrap_err(); + assert_eq!( + normalize_path(&whatever.to_string()), + format!( + r#"0: A normal error with "display" attribute, message "blabla", at {}:55:22 +1: PlainError {{ msg: "", status_code: Unexpected }}"#, + normalize_path(file!()) + ) + ); + + let whatever = f(transparent_error).unwrap_err(); + assert_eq!( + normalize_path(&whatever.to_string()), + format!( + r#"0: , at {}:60:5 +1: PlainError {{ msg: "", status_code: Unexpected }}"#, + normalize_path(file!()) + ) + ); +} + #[test] fn test_output_msg() { let result = normal_error(); diff --git a/src/common/recordbatch/src/ext.rs b/src/common/recordbatch/src/ext.rs new file mode 100644 index 0000000000..f4630160c8 --- /dev/null +++ b/src/common/recordbatch/src/ext.rs @@ -0,0 +1,32 @@ +// Copyright 2023 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use datatypes::arrow::record_batch::RecordBatch; +use datatypes::arrow::util::pretty; + +pub trait RecordBatchExt { + fn pretty_print(&self) -> String; +} + +impl RecordBatchExt for RecordBatch { + fn pretty_print(&self) -> String { + match pretty::pretty_format_batches(std::slice::from_ref(self)) { + Ok(s) => s.to_string(), + Err(e) => format!( + r#"Unable to pretty print, error: "{}". Debug print is: {:?}"#, + e, self, + ), + } + } +} diff --git a/src/common/recordbatch/src/lib.rs b/src/common/recordbatch/src/lib.rs index 629efd6d84..3db3d9c08b 100644 --- a/src/common/recordbatch/src/lib.rs +++ b/src/common/recordbatch/src/lib.rs @@ -17,6 +17,7 @@ pub mod adapter; pub mod cursor; pub mod error; +pub mod ext; pub mod filter; pub mod recordbatch; pub mod util; diff --git a/src/mito2/src/engine/scan_test.rs b/src/mito2/src/engine/scan_test.rs index e4010940fa..2367e87855 100644 --- a/src/mito2/src/engine/scan_test.rs +++ b/src/mito2/src/engine/scan_test.rs @@ -12,11 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::collections::BTreeMap; +use std::collections::{BTreeMap, HashMap}; +use api::helper::encode_json_value; use api::v1::Rows; +use api::v1::helper::row; +use api::v1::value::ValueData; use common_base::readable_size::ReadableSize; -use common_error::ext::ErrorExt; +use common_error::ext::{ErrorExt, WhateverResult}; use common_error::status_code::StatusCode; use common_recordbatch::RecordBatches; use datafusion::physical_plan::metrics::ExecutionPlanMetricsSet; @@ -24,17 +27,135 @@ use datafusion_common::ScalarValue; use datafusion_expr::{col, lit}; use datatypes::arrow::array::AsArray; use datatypes::arrow::datatypes::{Float64Type, TimestampMillisecondType}; +use datatypes::json::value::JsonValue; +use datatypes::prelude::ConcreteDataType; +use datatypes::types::json_type::{JsonNativeType, JsonObjectType}; use futures::TryStreamExt; +use serde_json::json; use store_api::region_engine::{PrepareRequest, RegionEngine, RegionScanner}; use store_api::region_request::RegionRequest; -use store_api::storage::{RegionId, ScanRequest, TimeSeriesDistribution}; +use store_api::storage::{ProjectionInput, RegionId, ScanRequest, TimeSeriesDistribution}; use crate::config::MitoConfig; use crate::error::Error; +use crate::read::read_columns::{ReadColumn, ReadColumns}; use crate::read::scan_region::Scanner; use crate::test_util; use crate::test_util::{CreateRequestBuilder, TestEnv}; +#[tokio::test] +async fn test_json_type_hint_pushdown_scanner_returns_batches() -> WhateverResult<()> { + // Create a region with a JSON2 field whose physical Parquet representation is a nested struct. + // The scan below will only ask for field_0.a.x. + + let request = CreateRequestBuilder::new() + .field_datatype(ConcreteDataType::json2(JsonNativeType::Object( + JsonObjectType::from([ + ( + "a".to_string(), + JsonNativeType::Object(JsonObjectType::from([ + ("x".to_string(), JsonNativeType::i64()), + ("y".to_string(), JsonNativeType::String), + ])), + ), + ("b".to_string(), JsonNativeType::String), + ]), + ))) + .build(); + let schema = test_util::rows_schema(&request); + + let mut env = TestEnv::new().await; + let engine = env.create_engine(MitoConfig::default()).await; + let region_id = RegionId::new(1024, 0); + engine + .handle_request(region_id, RegionRequest::Create(request)) + .await?; + + // Write full JSON objects, then flush them so the scanner has an Parquet file where nested + // projection can be pushed down. + let rows = Rows { + schema, + rows: vec![ + row(vec![ + ValueData::StringValue("tag-1".to_string()), + ValueData::JsonValue(encode_json_value(JsonValue::from(json!({ + "a": { "x": 10, "y": "ignored-a" }, + "b": "ignored-b" + })))), + ValueData::TimestampMillisecondValue(1000), + ]), + row(vec![ + ValueData::StringValue("tag-2".to_string()), + ValueData::JsonValue(encode_json_value(JsonValue::from(json!({ + "a": { "x": 20, "y": "ignored-c" }, + "b": "ignored-d" + })))), + ValueData::TimestampMillisecondValue(2000), + ]), + ], + }; + test_util::put_rows(&engine, region_id, rows).await; + test_util::flush_region(&engine, region_id, None).await; + + // Simulate a query expression like json_get(field_0, 'a.x'): the logical projection still + // returns the JSON2 root column, while json_type_hint tells scan input construction which + // nested physical path is needed. + + let request = ScanRequest { + projection_input: Some(ProjectionInput::new(vec![1, 0])), + json_type_hint: HashMap::from([( + "field_0".to_string(), + JsonNativeType::Object(JsonObjectType::from([( + "a".to_string(), + JsonNativeType::Object(JsonObjectType::from([( + "x".to_string(), + JsonNativeType::i64(), + )])), + )])), + )]), + ..Default::default() + }; + let scanner = engine.scanner(region_id, request).await?; + let Scanner::Seq(seq_scan) = &scanner else { + unreachable!(); + }; + // Verify the scan input only asks storage for field_0.a.x instead of the + // whole JSON2 struct. tag_0 is still read as a normal root column. + assert_eq!( + seq_scan.input().read_cols, + ReadColumns { + cols: vec![ + ReadColumn::new(0, vec![]), + ReadColumn::new( + 1, + vec![vec![ + "field_0".to_string(), + "a".to_string(), + "x".to_string() + ]] + ), + ] + } + ); + + // The scanner should still return a valid RecordBatch in the requested logical projection. + // Fields outside the pushed-down path are present as empty or null values because they were + // not read from Parquet. + + let stream = scanner.scan().await?; + let batches = RecordBatches::try_collect(stream).await?; + let expected = r#" ++------------------------+-------+ +| field_0 | tag_0 | ++------------------------+-------+ +| {a: {x: 10, y: }, b: } | tag-1 | +| {a: {x: 20, y: }, b: } | tag-2 | ++------------------------+-------+ +"#; + assert_eq!(batches.pretty_print()?, expected.trim()); + Ok(()) +} + #[tokio::test] async fn test_incremental_query_stale_error() { let mut env = TestEnv::with_prefix("test_incremental_query_stale_error").await; diff --git a/src/mito2/src/read/read_columns.rs b/src/mito2/src/read/read_columns.rs index ae5876237b..2178fa2538 100644 --- a/src/mito2/src/read/read_columns.rs +++ b/src/mito2/src/read/read_columns.rs @@ -170,7 +170,7 @@ fn normalize_nested_paths(nested_paths: Vec) -> Vec { normalized } -fn merge_nested_paths(merged: &mut Vec, incoming: Vec) { +pub(crate) fn merge_nested_paths(merged: &mut Vec, incoming: Vec) { for path in incoming { if merged .iter() diff --git a/src/mito2/src/read/scan_region.rs b/src/mito2/src/read/scan_region.rs index baf6964c27..4e57f787c4 100644 --- a/src/mito2/src/read/scan_region.rs +++ b/src/mito2/src/read/scan_region.rs @@ -14,7 +14,7 @@ //! Scans a region according to the scan request. -use std::collections::HashSet; +use std::collections::{HashMap, HashSet}; use std::fmt; use std::num::NonZeroU64; use std::sync::Arc; @@ -32,6 +32,7 @@ use datafusion_common::Column; use datafusion_expr::Expr; use datafusion_expr::utils::expr_to_columns; use datatypes::schema::ext::ArrowSchemaExt; +use datatypes::types::json_type::JsonNativeType; use futures::StreamExt; use itertools::Itertools; use partition::expr::PartitionExpr; @@ -40,8 +41,8 @@ use snafu::ResultExt; use store_api::metadata::{RegionMetadata, RegionMetadataRef}; use store_api::region_engine::{PartitionRange, RegionScannerRef}; use store_api::storage::{ - RegionId, ScanRequest, SequenceNumber, SequenceRange, TimeSeriesDistribution, - TimeSeriesRowSelector, + NestedPath, ProjectionInput, RegionId, ScanRequest, SequenceNumber, SequenceRange, + TimeSeriesDistribution, TimeSeriesRowSelector, }; use table::predicate::{Predicate, build_time_range_predicate, extract_time_range_from_expr}; use tokio::sync::{Semaphore, mpsc}; @@ -60,7 +61,8 @@ use crate::read::flat_projection::FlatProjectionMapper; use crate::read::range::{FileRangeBuilder, MemRangeBuilder, RangeMeta, RowGroupIndex}; use crate::read::range_cache::{ScanRequestFingerprint, implied_time_range_from_exprs}; use crate::read::read_columns::{ - ReadColumns, merge, read_columns_from_predicate, read_columns_from_projection, + ReadColumns, merge, merge_nested_paths, read_columns_from_predicate, + read_columns_from_projection, }; use crate::read::seq_scan::SeqScan; use crate::read::series_scan::SeriesScan; @@ -399,10 +401,17 @@ impl ScanRegion { /// Creates a scan input. #[tracing::instrument(skip_all, fields(region_id = %self.region_id()))] - async fn scan_input(self) -> Result { + async fn scan_input(mut self) -> Result { let sst_min_sequence = self.request.sst_min_sequence.and_then(NonZeroU64::new); let time_range = self.build_time_range_predicate(); let predicate = PredicateGroup::new(&self.version.metadata, &self.request.filters)?; + if let Some(input) = self.request.projection_input.as_mut() { + fill_json_nested_paths_from_hint( + input, + &self.request.json_type_hint, + &self.version.metadata, + ); + } let read_cols = match &self.request.projection_input { Some(p) => { @@ -1313,6 +1322,58 @@ fn pre_filter_mode(append_mode: bool, merge_mode: MergeMode) -> PreFilterMode { } } +fn fill_json_nested_paths_from_hint( + input: &mut ProjectionInput, + json_type_hint: &HashMap, + metadata: &RegionMetadata, +) { + if json_type_hint.is_empty() { + return; + } + let paths = nested_paths_from_json_type_hint(json_type_hint, metadata, &input.projection); + merge_nested_paths(&mut input.nested_paths, paths); +} + +fn nested_paths_from_json_type_hint( + json_type_hint: &HashMap, + metadata: &RegionMetadata, + projection: &[usize], +) -> Vec { + let mut paths = Vec::new(); + + for i in projection { + let Some(column) = metadata.column_metadatas.get(*i) else { + continue; + }; + let column_name = &column.column_schema.name; + let Some(json_type) = json_type_hint.get(column_name) else { + continue; + }; + + let mut current = vec![column_name.clone()]; + collect_json_nested_paths(json_type, &mut current, &mut paths); + } + + paths +} + +fn collect_json_nested_paths( + json_type: &JsonNativeType, + current: &mut NestedPath, + paths: &mut Vec, +) { + match json_type { + JsonNativeType::Object(fields) if !fields.is_empty() => { + for (field, child) in fields { + current.push(field.clone()); + collect_json_nested_paths(child, current, paths); + current.pop(); + } + } + _ => paths.push(current.clone()), + } +} + /// Output of [build_scan_fingerprint]: the cache fingerprint plus the derived /// implied time range used to decide whether the cache key can drop the time /// predicates for a given partition (see `build_range_cache_key`). @@ -1807,14 +1868,21 @@ mod tests { use datafusion::physical_plan::expressions::lit as physical_lit; use datafusion_common::ScalarValue; use datafusion_expr::{col, lit}; + use datatypes::prelude::ConcreteDataType; + use datatypes::schema::ColumnSchema; + use datatypes::types::json_type::JsonObjectType; use datatypes::value::Value; use partition::expr::col as partition_col; - use store_api::metadata::RegionMetadataBuilder; - use store_api::storage::{TimeSeriesDistribution, TimeSeriesRowSelector}; + use store_api::metadata::{ColumnMetadata, RegionMetadataBuilder}; + use store_api::storage::{ + ProjectionInput, RegionId, TimeSeriesDistribution, TimeSeriesRowSelector, + }; use super::*; use crate::cache::CacheManager; + use crate::error::InvalidMetadataSnafu; use crate::read::range_cache::ScanRequestFingerprintBuilder; + use crate::read::read_columns::ReadColumn; use crate::test_util::memtable_util::metadata_with_primary_key; use crate::test_util::scheduler_util::SchedulerEnv; @@ -1842,6 +1910,89 @@ mod tests { lit(ScalarValue::TimestampMillisecond(Some(val), None)) } + #[test] + fn test_fill_json_nested_paths_from_hint() -> Result<()> { + fn json_projection_test_metadata() -> Result { + let mut builder = RegionMetadataBuilder::new(RegionId::new(1024, 0)); + builder + .push_column_metadata(ColumnMetadata { + column_schema: ColumnSchema::new( + "tag".to_string(), + ConcreteDataType::string_datatype(), + true, + ), + semantic_type: SemanticType::Tag, + column_id: 0, + }) + .push_column_metadata(ColumnMetadata { + column_schema: ColumnSchema::new( + "j".to_string(), + ConcreteDataType::json2(JsonNativeType::Object(JsonObjectType::new())), + true, + ), + semantic_type: SemanticType::Field, + column_id: 1, + }) + .push_column_metadata(ColumnMetadata { + column_schema: ColumnSchema::new( + "ts".to_string(), + ConcreteDataType::timestamp_millisecond_datatype(), + false, + ), + semantic_type: SemanticType::Timestamp, + column_id: 2, + }); + builder.primary_key(vec![0]); + builder.build().context(InvalidMetadataSnafu).map(Arc::new) + } + + let metadata = json_projection_test_metadata()?; + let hint = HashMap::from([( + "j".to_string(), + JsonNativeType::Object(JsonObjectType::from([ + ("a".to_string(), JsonNativeType::i64()), + ( + "b".to_string(), + JsonNativeType::Object(JsonObjectType::from([( + "c".to_string(), + JsonNativeType::String, + )])), + ), + ])), + )]); + + fn nested_path(parts: &[&str]) -> NestedPath { + parts.iter().map(|part| part.to_string()).collect() + } + + let mut input = ProjectionInput::new(vec![1, 0]); + fill_json_nested_paths_from_hint(&mut input, &hint, metadata.as_ref()); + let read_columns = read_columns_from_projection(input, &metadata)?; + assert_eq!( + read_columns, + ReadColumns { + cols: vec![ + ReadColumn::new( + 1, + vec![nested_path(&["j", "a"]), nested_path(&["j", "b", "c"])] + ), + ReadColumn::new(0, vec![]) + ] + } + ); + + let mut input = ProjectionInput::new(vec![0]); + fill_json_nested_paths_from_hint(&mut input, &hint, metadata.as_ref()); + let read_columns = read_columns_from_projection(input, &metadata)?; + assert_eq!( + read_columns, + ReadColumns { + cols: vec![ReadColumn::new(0, vec![])] + } + ); + Ok(()) + } + #[tokio::test] async fn test_build_scan_fingerprint_for_eligible_scan() { let metadata = Arc::new(metadata_with_primary_key(vec![0, 1], false)); diff --git a/src/mito2/src/sst/parquet/format.rs b/src/mito2/src/sst/parquet/format.rs index 21e22f85de..bb29143b69 100644 --- a/src/mito2/src/sst/parquet/format.rs +++ b/src/mito2/src/sst/parquet/format.rs @@ -827,6 +827,7 @@ mod tests { use datatypes::arrow::datatypes::{DataType as ArrowDataType, Field, Schema, TimeUnit}; use datatypes::prelude::ConcreteDataType; use datatypes::schema::ColumnSchema; + use datatypes::types::json_type::{JsonNativeType, JsonObjectType}; use datatypes::value::ValueRef; use datatypes::vectors::{Int64Vector, TimestampMillisecondVector, UInt8Vector, UInt64Vector}; use mito_codec::row_converter::{ @@ -838,8 +839,10 @@ mod tests { use store_api::storage::consts::ReservedColumnId; use super::*; + use crate::error::InvalidMetadataSnafu; + use crate::read::read_columns::ReadColumn; use crate::sst::parquet::flat_format::{ - FlatReadFormat, FlatWriteFormat, sequence_column_index, + FlatReadFormat, FlatWriteFormat, sequence_column_index, sst_column_id_indices, }; use crate::sst::{FlatSchemaOptions, to_flat_sst_arrow_schema, with_field_id}; @@ -999,6 +1002,59 @@ mod tests { ); } + #[test] + fn test_format_projection_preserves_nested_paths() -> Result<()> { + let mut builder = RegionMetadataBuilder::new(RegionId::new(1, 1)); + builder + .push_column_metadata(ColumnMetadata { + column_schema: ColumnSchema::new("tag0", ConcreteDataType::string_datatype(), true), + semantic_type: SemanticType::Tag, + column_id: 1, + }) + .push_column_metadata(ColumnMetadata { + column_schema: ColumnSchema::new( + "j", + ConcreteDataType::json2(JsonNativeType::Object(JsonObjectType::from([ + ("a".to_string(), JsonNativeType::i64()), + ("b".to_string(), JsonNativeType::String), + ]))), + true, + ), + semantic_type: SemanticType::Field, + column_id: 4, + }) + .push_column_metadata(ColumnMetadata { + column_schema: ColumnSchema::new( + "ts", + ConcreteDataType::timestamp_millisecond_datatype(), + false, + ), + semantic_type: SemanticType::Timestamp, + column_id: 5, + }) + .primary_key(vec![1]); + let metadata = Arc::new(builder.build().context(InvalidMetadataSnafu)?); + let column_id_to_parquet_index = sst_column_id_indices(&metadata); + let projection = FormatProjection::compute_format_projection( + &column_id_to_parquet_index, + metadata.column_metadatas.len() + FIXED_POS_COLUMN_NUM, + ReadColumns { + cols: vec![ReadColumn::new( + 4, + vec![vec!["j".to_string(), "a".to_string()]], + )], + }, + ); + + let columns = projection.parquet_read_cols.columns(); + assert_eq!(1, columns[0].root_index()); + assert_eq!( + &[vec!["j".to_string(), "a".to_string()]], + columns[0].nested_paths() + ); + Ok(()) + } + #[test] fn test_empty_primary_key_offsets() { let array = build_test_pk_array(&[]); diff --git a/src/mito2/src/sst/parquet/reader.rs b/src/mito2/src/sst/parquet/reader.rs index 2762e92e1b..366d643a55 100644 --- a/src/mito2/src/sst/parquet/reader.rs +++ b/src/mito2/src/sst/parquet/reader.rs @@ -2304,6 +2304,8 @@ mod tests { use std::fmt::{Debug, Formatter}; use std::sync::{Arc, LazyLock}; + use common_error::ext::WhateverResult; + use common_recordbatch::ext::RecordBatchExt; use datafusion::arrow::datatypes::DataType; use datafusion_common::ScalarValue; use datafusion_expr::expr::ScalarFunction; @@ -2311,8 +2313,10 @@ mod tests { ColumnarValue, Expr, ScalarFunctionArgs, ScalarUDF, ScalarUDFImpl, Signature, Volatility, col, lit, }; - use datatypes::arrow::array::{ArrayRef, Int64Array}; + use datatypes::arrow::array::{ArrayRef, Int64Array, StringArray, StructArray}; + use datatypes::arrow::datatypes::{Fields, Schema}; use datatypes::arrow::record_batch::RecordBatch; + use datatypes::extension::json::{JsonExtensionType, JsonMetadata}; use datatypes::prelude::ConcreteDataType; use datatypes::schema::ColumnSchema; use object_store::services::Memory; @@ -2325,8 +2329,123 @@ mod tests { use super::*; use crate::sst::parquet::metadata::MetadataLoader; + use crate::sst::parquet::read_columns::{ParquetReadColumn, ParquetReadColumns}; use crate::test_util::sst_util::{sst_file_handle, sst_region_metadata}; + #[tokio::test] + async fn test_nested_projection_reads_partial_json2_physical_fields() -> WhateverResult<()> { + // Write a full JSON2-like Arrow struct: + // j: { a: { x: int, y: string }, b: string }. + // The test later requests only j.a.x and verifies that the physical Parquet projection + // does not materialize j.a.y or j.b. + + let xy_fields = Fields::from(vec![ + Arc::new(Field::new("x", DataType::Int64, true)), + Arc::new(Field::new("y", DataType::Utf8, true)), + ]); + let a_field = Arc::new(Field::new("a", DataType::Struct(xy_fields.clone()), true)); + let b_field = Arc::new(Field::new("b", DataType::Utf8, true)); + let json_fields = Fields::from(vec![a_field, b_field]); + let json_field = Field::new("j", DataType::Struct(json_fields.clone()), true) + .with_extension_type(JsonExtensionType::new(Arc::new(JsonMetadata::default()))); + let schema = Arc::new(Schema::new(vec![json_field])); + + let a_array = Arc::new(StructArray::new( + xy_fields, + vec![ + Arc::new(Int64Array::from_iter_values([1, 2, 3])) as ArrayRef, + Arc::new(StringArray::from_iter_values(["x1", "x2", "x3"])) as ArrayRef, + ], + None, + )) as ArrayRef; + let b_array = Arc::new(StringArray::from_iter_values(["b1", "b2", "b3"])) as ArrayRef; + let j_array = + Arc::new(StructArray::new(json_fields, vec![a_array, b_array], None)) as ArrayRef; + let columns = vec![j_array]; + + let batch = RecordBatch::try_new(schema, columns).map_err(|e| e.to_string())?; + + // Persist the complete nested schema to an in-memory Parquet file so the projection is + // exercised through parquet-rs rather than a mock. + + let object_store = ObjectStore::new(Memory::default()) + .map_err(|e| e.to_string())? + .finish(); + let file_handle = sst_file_handle(0, 1); + let file_path = file_handle.file_path("test_table", PathType::Bare); + + let mut parquet_bytes = Vec::new(); + ArrowWriter::try_new(&mut parquet_bytes, batch.schema(), None) + .and_then(|mut w| { + w.write(&batch)?; + Ok(w) + }) + .and_then(|w| w.close()) + .map_err(|e| e.to_string())?; + let file_size = parquet_bytes.len() as u64; + object_store + .write(&file_path, parquet_bytes) + .await + .map_err(|e| e.to_string())?; + + let mut cache_metrics = MetadataCacheMetrics::default(); + let loader = MetadataLoader::new(object_store.clone(), &file_path, file_size); + let parquet_meta = loader.load(&mut cache_metrics).await?; + let parquet_schema = parquet_meta.file_metadata().schema_descr(); + assert_eq!(3, parquet_schema.num_columns()); + + // Ask Parquet to read only the deepest requested JSON2 path. This should select the single + // leaf j.a.x and avoid both sibling leaves j.a.y and j.b. + + let projection = + ParquetReadColumns::from_deduped(vec![ParquetReadColumn::new(0).with_nested_paths( + vec![vec!["j".to_string(), "a".to_string(), "x".to_string()]], + )]); + let projection_plan = build_projection_plan(&projection, parquet_schema); + assert_eq!(vec![true], projection_plan.projected_root_presence); + assert_eq!( + projection_plan.mask, + ProjectionMask::leaves(parquet_schema, vec![0]) + ); + + // Read through the low-level stream directly. + + let arrow_metadata = + ArrowReaderMetadata::try_new(Arc::new(parquet_meta), ArrowReaderOptions::new()) + .map_err(|e| e.to_string())?; + let fetcher = SstParquetRangeFetcher::new( + file_handle.file_id(), + file_path.clone(), + object_store, + CacheStrategy::Disabled, + 0, + None, + ); + let mut stream = build_sst_parquet_record_batch_stream( + arrow_metadata, + 0, + None, + projection_plan.mask, + fetcher, + file_path, + )?; + + let Some(batch) = stream.next().await.transpose()? else { + unreachable!() + }; + let expected = r#" ++-------------+ +| j | ++-------------+ +| {a: {x: 1}} | +| {a: {x: 2}} | +| {a: {x: 3}} | ++-------------+ +"#; + assert_eq!(batch.pretty_print(), expected.trim()); + Ok(()) + } + #[tokio::test(flavor = "current_thread")] async fn test_minmax_predicate_key_not_built_when_index_result_cache_disabled() { #[derive(Eq, PartialEq, Hash)] diff --git a/src/mito2/src/test_util.rs b/src/mito2/src/test_util.rs index 711fd0a969..6ce5a5db2c 100644 --- a/src/mito2/src/test_util.rs +++ b/src/mito2/src/test_util.rs @@ -724,6 +724,7 @@ pub struct CreateRequestBuilder { table_dir: String, tag_num: usize, field_num: usize, + field_datatype: ConcreteDataType, options: HashMap, primary_key: Option>, all_not_null: bool, @@ -740,6 +741,7 @@ impl Default for CreateRequestBuilder { table_dir: "test".to_string(), tag_num: 1, field_num: 1, + field_datatype: ConcreteDataType::float64_datatype(), options: HashMap::new(), primary_key: None, all_not_null: false, @@ -775,6 +777,11 @@ impl CreateRequestBuilder { self } + pub(crate) fn field_datatype(mut self, value: ConcreteDataType) -> Self { + self.field_datatype = value; + self + } + #[must_use] pub fn primary_key(mut self, primary_key: Vec) -> Self { self.primary_key = Some(primary_key); @@ -833,7 +840,7 @@ impl CreateRequestBuilder { column_metadatas.push(ColumnMetadata { column_schema: ColumnSchema::new( format!("field_{i}"), - ConcreteDataType::float64_datatype(), + self.field_datatype.clone(), nullable, ), semantic_type: SemanticType::Field, @@ -895,7 +902,7 @@ impl CreateRequestBuilder { column_metadatas.push(ColumnMetadata { column_schema: ColumnSchema::new( format!("field_{i}"), - ConcreteDataType::float64_datatype(), + self.field_datatype.clone(), nullable, ), semantic_type: SemanticType::Field,