diff --git a/Cargo.lock b/Cargo.lock index 6fc5d8ffe94..ce51764faf4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,7 +316,7 @@ dependencies = [ "arrow-schema", "chrono", "half", - "indexmap 2.11.4", + "indexmap 2.12.0", "lexical-core", "memchr", "num", @@ -395,7 +395,7 @@ dependencies = [ [[package]] name = "arrow_util" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "ahash", "arrow", @@ -461,6 +461,17 @@ dependencies = [ "zstd-safe", ] +[[package]] +name = "async-lock" +version = "3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + [[package]] name = "async-stream" version = "0.3.6" @@ -480,7 +491,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -491,7 +502,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -512,7 +523,7 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "authz" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "async-trait", "backoff", @@ -532,6 +543,329 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "aws-credential-types" +version = "1.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf26925f4a5b59eb76722b63c2892b1d70d06fa053c72e4a100ec308c1d47bc" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "zeroize", +] + +[[package]] +name = "aws-lc-rs" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879b6c89592deb404ba4dc0ae6b58ffd1795c78991cbb5b8bc441c48a070440d" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "107a4e9d9cab9963e04e84bb8dee0e25f2a987f9a8bad5ed054abd439caa8f8c" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", +] + +[[package]] +name = "aws-runtime" +version = "1.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa006bb32360ed90ac51203feafb9d02e3d21046e1fd3a450a404b90ea73e5d" +dependencies = [ + "aws-credential-types", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "fastrand", + "http 0.2.12", + "http-body 0.4.6", + "percent-encoding", + "pin-project-lite", + "tracing", + "uuid", +] + +[[package]] +name = "aws-sdk-s3" +version = "1.108.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200be4aed61e3c0669f7268bacb768f283f1c32a7014ce57225e1160be2f6ccb" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-checksums", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "bytes", + "fastrand", + "hex", + "hmac", + "http 0.2.12", + "http 1.3.1", + "http-body 0.4.6", + "lru", + "percent-encoding", + "regex-lite", + "sha2", + "tracing", + "url", +] + +[[package]] +name = "aws-sigv4" +version = "1.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bffc03068fbb9c8dd5ce1c6fb240678a5cffb86fb2b7b1985c999c4b83c8df68" +dependencies = [ + "aws-credential-types", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "crypto-bigint 0.5.5", + "form_urlencoded", + "hex", + "hmac", + "http 0.2.12", + "http 1.3.1", + "p256", + "percent-encoding", + "ring", + "sha2", + "subtle", + "time", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-smithy-async" +version = "1.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "127fcfad33b7dfc531141fda7e1c402ac65f88aca5511a4d31e2e3d2cd01ce9c" +dependencies = [ + "futures-util", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "aws-smithy-checksums" +version = "0.63.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165d8583d8d906e2fb5511d29201d447cc710864f075debcdd9c31c265412806" +dependencies = [ + "aws-smithy-http", + "aws-smithy-types", + "bytes", + "crc-fast", + "hex", + "http 0.2.12", + "http-body 0.4.6", + "md-5", + "pin-project-lite", + "sha1", + "sha2", + "tracing", +] + +[[package]] +name = "aws-smithy-eventstream" +version = "0.60.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9656b85088f8d9dc7ad40f9a6c7228e1e8447cdf4b046c87e152e0805dea02fa" +dependencies = [ + "aws-smithy-types", + "bytes", + "crc32fast", +] + +[[package]] +name = "aws-smithy-http" +version = "0.62.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3feafd437c763db26aa04e0cc7591185d0961e64c61885bece0fb9d50ceac671" +dependencies = [ + "aws-smithy-eventstream", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "bytes-utils", + "futures-core", + "http 0.2.12", + "http 1.3.1", + "http-body 0.4.6", + "percent-encoding", + "pin-project-lite", + "pin-utils", + "tracing", +] + +[[package]] +name = "aws-smithy-http-client" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1053b5e587e6fa40ce5a79ea27957b04ba660baa02b28b7436f64850152234f1" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "h2 0.3.27", + "h2 0.4.12", + "http 0.2.12", + "http 1.3.1", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper 1.7.0", + "hyper-rustls 0.24.2", + "hyper-rustls 0.27.7", + "hyper-util", + "pin-project-lite", + "rustls 0.21.12", + "rustls 0.23.34", + "rustls-native-certs 0.8.2", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.4", + "tower 0.5.2", + "tracing", +] + +[[package]] +name = "aws-smithy-json" +version = "0.61.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff418fc8ec5cadf8173b10125f05c2e7e1d46771406187b2c878557d4503390" +dependencies = [ + "aws-smithy-types", +] + +[[package]] +name = "aws-smithy-observability" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d1881b1ea6d313f9890710d65c158bdab6fb08c91ea825f74c1c8c357baf4cc" +dependencies = [ + "aws-smithy-runtime-api", +] + +[[package]] +name = "aws-smithy-runtime" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ab99739082da5347660c556689256438defae3bcefd66c52b095905730e404" +dependencies = [ + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-http-client", + "aws-smithy-observability", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "fastrand", + "http 0.2.12", + "http 1.3.1", + "http-body 0.4.6", + "http-body 1.0.1", + "pin-project-lite", + "pin-utils", + "tokio", + "tracing", +] + +[[package]] +name = "aws-smithy-runtime-api" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3683c5b152d2ad753607179ed71988e8cfd52964443b4f74fd8e552d0bbfeb46" +dependencies = [ + "aws-smithy-async", + "aws-smithy-types", + "bytes", + "http 0.2.12", + "http 1.3.1", + "pin-project-lite", + "tokio", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-smithy-types" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f5b3a7486f6690ba25952cabf1e7d75e34d69eaff5081904a47bc79074d6457" +dependencies = [ + "base64-simd", + "bytes", + "bytes-utils", + "futures-core", + "http 0.2.12", + "http 1.3.1", + "http-body 0.4.6", + "http-body 1.0.1", + "http-body-util", + "itoa", + "num-integer", + "pin-project-lite", + "pin-utils", + "ryu", + "serde", + "time", + "tokio", + "tokio-util", +] + +[[package]] +name = "aws-smithy-xml" +version = "0.60.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9c34127e8c624bc2999f3b657e749c1393bedc9cd97b92a804db8ced4d2e163" +dependencies = [ + "xmlparser", +] + +[[package]] +name = "aws-types" +version = "1.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2fd329bf0e901ff3f60425691410c69094dc2a1f34b331f37bfc4e9ac1565a1" +dependencies = [ + "aws-credential-types", + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "rustc_version", + "tracing", +] + [[package]] name = "axum" version = "0.6.20" @@ -627,7 +961,7 @@ dependencies = [ [[package]] name = "backoff" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "rand 0.9.2", "snafu", @@ -638,9 +972,9 @@ dependencies = [ [[package]] name = "backon" -version = "1.5.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "592277618714fbcecda9a02ba7a8781f319d26532a88553bbacc77ba5d2b3a8d" +checksum = "cffb0e931875b666fc4fcb20fee52e9bbd1ef836fd9e9e04ec21555f9f85f7ef" dependencies = [ "fastrand", "gloo-timers", @@ -662,6 +996,12 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base64" version = "0.21.7" @@ -674,6 +1014,16 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" +dependencies = [ + "outref", + "vsimd", +] + [[package]] name = "base64ct" version = "1.8.0" @@ -682,15 +1032,16 @@ checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" [[package]] name = "bigdecimal" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a22f228ab7a1b23027ccc6c350b72868017af7ea8356fbdf19f8d991c690013" +checksum = "560f42649de9fa436b73517378a147ec21f6c997a546581df4b4b31677828934" dependencies = [ "autocfg", "libm", "num-bigint", "num-integer", "num-traits", + "serde", ] [[package]] @@ -719,6 +1070,41 @@ dependencies = [ "virtue", ] +[[package]] +name = "bindgen" +version = "0.72.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" +dependencies = [ + "bitflags 2.10.0", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.108", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitcode" version = "0.6.7" @@ -740,7 +1126,7 @@ checksum = "ffebfc2d28a12b262c303cb3860ee77b91bd83b1f20f0bd2a9693008e2f55a9e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -751,11 +1137,11 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.4" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -794,6 +1180,9 @@ name = "bloom2" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92ca28db4dacf55b7a764e73c12fc191ccbc0707a3804fc2e5da72fe22b14b47" +dependencies = [ + "serde", +] [[package]] name = "brotli" @@ -851,6 +1240,16 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +[[package]] +name = "bytes-utils" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" +dependencies = [ + "bytes", + "either", +] + [[package]] name = "bzip2" version = "0.5.2" @@ -862,9 +1261,9 @@ dependencies = [ [[package]] name = "bzip2" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bea8dcd42434048e4f7a304411d9273a411f647446c1234a65ce0554923f4cff" +checksum = "f3a53fac24f34a81bc9954b5d6cfce0c21e18ec6959f44f56e8e90e4bb7c346c" dependencies = [ "libbz2-rs-sys", ] @@ -919,9 +1318,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.41" +version = "1.2.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7" +checksum = "81bbf3b3619004ad9bd139f62a9ab5cfe467f307455a0d307b0cf58bf070feaa" dependencies = [ "find-msvc-tools", "jobserver", @@ -929,6 +1328,15 @@ dependencies = [ "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom 7.1.3", +] + [[package]] name = "cfg-if" version = "1.0.4" @@ -992,11 +1400,22 @@ dependencies = [ "half", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" -version = "4.5.49" +version = "4.5.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4512b90fa68d3a9932cea5184017c5d200f5921df706d45e853537dea51508f" +checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623" dependencies = [ "clap_builder", "clap_derive", @@ -1004,9 +1423,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.49" +version = "4.5.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0025e98baa12e766c67ba13ff4695a887a1eba19569aad00a472546795bd6730" +checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0" dependencies = [ "anstream", "anstyle", @@ -1023,7 +1442,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -1035,18 +1454,27 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "client_util" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "http 1.3.1", "iox_http_util", - "reqwest 0.12.24", - "rustls 0.23.32", + "reqwest", + "rustls 0.23.34", "thiserror 2.0.17", "tonic 0.12.3", "tower 0.5.2", "workspace-hack", ] +[[package]] +name = "cmake" +version = "0.1.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" +dependencies = [ + "cc", +] + [[package]] name = "colorchoice" version = "1.0.4" @@ -1203,6 +1631,19 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +[[package]] +name = "crc-fast" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bf62af4cc77d8fe1c22dde4e721d87f2f54056139d8c412e1366b740305f56f" +dependencies = [ + "crc", + "digest", + "libc", + "rand 0.9.2", + "regex", +] + [[package]] name = "crc32fast" version = "1.5.0" @@ -1248,6 +1689,12 @@ dependencies = [ "itertools 0.10.5", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + [[package]] name = "croaring" version = "2.5.1" @@ -1275,7 +1722,7 @@ checksum = "5877d3fbf742507b66bc2a1945106bd30dd8504019d596901ddd012a4dd01740" dependencies = [ "chrono", "once_cell", - "winnow", + "winnow 0.6.26", ] [[package]] @@ -1327,6 +1774,30 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -1339,21 +1810,21 @@ dependencies = [ [[package]] name = "csv" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdc4883a9c96732e4733212c01447ebd805833b7275a73ca3ee080fd77afdaf" +checksum = "52cd9d68cf7efc6ddfaaee42e7288d3a99d613d4b50f76ce9827ae0c6e14f938" dependencies = [ "csv-core", "itoa", "ryu", - "serde", + "serde_core", ] [[package]] name = "csv-core" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d" +checksum = "704a3c26996a80471189265814dbc2c257598b96b8a7feae2d31ace646bb9782" dependencies = [ "memchr", ] @@ -1379,7 +1850,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -1390,7 +1861,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -1407,10 +1878,16 @@ dependencies = [ "parking_lot_core", ] +[[package]] +name = "data-encoding" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" + [[package]] name = "data_types" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "arrow-buffer", @@ -1439,14 +1916,14 @@ dependencies = [ [[package]] name = "datafusion" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "arrow-ipc", "arrow-schema", "async-trait", "bytes", - "bzip2 0.6.0", + "bzip2 0.6.1", "chrono", "datafusion-catalog", "datafusion-catalog-listing", @@ -1493,7 +1970,7 @@ dependencies = [ [[package]] name = "datafusion-catalog" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "async-trait", @@ -1518,7 +1995,7 @@ dependencies = [ [[package]] name = "datafusion-catalog-listing" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "async-trait", @@ -1540,7 +2017,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "ahash", "arrow", @@ -1550,7 +2027,7 @@ dependencies = [ "half", "hashbrown 0.14.5", "hex", - "indexmap 2.11.4", + "indexmap 2.12.0", "libc", "log", "object_store", @@ -1565,7 +2042,7 @@ dependencies = [ [[package]] name = "datafusion-common-runtime" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "futures", "log", @@ -1575,13 +2052,13 @@ dependencies = [ [[package]] name = "datafusion-datasource" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "async-compression", "async-trait", "bytes", - "bzip2 0.6.0", + "bzip2 0.6.1", "chrono", "datafusion-common", "datafusion-common-runtime", @@ -1610,7 +2087,7 @@ dependencies = [ [[package]] name = "datafusion-datasource-csv" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "async-trait", @@ -1634,7 +2111,7 @@ dependencies = [ [[package]] name = "datafusion-datasource-json" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "async-trait", @@ -1658,7 +2135,7 @@ dependencies = [ [[package]] name = "datafusion-datasource-parquet" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "async-trait", @@ -1690,12 +2167,12 @@ dependencies = [ [[package]] name = "datafusion-doc" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" [[package]] name = "datafusion-execution" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "dashmap", @@ -1713,7 +2190,7 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "async-trait", @@ -1724,7 +2201,7 @@ dependencies = [ "datafusion-functions-aggregate-common", "datafusion-functions-window-common", "datafusion-physical-expr-common", - "indexmap 2.11.4", + "indexmap 2.12.0", "paste", "recursive", "serde_json", @@ -1734,11 +2211,11 @@ dependencies = [ [[package]] name = "datafusion-expr-common" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "datafusion-common", - "indexmap 2.11.4", + "indexmap 2.12.0", "itertools 0.14.0", "paste", ] @@ -1746,7 +2223,7 @@ dependencies = [ [[package]] name = "datafusion-functions" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "arrow-buffer", @@ -1774,7 +2251,7 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "ahash", "arrow", @@ -1794,7 +2271,7 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate-common" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "ahash", "arrow", @@ -1806,7 +2283,7 @@ dependencies = [ [[package]] name = "datafusion-functions-nested" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "arrow-ord", @@ -1827,7 +2304,7 @@ dependencies = [ [[package]] name = "datafusion-functions-table" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "async-trait", @@ -1842,7 +2319,7 @@ dependencies = [ [[package]] name = "datafusion-functions-window" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "datafusion-common", @@ -1859,7 +2336,7 @@ dependencies = [ [[package]] name = "datafusion-functions-window-common" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "datafusion-common", "datafusion-physical-expr-common", @@ -1868,17 +2345,17 @@ dependencies = [ [[package]] name = "datafusion-macros" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "datafusion-expr", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] name = "datafusion-optimizer" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "chrono", @@ -1886,7 +2363,7 @@ dependencies = [ "datafusion-expr", "datafusion-expr-common", "datafusion-physical-expr", - "indexmap 2.11.4", + "indexmap 2.12.0", "itertools 0.14.0", "log", "recursive", @@ -1897,7 +2374,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "ahash", "arrow", @@ -1908,7 +2385,7 @@ dependencies = [ "datafusion-physical-expr-common", "half", "hashbrown 0.14.5", - "indexmap 2.11.4", + "indexmap 2.12.0", "itertools 0.14.0", "log", "paste", @@ -1918,7 +2395,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr-common" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "ahash", "arrow", @@ -1931,7 +2408,7 @@ dependencies = [ [[package]] name = "datafusion-physical-optimizer" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "datafusion-common", @@ -1950,7 +2427,7 @@ dependencies = [ [[package]] name = "datafusion-physical-plan" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "ahash", "arrow", @@ -1968,7 +2445,7 @@ dependencies = [ "futures", "half", "hashbrown 0.14.5", - "indexmap 2.11.4", + "indexmap 2.12.0", "itertools 0.14.0", "log", "parking_lot", @@ -1979,7 +2456,7 @@ dependencies = [ [[package]] name = "datafusion-pruning" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "arrow-schema", @@ -1996,7 +2473,7 @@ dependencies = [ [[package]] name = "datafusion-session" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "async-trait", @@ -2019,13 +2496,13 @@ dependencies = [ [[package]] name = "datafusion-sql" version = "49.0.2" -source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc#a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" +source = "git+https://github.com/influxdata/arrow-datafusion.git?rev=ee81b1cc652bde6c131973d091b178836692112d#ee81b1cc652bde6c131973d091b178836692112d" dependencies = [ "arrow", "bigdecimal", "datafusion-common", "datafusion-expr", - "indexmap 2.11.4", + "indexmap 2.12.0", "log", "recursive", "regex", @@ -2035,7 +2512,7 @@ dependencies = [ [[package]] name = "datafusion_util" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "async-trait", "datafusion", @@ -2061,6 +2538,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "der" version = "0.7.10" @@ -2114,14 +2601,14 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] name = "doc-comment" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +checksum = "780955b8b195a21ab8e4ac6b60dd1dbdcec1dc6c51c0617964b08c81785e12c9" [[package]] name = "dotenvy" @@ -2135,12 +2622,30 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "dyn-clone" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der 0.6.1", + "elliptic-curve", + "rfc6979", + "signature 1.6.4", +] + [[package]] name = "either" version = "1.15.0" @@ -2150,6 +2655,26 @@ dependencies = [ "serde", ] +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest", + "ff", + "generic-array", + "group", + "pkcs8 0.9.0", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "encode_unicode" version = "1.0.0" @@ -2165,6 +2690,18 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.108", +] + [[package]] name = "env_filter" version = "0.1.4" @@ -2205,7 +2742,7 @@ dependencies = [ [[package]] name = "error_reporting" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "workspace-hack", ] @@ -2232,10 +2769,20 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "executor" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "futures", "metric", @@ -2254,6 +2801,16 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "find-msvc-tools" version = "0.1.4" @@ -2272,15 +2829,15 @@ version = "25.9.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09b6620799e7340ebd9968d2e0708eb82cf1971e9a16821e2091b6d6e475eed5" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "rustc_version", ] [[package]] name = "flate2" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc5a4e564e38c699f2880d3fda590bedc2e69f3f84cd48b457bd892ce61d0aa9" +checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" dependencies = [ "crc32fast", "libz-rs-sys", @@ -2290,7 +2847,7 @@ dependencies = [ [[package]] name = "flightsql" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "arrow-flight", @@ -2345,6 +2902,12 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futures" version = "0.3.31" @@ -2412,7 +2975,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -2454,10 +3017,10 @@ dependencies = [ [[package]] name = "generated_types" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ - "pbjson", - "pbjson-build", + "pbjson 0.8.0", + "pbjson-build 0.8.0", "pbjson-types", "prost 0.13.5", "prost-build", @@ -2478,6 +3041,7 @@ checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -2537,6 +3101,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "h2" version = "0.3.27" @@ -2549,7 +3124,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.11.4", + "indexmap 2.12.0", "slab", "tokio", "tokio-util", @@ -2568,7 +3143,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.3.1", - "indexmap 2.11.4", + "indexmap 2.12.0", "slab", "tokio", "tokio-util", @@ -2661,6 +3236,32 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hickory-proto" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "once_cell", + "rand 0.9.2", + "ring", + "serde", + "thiserror 2.0.17", + "tinyvec", + "tokio", + "tracing", + "url", +] + [[package]] name = "hkdf" version = "0.12.4" @@ -2839,7 +3440,9 @@ dependencies = [ "futures-util", "http 0.2.12", "hyper 0.14.32", + "log", "rustls 0.21.12", + "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", ] @@ -2853,12 +3456,13 @@ dependencies = [ "http 1.3.1", "hyper 1.7.0", "hyper-util", - "rustls 0.23.32", - "rustls-native-certs", + "rustls 0.23.34", + "rustls-native-certs 0.8.2", "rustls-pki-types", "tokio", "tokio-rustls 0.26.4", "tower-service", + "webpki-roots 1.0.3", ] [[package]] @@ -3060,9 +3664,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.11.4" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" +checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" dependencies = [ "equivalent", "hashbrown 0.16.0", @@ -3072,14 +3676,17 @@ dependencies = [ [[package]] name = "indoc" -version = "2.0.6" +version = "2.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" +checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" +dependencies = [ + "rustversion", +] [[package]] name = "influxdb-line-protocol" version = "1.0.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "bytes", "log", @@ -3147,8 +3754,8 @@ dependencies = [ "rand 0.8.5", "rcgen", "regex", - "reqwest 0.11.27", - "rustls 0.23.32", + "reqwest", + "rustls 0.23.34", "secrecy", "serde", "serde_json", @@ -3165,7 +3772,7 @@ dependencies = [ "tokio-util", "tokio_metrics_bridge", "tonic 0.12.3", - "tower 0.4.13", + "tower 0.5.2", "trace", "trace_exporters", "trace_http", @@ -3207,7 +3814,7 @@ dependencies = [ "data_types", "datafusion", "futures", - "indexmap 2.11.4", + "indexmap 2.12.0", "influxdb3_catalog", "influxdb3_id", "influxdb3_test_helpers", @@ -3247,7 +3854,7 @@ dependencies = [ "hashbrown 0.15.5", "hex", "humantime", - "indexmap 2.11.4", + "indexmap 2.12.0", "influxdb-line-protocol", "influxdb3_authz", "influxdb3_id", @@ -3323,7 +3930,7 @@ dependencies = [ "influxdb3_wal", "iox_query_params", "mockito", - "reqwest 0.11.27", + "reqwest", "secrecy", "serde", "serde_json", @@ -3336,7 +3943,7 @@ dependencies = [ name = "influxdb3_id" version = "3.7.0-nightly" dependencies = [ - "indexmap 2.11.4", + "indexmap 2.12.0", "serde", "serde_json", "thiserror 1.0.69", @@ -3349,10 +3956,16 @@ dependencies = [ "anyhow", "async-trait", "datafusion", + "futures", + "humantime", + "influxdb3_catalog", "influxdb_influxql_parser", "iox_query", + "iox_query_influxql", "iox_query_params", + "schema", "thiserror 1.0.69", + "tokio", "trace", "trace_http", "tracker", @@ -3376,7 +3989,7 @@ dependencies = [ "observability_deps", "parking_lot", "rand 0.8.5", - "reqwest 0.11.27", + "reqwest", "secrecy", "serde", "serde_json", @@ -3430,7 +4043,7 @@ dependencies = [ "parking_lot", "parquet_file", "pyo3", - "reqwest 0.11.27", + "reqwest", "serde_json", "tempfile", "test-log", @@ -3496,7 +4109,7 @@ dependencies = [ "insta", "iox_query", "iox_query_influxql", - "iox_query_influxql_rewrite", + "iox_query_influxql_rewrite 3.7.0-nightly", "iox_query_params", "iox_time", "itertools 0.13.0", @@ -3565,9 +4178,10 @@ dependencies = [ "iox_http", "iox_http_util", "iox_query", - "iox_query_influxql_rewrite", + "iox_query_influxql_rewrite 3.7.0-nightly", "iox_query_params", "iox_time", + "iox_v1_query_api", "metric", "metric_exporters", "mime", @@ -3589,7 +4203,7 @@ dependencies = [ "tokio-rustls 0.25.0", "tokio-util", "tonic 0.12.3", - "tower 0.4.13", + "tower 0.5.2", "trace", "trace_exporters", "trace_http", @@ -3644,7 +4258,7 @@ dependencies = [ "datafusion", "hashbrown 0.15.5", "hex", - "indexmap 2.11.4", + "indexmap 2.12.0", "influxdb3_authz", "influxdb3_catalog", "influxdb3_id", @@ -3677,7 +4291,7 @@ dependencies = [ "observability_deps", "parking_lot", "proptest", - "reqwest 0.11.27", + "reqwest", "serde", "serde_json", "sysinfo", @@ -3731,7 +4345,7 @@ dependencies = [ "data_types", "futures-util", "hashbrown 0.15.5", - "indexmap 2.11.4", + "indexmap 2.12.0", "influxdb-line-protocol", "influxdb3_id", "influxdb3_shutdown", @@ -3772,7 +4386,7 @@ dependencies = [ "futures-util", "hashbrown 0.15.5", "hex", - "indexmap 2.11.4", + "indexmap 2.12.0", "influxdb-line-protocol", "influxdb3_cache", "influxdb3_catalog", @@ -3819,7 +4433,7 @@ dependencies = [ [[package]] name = "influxdb_influxql_parser" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "chrono", "chrono-tz", @@ -3834,7 +4448,7 @@ dependencies = [ [[package]] name = "influxdb_iox_client" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "arrow-flight", @@ -3849,13 +4463,14 @@ dependencies = [ "iox_query_params", "prost 0.13.5", "rand 0.9.2", - "reqwest 0.12.24", + "reqwest", "schema", "serde_json", "thiserror 2.0.17", "tokio", "tokio-stream", "tonic-reflection", + "tracing", ] [[package]] @@ -3881,7 +4496,7 @@ checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" [[package]] name = "iox_http" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "async-trait", "authz", @@ -3899,7 +4514,7 @@ dependencies = [ [[package]] name = "iox_http_util" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "futures", "http 1.3.1", @@ -3912,7 +4527,7 @@ dependencies = [ [[package]] name = "iox_query" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "arrow_util", @@ -3925,7 +4540,7 @@ dependencies = [ "executor", "futures", "hashbrown 0.14.5", - "indexmap 2.11.4", + "indexmap 2.12.0", "influxdb-line-protocol", "influxdb_iox_client", "iox_query_params", @@ -3953,10 +4568,11 @@ dependencies = [ [[package]] name = "iox_query_influxql" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "assert_matches", + "async-trait", "chrono-tz", "datafusion", "datafusion_util", @@ -3975,6 +4591,16 @@ dependencies = [ "workspace-hack", ] +[[package]] +name = "iox_query_influxql_rewrite" +version = "0.1.0" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" +dependencies = [ + "influxdb_influxql_parser", + "thiserror 2.0.17", + "workspace-hack", +] + [[package]] name = "iox_query_influxql_rewrite" version = "3.7.0-nightly" @@ -3986,7 +4612,7 @@ dependencies = [ [[package]] name = "iox_query_params" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "datafusion", @@ -4001,7 +4627,7 @@ dependencies = [ [[package]] name = "iox_system_tables" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "async-trait", @@ -4013,7 +4639,7 @@ dependencies = [ [[package]] name = "iox_time" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "chrono", "parking_lot", @@ -4021,11 +4647,48 @@ dependencies = [ "workspace-hack", ] +[[package]] +name = "iox_v1_query_api" +version = "0.1.0" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" +dependencies = [ + "anyhow", + "arrow", + "authz", + "bytes", + "chrono", + "datafusion", + "futures", + "generated_types", + "http 1.3.1", + "http-body-util", + "iox_http_util", + "iox_query", + "iox_query_influxql", + "iox_query_influxql_rewrite 0.1.0", + "iox_query_params", + "mime", + "multer", + "rmp-serde", + "schema", + "serde", + "serde_json", + "serde_urlencoded", + "thiserror 2.0.17", + "trace", + "trace_http", + "tracing", + "workspace-hack", +] + [[package]] name = "ipnet" version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +dependencies = [ + "serde", +] [[package]] name = "iri-string" @@ -4039,20 +4702,20 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" @@ -4099,7 +4762,7 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jemalloc_stats" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "snafu", "tikv-jemalloc-ctl", @@ -4205,6 +4868,16 @@ version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link 0.2.1", +] + [[package]] name = "libm" version = "0.2.15" @@ -4217,7 +4890,7 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "libc", "redox_syscall", ] @@ -4242,6 +4915,14 @@ dependencies = [ "zlib-rs", ] +[[package]] +name = "linear_buffer" +version = "0.1.0" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" +dependencies = [ + "workspace-hack", +] + [[package]] name = "linux-raw-sys" version = "0.11.0" @@ -4273,7 +4954,7 @@ checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] name = "logfmt" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "humantime", "tracing", @@ -4282,6 +4963,15 @@ dependencies = [ "workspace-hack", ] +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.5", +] + [[package]] name = "lru-slab" version = "0.1.2" @@ -4351,7 +5041,7 @@ dependencies = [ [[package]] name = "meta_data_cache" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "data_types", @@ -4367,7 +5057,7 @@ dependencies = [ [[package]] name = "metric" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "parking_lot", "workspace-hack", @@ -4376,11 +5066,11 @@ dependencies = [ [[package]] name = "metric_exporters" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "metric", "prometheus", - "reqwest 0.12.24", + "reqwest", "tracing", "workspace-hack", ] @@ -4391,6 +5081,16 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -4409,13 +5109,13 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" dependencies = [ "libc", "wasi", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -4441,7 +5141,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -4467,6 +5167,44 @@ dependencies = [ "tokio", ] +[[package]] +name = "moka" +version = "0.12.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8261cd88c312e0004c1d51baad2980c66528dfdb2bee62003e643a4d8f86b077" +dependencies = [ + "async-lock", + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "equivalent", + "event-listener", + "futures-util", + "parking_lot", + "portable-atomic", + "rustc_version", + "smallvec", + "tagptr", + "uuid", +] + +[[package]] +name = "multer" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http 1.3.1", + "httparse", + "memchr", + "mime", + "spin", + "version_check", +] + [[package]] name = "multimap" version = "0.10.1" @@ -4479,6 +5217,19 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9252111cf132ba0929b6f8e030cac2a24b507f3a4d6db6fb2896f27b354c714b" +[[package]] +name = "nix" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" +dependencies = [ + "bitflags 2.10.0", + "cfg-if", + "cfg_aliases", + "libc", + "memoffset", +] + [[package]] name = "nom" version = "7.1.3" @@ -4547,6 +5298,7 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", + "serde", ] [[package]] @@ -4638,7 +5390,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", ] [[package]] @@ -4683,7 +5435,7 @@ dependencies = [ "percent-encoding", "quick-xml", "rand 0.9.2", - "reqwest 0.12.24", + "reqwest", "ring", "rustls-pemfile 2.2.0", "serde", @@ -4701,7 +5453,7 @@ dependencies = [ [[package]] name = "object_store_mem_cache" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "async-trait", "bincode", @@ -4709,8 +5461,10 @@ dependencies = [ "dashmap", "data_types", "futures", - "indexmap 2.11.4", + "http 1.3.1", + "indexmap 2.12.0", "iox_time", + "linear_buffer", "metric", "object_store", "object_store_metrics", @@ -4725,7 +5479,7 @@ dependencies = [ [[package]] name = "object_store_metrics" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "async-trait", "bloom2", @@ -4744,7 +5498,7 @@ dependencies = [ [[package]] name = "object_store_mock" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "async-trait", "bytes", @@ -4757,7 +5511,7 @@ dependencies = [ [[package]] name = "object_store_size_hinting" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "http 1.3.1", "object_store", @@ -4780,7 +5534,7 @@ dependencies = [ [[package]] name = "observability_deps" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "tracing", "workspace-hack", @@ -4791,12 +5545,16 @@ name = "once_cell" version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +dependencies = [ + "critical-section", + "portable-atomic", +] [[package]] name = "once_cell_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "oorandom" @@ -4828,16 +5586,33 @@ dependencies = [ "num-traits", ] +[[package]] +name = "outref" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" + [[package]] name = "owo-colors" version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" +[[package]] +name = "p256" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" +dependencies = [ + "ecdsa", + "elliptic-curve", + "sha2", +] + [[package]] name = "panic_logging" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "metric", "tracing", @@ -4913,7 +5688,7 @@ dependencies = [ [[package]] name = "parquet_file" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "arrow_util", @@ -4957,6 +5732,16 @@ dependencies = [ "serde", ] +[[package]] +name = "pbjson" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "898bac3fa00d0ba57a4e8289837e965baa2dee8c3749f3b11d45a64b4223d9c3" +dependencies = [ + "base64 0.22.1", + "serde", +] + [[package]] name = "pbjson-build" version = "0.7.0" @@ -4969,6 +5754,18 @@ dependencies = [ "prost-types 0.13.5", ] +[[package]] +name = "pbjson-build" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af22d08a625a2213a78dbb0ffa253318c5c79ce3133d32d296655a7bdfb02095" +dependencies = [ + "heck", + "itertools 0.14.0", + "prost 0.14.1", + "prost-types 0.14.1", +] + [[package]] name = "pbjson-types" version = "0.7.0" @@ -4977,8 +5774,8 @@ checksum = "e54e5e7bfb1652f95bc361d76f3c780d8e526b134b85417e774166ee941f0887" dependencies = [ "bytes", "chrono", - "pbjson", - "pbjson-build", + "pbjson 0.7.0", + "pbjson-build 0.7.0", "prost 0.13.5", "prost-build", "serde", @@ -5039,7 +5836,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -5059,7 +5856,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", - "indexmap 2.11.4", + "indexmap 2.12.0", ] [[package]] @@ -5070,7 +5867,7 @@ checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" dependencies = [ "fixedbitset", "hashbrown 0.15.5", - "indexmap 2.11.4", + "indexmap 2.12.0", "serde", ] @@ -5109,7 +5906,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -5130,9 +5927,19 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "der", - "pkcs8", - "spki", + "der 0.7.10", + "pkcs8 0.10.2", + "spki 0.7.3", +] + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", ] [[package]] @@ -5141,8 +5948,8 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.10", + "spki 0.7.3", ] [[package]] @@ -5212,7 +6019,7 @@ dependencies = [ [[package]] name = "predicate" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "async-trait", @@ -5270,14 +6077,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.106", + "syn 2.0.108", +] + +[[package]] +name = "proc-macro-crate" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +dependencies = [ + "toml_edit", ] [[package]] name = "proc-macro2" -version = "1.0.101" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] @@ -5314,13 +6130,17 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bb0be07becd10686a0bb407298fb425360a5c44a663774406340c59a22de4ce" dependencies = [ - "bitflags 2.9.4", + "bit-set", + "bit-vec", + "bitflags 2.10.0", "lazy_static", "num-traits", "rand 0.9.2", "rand_chacha 0.9.0", "rand_xorshift", "regex-syntax", + "rusty-fork", + "tempfile", "unarray", ] @@ -5344,6 +6164,16 @@ dependencies = [ "prost-derive 0.13.5", ] +[[package]] +name = "prost" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7231bd9b3d3d33c86b58adbac74b5ec0ad9f496b19d22801d773636feaa95f3d" +dependencies = [ + "bytes", + "prost-derive 0.14.1", +] + [[package]] name = "prost-build" version = "0.13.5" @@ -5360,7 +6190,7 @@ dependencies = [ "prost 0.13.5", "prost-types 0.13.5", "regex", - "syn 2.0.106", + "syn 2.0.108", "tempfile", ] @@ -5381,13 +6211,26 @@ dependencies = [ name = "prost-derive" version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +dependencies = [ + "anyhow", + "itertools 0.14.0", + "proc-macro2", + "quote", + "syn 2.0.108", +] + +[[package]] +name = "prost-derive" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9120690fafc389a67ba3803df527d0ec9cbbc9cc45e4cc20b332996dfb672425" dependencies = [ "anyhow", "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -5408,6 +6251,15 @@ dependencies = [ "prost 0.13.5", ] +[[package]] +name = "prost-types" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9b4db3d6da204ed77bb26ba83b6122a73aeb2e87e25fbf7ad2e84c4ccbf8f72" +dependencies = [ + "prost 0.14.1", +] + [[package]] name = "psm" version = "0.1.27" @@ -5464,7 +6316,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -5477,13 +6329,13 @@ dependencies = [ "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] name = "query_functions" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "chrono", @@ -5495,6 +6347,12 @@ dependencies = [ "workspace-hack", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quick-xml" version = "0.38.3" @@ -5517,7 +6375,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.32", + "rustls 0.23.34", "socket2 0.6.1", "thiserror 2.0.17", "tokio", @@ -5537,7 +6395,7 @@ dependencies = [ "rand 0.9.2", "ring", "rustc-hash", - "rustls 0.23.32", + "rustls 0.23.34", "rustls-pki-types", "slab", "thiserror 2.0.17", @@ -5693,7 +6551,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76009fbe0614077fc1a2ce255e3a1881a2e3a3527097d5dc6d8212c585e7e38b" dependencies = [ "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -5702,7 +6560,7 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", ] [[package]] @@ -5722,7 +6580,7 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -5748,6 +6606,12 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "regex-lite" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d942b98df5e658f56f20d592c7f868833fe38115e65c33003d8cd224b0155da" + [[package]] name = "regex-syntax" version = "0.8.8" @@ -5760,55 +6624,13 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.27", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.32", - "hyper-rustls 0.24.2", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls 0.21.12", - "rustls-pemfile 1.0.4", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration", - "tokio", - "tokio-rustls 0.24.1", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "webpki-roots 0.25.4", - "winreg", -] - [[package]] name = "reqwest" version = "0.12.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f" dependencies = [ + "async-compression", "base64 0.22.1", "bytes", "futures-core", @@ -5822,11 +6644,12 @@ dependencies = [ "hyper-util", "js-sys", "log", + "mime_guess", "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.32", - "rustls-native-certs", + "rustls 0.23.34", + "rustls-native-certs 0.8.2", "rustls-pki-types", "serde", "serde_json", @@ -5843,6 +6666,18 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", + "webpki-roots 1.0.3", +] + +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac", + "zeroize", ] [[package]] @@ -5859,6 +6694,28 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + [[package]] name = "rsa" version = "0.9.8" @@ -5871,40 +6728,40 @@ dependencies = [ "num-integer", "num-traits", "pkcs1", - "pkcs8", + "pkcs8 0.10.2", "rand_core 0.6.4", - "signature", - "spki", + "signature 2.2.0", + "spki 0.7.3", "subtle", "zeroize", ] [[package]] name = "rstest" -version = "0.18.2" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97eeab2f3c0a199bc4be135c36c924b6590b88c377d416494288c14f2db30199" +checksum = "f5a3193c063baaa2a95a33f03035c8a72b83d97a54916055ba22d35ed3839d49" dependencies = [ - "futures", "futures-timer", + "futures-util", "rstest_macros", - "rustc_version", ] [[package]] name = "rstest_macros" -version = "0.18.2" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d428f8247852f894ee1be110b375111b586d4fa431f6c46e64ba5a0dcccbe605" +checksum = "9c845311f0ff7951c5506121a9ad75aec44d083c31583b2ea5a30bcb0b0abba0" dependencies = [ "cfg-if", "glob", + "proc-macro-crate", "proc-macro2", "quote", "regex", "relative-path", "rustc_version", - "syn 2.0.106", + "syn 2.0.108", "unicode-ident", ] @@ -5935,7 +6792,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "errno", "libc", "linux-raw-sys", @@ -5969,10 +6826,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.32" +version = "0.23.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3c25631629d034ce7cd9940adc9d45762d46de2b0f57193c4443b92c6d4d40" +checksum = "6a9586e9ee2b4f8fab52a0048ca7334d7024eef48e2cb9407e3497bb7cab7fa7" dependencies = [ + "aws-lc-rs", "log", "once_cell", "ring", @@ -5982,6 +6840,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework 2.11.1", +] + [[package]] name = "rustls-native-certs" version = "0.8.2" @@ -5991,7 +6861,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 3.5.1", ] [[package]] @@ -6049,6 +6919,7 @@ version = "0.103.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -6060,6 +6931,18 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + [[package]] name = "ryu" version = "1.0.20" @@ -6087,12 +6970,12 @@ dependencies = [ [[package]] name = "schema" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "base64 0.22.1", "hashbrown 0.14.5", - "indexmap 2.11.4", + "indexmap 2.12.0", "snafu", "tracing", "workspace-hack", @@ -6138,6 +7021,20 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct", + "der 0.6.1", + "generic-array", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + [[package]] name = "secrecy" version = "0.8.0" @@ -6147,13 +7044,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.10.0", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + [[package]] name = "security-framework" version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "core-foundation 0.10.1", "core-foundation-sys", "libc", @@ -6213,7 +7123,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -6243,15 +7153,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.15.0" +version = "3.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093cd8c01b25262b84927e0f7151692158fab02d961e04c979d3903eba7ecc5" +checksum = "aa66c845eee442168b2c8134fec70ac50dc20e760769c8ba0ad1319ca1959b04" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.11.4", + "indexmap 2.12.0", "schemars 0.9.0", "schemars 1.0.4", "serde_core", @@ -6262,20 +7172,20 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.15.0" +version = "3.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e6c180db0816026a61afa1cff5344fb7ebded7e4d3062772179f2501481c27" +checksum = "b91a903660542fced4e99881aa481bdbaec1634568ee02e0b8bd57c64cb38955" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] name = "service_common" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "arrow-flight", @@ -6289,7 +7199,7 @@ dependencies = [ [[package]] name = "service_grpc_flight" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "arrow", "arrow-flight", @@ -6363,6 +7273,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest", + "rand_core 0.6.4", +] + [[package]] name = "signature" version = "2.2.0" @@ -6418,6 +7338,8 @@ version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e84b3f4eacbf3a1ce05eac6763b4d629d60cbc94d632e4092c54ade71f1e1a2" dependencies = [ + "futures-core", + "pin-project", "snafu-derive", ] @@ -6430,7 +7352,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -6468,6 +7390,16 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + [[package]] name = "spki" version = "0.7.3" @@ -6475,7 +7407,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der", + "der 0.7.10", ] [[package]] @@ -6497,7 +7429,7 @@ checksum = "da5fc6819faabb412da764b99d3b713bb55083c11e7e0c00144d386cd6a1939c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -6531,12 +7463,12 @@ dependencies = [ "futures-util", "hashbrown 0.15.5", "hashlink", - "indexmap 2.11.4", + "indexmap 2.12.0", "log", "memchr", "once_cell", "percent-encoding", - "rustls 0.23.32", + "rustls 0.23.34", "serde", "serde_json", "sha2", @@ -6560,7 +7492,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -6583,7 +7515,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.106", + "syn 2.0.108", "tokio", "url", ] @@ -6596,7 +7528,7 @@ checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.9.4", + "bitflags 2.10.0", "byteorder", "bytes", "crc", @@ -6639,7 +7571,7 @@ checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.9.4", + "bitflags 2.10.0", "byteorder", "crc", "dotenvy", @@ -6749,9 +7681,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.106" +version = "2.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" dependencies = [ "proc-macro2", "quote", @@ -6781,7 +7713,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -6799,25 +7731,10 @@ dependencies = [ ] [[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation 0.9.4", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" +name = "tagptr" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "target-lexicon" @@ -6863,20 +7780,20 @@ checksum = "451b374529930d7601b1eef8d32bc79ae870b6079b069401709c2a8bf9e75f36" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] name = "test_helpers" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "async-trait", "dotenvy", "ordered-float 5.1.0", "parking_lot", "prometheus-parse", - "reqwest 0.12.24", + "reqwest", "serde", "tempfile", "thiserror 2.0.17", @@ -6913,7 +7830,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -6924,7 +7841,7 @@ checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -7100,7 +8017,19 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", +] + +[[package]] +name = "tokio-metrics" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01bbf7db0b3f5eee8930a119fe99bfa1438de1095fe3d26b25e652a5933ef3f" +dependencies = [ + "futures-util", + "pin-project-lite", + "tokio", + "tokio-stream", ] [[package]] @@ -7130,7 +8059,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.23.32", + "rustls 0.23.34", "tokio", ] @@ -7153,6 +8082,7 @@ checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "futures-util", "pin-project-lite", @@ -7162,7 +8092,7 @@ dependencies = [ [[package]] name = "tokio_metrics_bridge" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "metric", "parking_lot", @@ -7173,7 +8103,7 @@ dependencies = [ [[package]] name = "tokio_watchdog" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "metric", "tokio", @@ -7181,6 +8111,36 @@ dependencies = [ "workspace-hack", ] +[[package]] +name = "toml_datetime" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.23.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d" +dependencies = [ + "indexmap 2.12.0", + "toml_datetime", + "toml_parser", + "winnow 0.7.13", +] + +[[package]] +name = "toml_parser" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +dependencies = [ + "winnow 0.7.13", +] + [[package]] name = "tonic" version = "0.9.2" @@ -7231,7 +8191,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost 0.13.5", - "rustls-native-certs", + "rustls-native-certs 0.8.2", "rustls-pemfile 2.2.0", "socket2 0.5.10", "tokio", @@ -7255,7 +8215,7 @@ dependencies = [ "prost-build", "prost-types 0.13.5", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -7299,11 +8259,15 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", + "indexmap 2.12.0", "pin-project-lite", + "slab", "sync_wrapper 1.0.2", "tokio", + "tokio-util", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -7312,16 +8276,18 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "bytes", "futures-util", "http 1.3.1", "http-body 1.0.1", + "http-body-util", "iri-string", "pin-project-lite", "tower 0.5.2", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -7339,7 +8305,7 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tower_trailer" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "futures", "http 1.3.1", @@ -7353,7 +8319,7 @@ dependencies = [ [[package]] name = "trace" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "chrono", "parking_lot", @@ -7365,7 +8331,7 @@ dependencies = [ [[package]] name = "trace_exporters" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "async-trait", "clap", @@ -7383,7 +8349,7 @@ dependencies = [ [[package]] name = "trace_http" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "bytes", "futures", @@ -7421,7 +8387,7 @@ checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -7480,7 +8446,7 @@ dependencies = [ [[package]] name = "tracker" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "futures", "hashbrown 0.14.5", @@ -7500,7 +8466,7 @@ dependencies = [ [[package]] name = "trogging" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "clap", "logfmt", @@ -7521,6 +8487,9 @@ name = "twox-hash" version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" +dependencies = [ + "rand 0.9.2", +] [[package]] name = "typenum" @@ -7540,6 +8509,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + [[package]] name = "unicode-bidi" version = "0.3.18" @@ -7548,9 +8523,9 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" +checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06" [[package]] name = "unicode-normalization" @@ -7663,6 +8638,12 @@ version = "0.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + [[package]] name = "wait-timeout" version = "0.2.1" @@ -7735,7 +8716,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", "wasm-bindgen-shared", ] @@ -7770,7 +8751,7 @@ checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7817,12 +8798,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "webpki-roots" version = "0.26.11" @@ -7949,7 +8924,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -7960,7 +8935,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -8271,13 +9246,12 @@ dependencies = [ ] [[package]] -name = "winreg" -version = "0.50.0" +name = "winnow" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "memchr", ] [[package]] @@ -8289,29 +9263,40 @@ checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "workspace-hack" version = "0.1.0" -source = "git+https://github.com/influxdata/influxdb3_core?rev=f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516#f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" +source = "git+https://github.com/influxdata/influxdb3_core?branch=tjh%2Fiox_v1_query_api-crate#c8c07bd88d20b8742ecb879477a5412971f86d5c" dependencies = [ "ahash", "arrayvec", "arrow-ipc", "arrow-schema", + "async-compression", + "aws-credential-types", + "aws-sdk-s3", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", "base64 0.22.1", - "bitflags 2.9.4", + "bigdecimal", + "bincode", + "bitflags 2.10.0", + "bloom2", "byteorder", "bytes", + "cc", "chrono", "clap", "clap_builder", "crossbeam-utils", + "crypto-bigint 0.5.5", "crypto-common", "datafusion-common", "datafusion-expr", "digest", "either", "fastrand", + "flatbuffers", "flate2", "form_urlencoded", - "futures", "futures-channel", "futures-core", "futures-executor", @@ -8319,58 +9304,96 @@ dependencies = [ "futures-sink", "futures-task", "futures-util", + "generic-array", + "getrandom 0.2.16", "getrandom 0.3.4", "hashbrown 0.14.5", "hashbrown 0.15.5", + "hickory-proto", "httparse", "hyper 1.7.0", + "hyper-rustls 0.27.7", "hyper-util", - "indexmap 2.11.4", + "indexmap 2.12.0", + "insta", + "ipnet", "libc", + "lock_api", "log", + "lzma-sys", "md-5", "memchr", + "moka", + "nix", + "num-bigint", + "num-integer", "num-traits", "object_store", "once_cell", + "parking_lot", "parquet", "percent-encoding", + "portable-atomic", + "proptest", "prost 0.13.5", "prost-types 0.13.5", "rand 0.8.5", "rand 0.9.2", "rand_chacha 0.9.0", + "rand_core 0.9.3", "regex", "regex-automata", "regex-syntax", - "reqwest 0.12.24", + "reqwest", + "ring", + "rustls 0.23.34", + "rustls-pemfile 2.2.0", + "rustls-webpki 0.103.7", "serde", "serde_core", "serde_json", "sha2", + "signature 2.2.0", "similar", "smallvec", + "snafu", + "socket2 0.5.10", "socket2 0.6.1", + "spin", "sqlparser", + "sqlx", "sqlx-core", + "sqlx-macros", + "sqlx-macros-core", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.106", + "subtle", + "syn 2.0.108", "sync_wrapper 1.0.2", + "thiserror 2.0.17", "thrift", + "time", "tokio", + "tokio-metrics", + "tokio-rustls 0.26.4", "tokio-stream", "tokio-util", "tonic 0.12.3", "tower 0.5.2", + "tower-http", "tracing", "tracing-core", "tracing-log", "twox-hash", + "url", "uuid", - "windows-sys 0.52.0", + "winapi", + "windows-sys 0.48.0", "windows-sys 0.59.0", + "windows-sys 0.60.2", "windows-sys 0.61.2", + "xz2", + "zeroize", "zstd", "zstd-safe", "zstd-sys", @@ -8382,6 +9405,12 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" +[[package]] +name = "xmlparser" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" + [[package]] name = "xz2" version = "0.1.7" @@ -8426,7 +9455,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", "synstructure", ] @@ -8447,7 +9476,7 @@ checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] @@ -8467,7 +9496,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", "synstructure", ] @@ -8476,6 +9505,20 @@ name = "zeroize" version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.108", +] [[package]] name = "zerotrie" @@ -8507,7 +9550,7 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.108", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d139fa22dfa..3b9804c1235 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,8 +84,8 @@ criterion = { version = "0.5", features = ["html_reports"] } crossbeam-channel = "0.5.11" csv = "1.3.0" # See https://github.com/influxdata/arrow-datafusion/pull/73 for contents -datafusion = { git = "https://github.com/influxdata/arrow-datafusion.git", rev = "a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" } -datafusion-proto = { git = "https://github.com/influxdata/arrow-datafusion.git", rev = "a9cf9aca9ebf0d6c04e0861d2baebffa0ba77dbc" } +datafusion = { git = "https://github.com/influxdata/arrow-datafusion.git", rev = "ee81b1cc652bde6c131973d091b178836692112d" } +datafusion-proto = { git = "https://github.com/influxdata/arrow-datafusion.git", rev = "ee81b1cc652bde6c131973d091b178836692112d" } dashmap = "6.1.0" dotenvy = "0.15.7" flate2 = "1.0.27" @@ -112,25 +112,25 @@ mockito = { version = "1.4.0", default-features = false } mockall = { version = "0.13.0" } non-empty-string = "0.2.5" num_cpus = "1.16.0" -object_store = { version = "0.12.3", features = ["aws", "azure", "gcp"] } +object_store = { version = "0.12.4", features = ["aws", "azure", "gcp"] } parking_lot = { version = "0.12.1", features = ["serde"] } paste = "1.0.15" parquet = {version = "55", features = ["object_store"]} -pbjson = "0.6.0" -pbjson-build = "0.6.2" -pbjson-types = "0.6.0" +pbjson = "0.8" +pbjson-build = "0.8" +pbjson-types = "0.7" pin-project-lite = "0.2" pretty_assertions = { version = "1.4.0", features = ["unstable"] } -prost = "0.12.6" -prost-build = "0.12.6" -prost-types = "0.12.6" +prost = "0.13" +prost-build = "0.13" +prost-types = "0.13" proptest = { version = "1", default-features = false, features = ["std"] } pyo3 = { version = "0.24.1", features = ["experimental-async"]} rand = "0.8.5" rcgen = "0.13.2" regex = "1.11.1" -reqwest = { version = "0.11.27", default-features = false, features = ["rustls-tls", "stream", "json"] } -rstest = "0.18" +reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "stream", "json"] } +rstest = "0.26" rustls = { version = "0.23", default-features = false, features = ["logging", "ring", "std", "tls12"] } rustls-webpki = { version = "0.103", default-features = false, features = ["ring", "std"] } rustls-pemfile = "2.2.0" @@ -157,7 +157,7 @@ tonic = { version = "0.12.3", features = ["tls", "tls-roots"] } tonic-build = "0.12.3" tonic-health = "0.12.3" tonic-reflection = "0.12.3" -tower = "0.4.13" +tower = "0.5" twox-hash = "2.1.0" unicode-segmentation = "1.11.0" url = "2.5.0" @@ -166,38 +166,39 @@ uuid = { version = "1", features = ["v4", "v7", "serde"] } num = { version = "0.4.3" } # Core.git crates we depend on -arrow_util = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -authz = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -data_types = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -datafusion_util = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -executor = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -influxdb-line-protocol = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -influxdb_influxql_parser = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -influxdb_iox_client = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -iox_http = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -iox_http_util = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -iox_query = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -iox_query_params = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -iox_query_influxql = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -iox_system_tables = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -iox_time = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -metric = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -metric_exporters = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -object_store_metrics = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -observability_deps = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -panic_logging = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -parquet_file = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -query_functions = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -schema = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516", features = ["v3"]} -service_common = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -service_grpc_flight = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -test_helpers = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -tokio_metrics_bridge = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -trace = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -trace_exporters = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -trace_http = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -tracker = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516" } -trogging = { git = "https://github.com/influxdata/influxdb3_core", rev = "f1bc15655d50e07e2cb4d7a52acf5b1d24ff6516", features = ["clap"] } +arrow_util = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +authz = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +data_types = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +datafusion_util = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +executor = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +influxdb-line-protocol = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +influxdb_influxql_parser = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +influxdb_iox_client = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +iox_http = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +iox_http_util = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +iox_query = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +iox_query_params = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +iox_query_influxql = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +iox_system_tables = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +iox_time = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +iox_v1_query_api = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +metric = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +metric_exporters = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +object_store_metrics = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +observability_deps = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +panic_logging = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +parquet_file = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +query_functions = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +schema = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate", features = ["v3"]} +service_common = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +service_grpc_flight = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +test_helpers = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +tokio_metrics_bridge = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +trace = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +trace_exporters = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +trace_http = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +tracker = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate" } +trogging = { git = "https://github.com/influxdata/influxdb3_core", branch = "tjh/iox_v1_query_api-crate", features = ["clap"] } [workspace.lints.rust] missing_copy_implementations = "deny" diff --git a/influxdb3/src/commands/serve.rs b/influxdb3/src/commands/serve.rs index d89036f5c12..15dc6181145 100644 --- a/influxdb3/src/commands/serve.rs +++ b/influxdb3/src/commands/serve.rs @@ -1040,6 +1040,7 @@ pub async fn command(config: Config, user_params: HashMap) -> Re let write_buffer: Arc = write_buffer_impl; let common_state = CommonServerState::new( + Arc::clone(&catalog), Arc::clone(&metrics), trace_exporter, trace_header_parser, diff --git a/influxdb3/tests/cli/snapshots/lib__cli__fail_without_database_name.snap b/influxdb3/tests/cli/snapshots/lib__cli__fail_without_database_name.snap index 66910022bab..77d84767a01 100644 --- a/influxdb3/tests/cli/snapshots/lib__cli__fail_without_database_name.snap +++ b/influxdb3/tests/cli/snapshots/lib__cli__fail_without_database_name.snap @@ -5,6 +5,6 @@ expression: output error: the following required arguments were not provided: --database -Usage: influxdb3 show system --database --host +Usage: influxdb3 show system --database --host --token For more information, try '--help'. diff --git a/influxdb3/tests/server/mod.rs b/influxdb3/tests/server/mod.rs index 2d2b1a92c3b..39639913b6a 100644 --- a/influxdb3/tests/server/mod.rs +++ b/influxdb3/tests/server/mod.rs @@ -761,13 +761,7 @@ impl Drop for TestServer { } impl TestServer { - /// Write some line protocol to the server - pub async fn write_lp_to_db( - &self, - database: &str, - lp: impl ToString, - precision: Precision, - ) -> Result<(), influxdb3_client::Error> { + fn maybe_authorized_client(&self) -> influxdb3_client::Client { let mut client = influxdb3_client::Client::new( self.client_addr(), Some("../testing-certs/rootCA.pem".into()), @@ -776,6 +770,17 @@ impl TestServer { if let Some(token) = &self.auth_token { client = client.with_auth_token(token); } + client + } + + /// Write some line protocol to the server + pub async fn write_lp_to_db( + &self, + database: &str, + lp: impl ToString, + precision: Precision, + ) -> Result<(), influxdb3_client::Error> { + let client = self.maybe_authorized_client(); client .api_v3_write_lp(database) .body(lp.to_string()) @@ -784,6 +789,17 @@ impl TestServer { .await } + pub async fn api_v3_create_database( + &self, + database: &str, + retention_period: Option, + ) -> Result<(), influxdb3_client::Error> { + let client = self.maybe_authorized_client(); + client + .api_v3_configure_db_create(database, retention_period) + .await + } + pub async fn api_v3_create_table( &self, database: &str, @@ -791,14 +807,7 @@ impl TestServer { tags: Vec, fields: Vec<(String, FieldType)>, ) -> Result<(), influxdb3_client::Error> { - let mut client = influxdb3_client::Client::new( - self.client_addr(), - Some("../testing-certs/rootCA.pem".into()), - ) - .unwrap(); - if let Some(token) = &self.auth_token { - client = client.with_auth_token(token); - } + let client = self.maybe_authorized_client(); client .api_v3_configure_table_create(database, table, tags, fields) diff --git a/influxdb3/tests/server/query.rs b/influxdb3/tests/server/query.rs index ea6a87548bf..a40d2c77679 100644 --- a/influxdb3/tests/server/query.rs +++ b/influxdb3/tests/server/query.rs @@ -1,11 +1,12 @@ use core::str; +use std::time::Duration; use crate::server::TestServer; use futures::StreamExt; use influxdb3_client::Precision; use pretty_assertions::assert_eq; -use reqwest::StatusCode; -use reqwest::header::{ACCEPT, HeaderMap, HeaderValue}; +use reqwest::header::{ACCEPT, CONTENT_TYPE, HeaderMap, HeaderValue}; +use reqwest::{Method, StatusCode}; use serde::Serialize; use serde_json::{Value, json}; use test_helpers::assert_contains; @@ -716,7 +717,10 @@ async fn api_v1_query_sql_not_found() { ("db", "foo"), ]; let resp = server.api_v1_query(¶ms, None).await; - assert_eq!(resp.status(), StatusCode::NOT_FOUND); + assert_eq!(resp.status(), StatusCode::OK); + let actual = resp.json::().await.unwrap(); + let expected = json!({"results":[{"statement_id":0,"error":"Cannot retrieve database: External error: database not found: foo"}]}); + assert_eq!(expected, actual, "json response did not match"); } #[tokio::test] @@ -884,11 +888,11 @@ async fn api_v1_query_json_format() { "host", "usage" ], - "name": "mem", + "name": "cpu", "values": [ - ["2065-01-07T17:28:54Z", "a", 0.5], - ["2065-01-07T17:28:55Z", "a", 0.6], - ["2065-01-07T17:28:56Z", "a", 0.7] + ["2065-01-07T17:28:51Z", "a", 0.9], + ["2065-01-07T17:28:52Z", "a", 0.89], + ["2065-01-07T17:28:53Z", "a", 0.85] ] }, { @@ -897,11 +901,11 @@ async fn api_v1_query_json_format() { "host", "usage" ], - "name": "cpu", + "name": "mem", "values": [ - ["2065-01-07T17:28:51Z", "a", 0.9], - ["2065-01-07T17:28:52Z", "a", 0.89], - ["2065-01-07T17:28:53Z", "a", 0.85] + ["2065-01-07T17:28:54Z", "a", 0.5], + ["2065-01-07T17:28:55Z", "a", 0.6], + ["2065-01-07T17:28:56Z", "a", 0.7] ] } ], @@ -1022,7 +1026,7 @@ async fn api_v1_query_csv_format() { expected: "name,tags,time,host,usage\n\ cpu,,2998574931000000000,a,0.9\n\ cpu,,2998574932000000000,a,0.89\n\ - cpu,,2998574933000000000,a,0.85\n\r\n", + cpu,,2998574933000000000,a,0.85\n", }, // Basic Query with multiple measurements: TestCase { @@ -1030,12 +1034,12 @@ async fn api_v1_query_csv_format() { epoch: None, query: "SELECT time, host, usage FROM cpu, mem", expected: "name,tags,time,host,usage\n\ - mem,,2998574934000000000,a,0.5\n\ - mem,,2998574935000000000,a,0.6\n\ - mem,,2998574936000000000,a,0.7\n\ cpu,,2998574931000000000,a,0.9\n\ cpu,,2998574932000000000,a,0.89\n\ - cpu,,2998574933000000000,a,0.85\n\r\n", + cpu,,2998574933000000000,a,0.85\n\ + mem,,2998574934000000000,a,0.5\n\ + mem,,2998574935000000000,a,0.6\n\ + mem,,2998574936000000000,a,0.7\n", }, // Basic Query with db in query string: TestCase { @@ -1045,7 +1049,7 @@ async fn api_v1_query_csv_format() { expected: "name,tags,time,host,usage\n\ cpu,,2998574931000000000,a,0.9\n\ cpu,,2998574932000000000,a,0.89\n\ - cpu,,2998574933000000000,a,0.85\n\r\n", + cpu,,2998574933000000000,a,0.85\n", }, // Basic Query epoch parameter set: TestCase { @@ -1055,7 +1059,7 @@ async fn api_v1_query_csv_format() { expected: "name,tags,time,host,usage\n\ cpu,,2998574931,a,0.9\n\ cpu,,2998574932,a,0.89\n\ - cpu,,2998574933,a,0.85\n\r\n", + cpu,,2998574933,a,0.85\n", }, ]; @@ -1137,9 +1141,11 @@ async fn api_v1_query_chunked() { json!({ "results": [ { + "partial": true, "series": [ { "name": "cpu", + "partial": true, "columns": ["time","host","usage"], "values": [ [2998574931u32, "a", 0.9], @@ -1177,6 +1183,7 @@ async fn api_v1_query_chunked() { json!({ "results": [ { + "partial": true, "series": [ { "name": "cpu", @@ -1220,9 +1227,11 @@ async fn api_v1_query_chunked() { json!({ "results": [ { + "partial": true, "series": [ { "name": "cpu", + "partial": true, "columns": ["time","host","usage"], "values": [ [2998574931u32, "a", 0.9], @@ -1237,6 +1246,7 @@ async fn api_v1_query_chunked() { json!({ "results": [ { + "partial": true, "series": [ { "name": "cpu", @@ -1253,9 +1263,11 @@ async fn api_v1_query_chunked() { json!({ "results": [ { + "partial": true, "series": [ { "name": "mem", + "partial": true, "columns": ["time","host","usage"], "values": [ [2998574934u32, "a", 0.5], @@ -1359,7 +1371,7 @@ async fn api_v1_query_data_conversion() { ], "name": "weather", "values": [ - ["2065-01-07T17:28:50Z", "us-midwest", 82, 82.0, "too warm", true], + ["2065-01-07T17:28:50Z", "us-midwest", 82, 82, "too warm", true], ] } ], @@ -1412,13 +1424,13 @@ async fn api_v1_query_uri_and_body() { #[derive(Debug, Serialize)] struct Params<'a> { - #[serde(rename = "q")] - query: Option<&'a str>, + q: Option<&'a str>, db: Option<&'a str>, } struct TestCase<'a> { description: &'a str, + method: Method, uri: Option>, body: Option>, expected_status: StatusCode, @@ -1428,8 +1440,9 @@ async fn api_v1_query_uri_and_body() { let test_cases = [ TestCase { description: "query and db in uri", + method: Method::GET, uri: Some(Params { - query: Some("SELECT * FROM cpu"), + q: Some("SELECT * FROM cpu"), db: Some("foo"), }), body: None, @@ -1471,53 +1484,63 @@ async fn api_v1_query_uri_and_body() { }, TestCase { description: "query in uri, db in body", + method: Method::POST, uri: Some(Params { - query: Some("SELECT * FROM cpu"), + q: Some("SELECT * FROM cpu"), db: None, }), body: Some(Params { - query: None, + q: None, db: Some("foo"), }), expected_status: StatusCode::OK, // don't care about the response: - expected_body: None, + expected_body: Some( + json!({"results":[{"statement_id":0,"series":[{"name":"cpu","columns":["time","host","usage"],"values":[["2065-01-08T21:15:31Z","a",0.9],["2065-01-08T21:15:31Z","b",0.89],["2065-01-08T21:15:31Z","c",0.85]]}]}]}), + ), }, TestCase { description: "query in uri, db in uri overwritten by db in body", + method: Method::POST, uri: Some(Params { - query: Some("SELECT * FROM cpu"), + q: Some("SELECT * FROM cpu"), db: Some("not_a_valid_db"), }), body: Some(Params { - query: None, + q: None, db: Some("foo"), }), expected_status: StatusCode::OK, - expected_body: None, + expected_body: Some( + json!({"results":[{"statement_id":0,"series":[{"name":"cpu","columns":["time","host","usage"],"values":[["2065-01-08T21:15:31Z","a",0.9],["2065-01-08T21:15:31Z","b",0.89],["2065-01-08T21:15:31Z","c",0.85]]}]}]}), + ), }, TestCase { description: "query in uri, db in uri overwritten by db in body, db not valid", + method: Method::POST, uri: Some(Params { - query: Some("SELECT * FROM cpu"), + q: Some("SELECT * FROM cpu"), db: Some("foo"), }), body: Some(Params { - query: None, + q: None, db: Some("not_a_valid_db"), }), // db does not exist: - expected_status: StatusCode::NOT_FOUND, - expected_body: None, + expected_status: StatusCode::OK, + expected_body: Some( + json!({"results":[{"statement_id":0,"error":"Cannot retrieve database: External error: database not found: not_a_valid_db"}]}), + ), }, TestCase { description: "db in uri, query in body", + method: Method::POST, uri: Some(Params { - query: None, + q: None, db: Some("foo"), }), body: Some(Params { - query: Some("SELECT * FROM mem"), + q: Some("SELECT * FROM mem"), db: None, }), expected_status: StatusCode::OK, @@ -1558,48 +1581,56 @@ async fn api_v1_query_uri_and_body() { }, TestCase { description: "no query specified", + method: Method::POST, uri: Some(Params { - query: None, + q: None, db: Some("foo"), }), - body: Some(Params { - query: None, - db: None, - }), + body: Some(Params { q: None, db: None }), expected_status: StatusCode::BAD_REQUEST, - expected_body: None, + expected_body: Some( + json!({"error":"expected a query to be provided in the query string or body"}), + ), }, ]; for t in test_cases { + println!("test: {desc}", desc = t.description); let url = format!("{base}/query", base = server.client_addr()); - // test both GET and POST: - for mut req in [server.http_client.get(&url), server.http_client.post(&url)] { - println!("test: {desc}", desc = t.description); - if let Some(ref uri) = t.uri { - req = req.query(uri); - } - if let Some(ref body) = t.body { - req = req.body(serde_urlencoded::to_string(body).expect("serialize body")); - } - let resp = req.send().await.expect("send request"); - let status = resp.status(); - assert_eq!( - t.expected_status, status, - "status code did not match expectation" - ); - if let Some(ref expected_body) = t.expected_body { - let actual = resp.json::().await.expect("parse JSON body"); - if expected_body != &actual { - // use a panic so we can format the output for copy/paste more easily: - panic!( - "JSON body did not match expectation,\n\ + let mut req = if let Method::GET = t.method { + server.http_client.get(&url) + } else if let Method::POST = t.method { + server.http_client.post(&url) + } else { + panic!("unexpected method"); + }; + if let Some(ref uri) = t.uri { + req = req.query(uri); + } + if let Some(ref body) = t.body { + req = req.body(serde_urlencoded::to_string(body).expect("serialize body")); + req = req.header(CONTENT_TYPE, "application/x-www-form-urlencoded"); + } + let resp = req.send().await.expect("send request"); + let status = resp.status(); + if let Some(ref expected_body) = t.expected_body { + let actual = resp.json::().await.expect("parse JSON body"); + if expected_body != &actual { + // use a panic so we can format the output for copy/paste more easily: + panic!( + "JSON body did not match expectation,\n\ expected:\n{expected_body:#}\n\ actual:\n{actual:#}" - ); - } + ); } + } else { + let body = resp.text().await.expect("repsonse body"); + println!("response body: \n{body}\n"); } + assert_eq!( + t.expected_status, status, + "status code did not match expectation" + ); } } @@ -1703,8 +1734,8 @@ async fn test_influxql_group_by_tag_called_name() { .await .unwrap(); println!("response when grouping by `label`:\n\n{resp:#}\n"); - assert_eq!(resp.pointer("/results/0/series/0/tags/label").unwrap(), "b"); - assert_eq!(resp.pointer("/results/0/series/1/tags/label").unwrap(), "a"); + assert_eq!(resp.pointer("/results/0/series/0/tags/label").unwrap(), "a"); + assert_eq!(resp.pointer("/results/0/series/1/tags/label").unwrap(), "b"); // query grouping on `\"name\"`, i.e., quoted, should also be fine: let quoted_query_str = "SELECT time, \"name\", label, value FROM bar GROUP BY \"name\" LIMIT 1"; @@ -1715,8 +1746,8 @@ async fn test_influxql_group_by_tag_called_name() { .await .unwrap(); println!("response when grouping by `\"name\"`:\n\n{resp:#}\n"); - assert_eq!(resp.pointer("/results/0/series/0/tags/name").unwrap(), "b"); - assert_eq!(resp.pointer("/results/0/series/1/tags/name").unwrap(), "a"); + assert_eq!(resp.pointer("/results/0/series/0/tags/name").unwrap(), "a"); + assert_eq!(resp.pointer("/results/0/series/1/tags/name").unwrap(), "b"); } #[tokio::test] @@ -1769,6 +1800,69 @@ async fn api_v1_query_group_by_with_nulls() { } } +#[tokio::test] +async fn api_v1_query_api_show_databases_and_retention_policies() { + let server = TestServer::spawn().await; + + server.api_v3_create_database("foo", None).await.unwrap(); + server + .api_v3_create_database("bar", Some(Duration::from_secs(30 * 24 * 60 * 60))) + .await + .unwrap(); + + let response = server + .api_v1_query(&[("q", "SHOW DATABASES")], None) + .await + .text() + .await + .unwrap(); + + insta::with_settings!({ + description => "SHOW DATABASES", + }, { + insta::assert_snapshot!(response); + }); + + let response = server + .api_v1_query(&[("q", "SHOW RETENTION POLICIES"), ("db", "foo")], None) + .await + .text() + .await + .unwrap(); + + insta::with_settings!({ + description => "SHOW RETENTION POLICIES on foo db", + }, { + insta::assert_snapshot!(response); + }); + + let response = server + .api_v1_query(&[("q", "SHOW RETENTION POLICIES"), ("db", "bar")], None) + .await + .text() + .await + .unwrap(); + + insta::with_settings!({ + description => "SHOW RETENTION POLICIES on bar db", + }, { + insta::assert_snapshot!(response); + }); + + let response = server + .api_v1_query(&[("q", "SHOW RETENTION POLICIES"), ("db", "frodo")], None) + .await + .text() + .await + .unwrap(); + + insta::with_settings!({ + description => "SHOW RETENTION POLICIES on non-existent db", + }, { + insta::assert_snapshot!(response); + }); +} + #[tokio::test] async fn api_v3_query_sql_distinct_cache() { let server = TestServer::spawn().await; diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases.snap new file mode 100644 index 00000000000..d6231511d49 --- /dev/null +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases.snap @@ -0,0 +1,6 @@ +--- +source: influxdb3/tests/server/query.rs +description: SHOW DATABASES +expression: response +--- +{"results":[{"statement_id":0,"series":[{"name":"databases","columns":["name"],"values":[["_internal"],["foo"],["bar"]]}]}]} diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies-2.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies-2.snap new file mode 100644 index 00000000000..260254604a6 --- /dev/null +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies-2.snap @@ -0,0 +1,6 @@ +--- +source: influxdb3/tests/server/query.rs +description: SHOW RETENTION POLICIES on foo db +expression: response +--- +{"results":[{"statement_id":0,"series":[{"name":"retention_policies","columns":["name","duration","default"],"values":[["foo",null,true]]}]}]} diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies-3.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies-3.snap new file mode 100644 index 00000000000..6cbf7be7067 --- /dev/null +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies-3.snap @@ -0,0 +1,6 @@ +--- +source: influxdb3/tests/server/query.rs +description: SHOW RETENTION POLICIES on bar db +expression: response +--- +{"results":[{"statement_id":0,"series":[{"name":"retention_policies","columns":["name","duration","default"],"values":[["bar","30days",true]]}]}]} diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies-4.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies-4.snap new file mode 100644 index 00000000000..0833600e0dd --- /dev/null +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies-4.snap @@ -0,0 +1,6 @@ +--- +source: influxdb3/tests/server/query.rs +description: SHOW RETENTION POLICIES on non-existent db +expression: response +--- +{"results":[{"statement_id":0,"error":"datafusion error: Error during planning: database not found: frodo"}]} diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies.snap new file mode 100644 index 00000000000..d6231511d49 --- /dev/null +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_api_show_databases_and_retention_policies.snap @@ -0,0 +1,6 @@ +--- +source: influxdb3/tests/server/query.rs +description: SHOW DATABASES +expression: response +--- +{"results":[{"statement_id":0,"series":[{"name":"databases","columns":["name"],"values":[["_internal"],["foo"],["bar"]]}]}]} diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-10.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-10.snap index f9555d9337d..5b3e578aaf0 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-10.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-10.snap @@ -7,6 +7,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -21,7 +22,7 @@ expression: values "values": [ [ "2065-01-07T17:28:51Z", - 1.0 + 1 ] ] } @@ -33,6 +34,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -47,7 +49,7 @@ expression: values "values": [ [ "2065-01-07T17:28:53Z", - 3.0 + 3 ] ] } @@ -59,6 +61,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -73,7 +76,7 @@ expression: values "values": [ [ "2065-01-07T17:28:52Z", - 2.0 + 2 ] ] } @@ -99,7 +102,7 @@ expression: values "values": [ [ "2065-01-07T17:28:54Z", - 4.0 + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-11.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-11.snap index 8022b0794c6..3f1176b4e9f 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-11.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-11.snap @@ -15,14 +15,14 @@ expression: values ], "name": "bar", "tags": { - "t1": "b", - "t2": "bb", + "t1": "a", + "t2": "aa", "t3": "" }, "values": [ [ - "2065-01-07T17:28:54Z", - 4.0 + "2065-01-07T17:28:51Z", + 1 ] ] }, @@ -33,14 +33,14 @@ expression: values ], "name": "bar", "tags": { - "t1": "b", - "t2": "aa", + "t1": "a", + "t2": "bb", "t3": "" }, "values": [ [ - "2065-01-07T17:28:52Z", - 2.0 + "2065-01-07T17:28:53Z", + 3 ] ] }, @@ -51,14 +51,14 @@ expression: values ], "name": "bar", "tags": { - "t1": "a", - "t2": "bb", + "t1": "b", + "t2": "aa", "t3": "" }, "values": [ [ - "2065-01-07T17:28:53Z", - 3.0 + "2065-01-07T17:28:52Z", + 2 ] ] }, @@ -69,14 +69,14 @@ expression: values ], "name": "bar", "tags": { - "t1": "a", - "t2": "aa", + "t1": "b", + "t2": "bb", "t3": "" }, "values": [ [ - "2065-01-07T17:28:51Z", - 1.0 + "2065-01-07T17:28:54Z", + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-12.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-12.snap index 76f9493fe0a..78b90681c7b 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-12.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-12.snap @@ -7,6 +7,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -22,7 +23,7 @@ expression: values "values": [ [ "2065-01-07T17:28:51Z", - 1.0 + 1 ] ] } @@ -34,6 +35,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -49,7 +51,7 @@ expression: values "values": [ [ "2065-01-07T17:28:53Z", - 3.0 + 3 ] ] } @@ -61,6 +63,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -76,7 +79,7 @@ expression: values "values": [ [ "2065-01-07T17:28:52Z", - 2.0 + 2 ] ] } @@ -103,7 +106,7 @@ expression: values "values": [ [ "2065-01-07T17:28:54Z", - 4.0 + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-13.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-13.snap index 266739bb0e0..87e39949612 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-13.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-13.snap @@ -15,13 +15,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "b", - "t2": "bb" + "t1": "a", + "t2": "aa" }, "values": [ [ - "2065-01-07T17:28:54Z", - 4.0 + "2065-01-07T17:28:51Z", + 1 ] ] }, @@ -32,13 +32,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "b", - "t2": "aa" + "t1": "a", + "t2": "bb" }, "values": [ [ - "2065-01-07T17:28:52Z", - 2.0 + "2065-01-07T17:28:53Z", + 3 ] ] }, @@ -49,13 +49,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "a", - "t2": "bb" + "t1": "b", + "t2": "aa" }, "values": [ [ - "2065-01-07T17:28:53Z", - 3.0 + "2065-01-07T17:28:52Z", + 2 ] ] }, @@ -66,13 +66,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "a", - "t2": "aa" + "t1": "b", + "t2": "bb" }, "values": [ [ - "2065-01-07T17:28:51Z", - 1.0 + "2065-01-07T17:28:54Z", + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-14.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-14.snap index 8fa39fee9ac..a41efb9f3c9 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-14.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-14.snap @@ -7,6 +7,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -21,7 +22,7 @@ expression: values "values": [ [ "2065-01-07T17:28:51Z", - 1.0 + 1 ] ] } @@ -33,6 +34,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -47,7 +49,7 @@ expression: values "values": [ [ "2065-01-07T17:28:53Z", - 3.0 + 3 ] ] } @@ -59,6 +61,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -73,7 +76,7 @@ expression: values "values": [ [ "2065-01-07T17:28:52Z", - 2.0 + 2 ] ] } @@ -99,7 +102,7 @@ expression: values "values": [ [ "2065-01-07T17:28:54Z", - 4.0 + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-15.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-15.snap index ab892c1d0d3..9ead2f5e1ee 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-15.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-15.snap @@ -17,19 +17,19 @@ expression: values "values": [ [ "2065-01-07T17:28:51Z", - 1.0 + 1 ], [ "2065-01-07T17:28:52Z", - 2.0 + 2 ], [ "2065-01-07T17:28:53Z", - 3.0 + 3 ], [ "2065-01-07T17:28:54Z", - 4.0 + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-16.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-16.snap index e5136b02d73..1209a0c5b4c 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-16.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-16.snap @@ -17,19 +17,19 @@ expression: values "values": [ [ "2065-01-07T17:28:51Z", - 1.0 + 1 ], [ "2065-01-07T17:28:52Z", - 2.0 + 2 ], [ "2065-01-07T17:28:53Z", - 3.0 + 3 ], [ "2065-01-07T17:28:54Z", - 4.0 + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-2.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-2.snap index 5c862a55355..a8a47121f7d 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-2.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-2.snap @@ -7,6 +7,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -22,12 +23,12 @@ expression: values [ "2065-01-07T17:28:51Z", "aa", - 1.0 + 1 ], [ "2065-01-07T17:28:53Z", "bb", - 3.0 + 3 ] ] } @@ -54,12 +55,12 @@ expression: values [ "2065-01-07T17:28:52Z", "aa", - 2.0 + 2 ], [ "2065-01-07T17:28:54Z", "bb", - 4.0 + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-3.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-3.snap index f6e395adddd..2d76be58f7b 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-3.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-3.snap @@ -15,13 +15,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "b", - "t2": "bb" + "t1": "a", + "t2": "aa" }, "values": [ [ - "2065-01-07T17:28:54Z", - 4.0 + "2065-01-07T17:28:51Z", + 1 ] ] }, @@ -32,13 +32,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "b", - "t2": "aa" + "t1": "a", + "t2": "bb" }, "values": [ [ - "2065-01-07T17:28:52Z", - 2.0 + "2065-01-07T17:28:53Z", + 3 ] ] }, @@ -49,13 +49,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "a", - "t2": "bb" + "t1": "b", + "t2": "aa" }, "values": [ [ - "2065-01-07T17:28:53Z", - 3.0 + "2065-01-07T17:28:52Z", + 2 ] ] }, @@ -66,13 +66,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "a", - "t2": "aa" + "t1": "b", + "t2": "bb" }, "values": [ [ - "2065-01-07T17:28:51Z", - 1.0 + "2065-01-07T17:28:54Z", + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-4.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-4.snap index 783b65cc025..916eaa1eb7e 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-4.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-4.snap @@ -7,6 +7,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -21,7 +22,7 @@ expression: values "values": [ [ "2065-01-07T17:28:51Z", - 1.0 + 1 ] ] } @@ -33,6 +34,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -47,7 +49,7 @@ expression: values "values": [ [ "2065-01-07T17:28:53Z", - 3.0 + 3 ] ] } @@ -59,6 +61,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -73,7 +76,7 @@ expression: values "values": [ [ "2065-01-07T17:28:52Z", - 2.0 + 2 ] ] } @@ -99,7 +102,7 @@ expression: values "values": [ [ "2065-01-07T17:28:54Z", - 4.0 + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-5.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-5.snap index 0ee623c4fc9..71e6b3fd680 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-5.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-5.snap @@ -15,13 +15,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "b", - "t2": "bb" + "t1": "a", + "t2": "aa" }, "values": [ [ - "2065-01-07T17:28:54Z", - 4.0 + "2065-01-07T17:28:51Z", + 1 ] ] }, @@ -32,13 +32,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "b", - "t2": "aa" + "t1": "a", + "t2": "bb" }, "values": [ [ - "2065-01-07T17:28:52Z", - 2.0 + "2065-01-07T17:28:53Z", + 3 ] ] }, @@ -49,13 +49,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "a", - "t2": "bb" + "t1": "b", + "t2": "aa" }, "values": [ [ - "2065-01-07T17:28:53Z", - 3.0 + "2065-01-07T17:28:52Z", + 2 ] ] }, @@ -66,13 +66,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "a", - "t2": "aa" + "t1": "b", + "t2": "bb" }, "values": [ [ - "2065-01-07T17:28:51Z", - 1.0 + "2065-01-07T17:28:54Z", + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-6.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-6.snap index ea8fd5ba599..a1e96f88392 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-6.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-6.snap @@ -7,6 +7,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -21,7 +22,7 @@ expression: values "values": [ [ "2065-01-07T17:28:51Z", - 1.0 + 1 ] ] } @@ -33,6 +34,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -47,7 +49,7 @@ expression: values "values": [ [ "2065-01-07T17:28:53Z", - 3.0 + 3 ] ] } @@ -59,6 +61,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -73,7 +76,7 @@ expression: values "values": [ [ "2065-01-07T17:28:52Z", - 2.0 + 2 ] ] } @@ -99,7 +102,7 @@ expression: values "values": [ [ "2065-01-07T17:28:54Z", - 4.0 + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-7.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-7.snap index 8d0641f5c46..16642bd8a56 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-7.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-7.snap @@ -15,16 +15,16 @@ expression: values ], "name": "bar", "tags": { - "t1": "b" + "t1": "a" }, "values": [ [ - "2065-01-07T17:28:52Z", - 2.0 + "2065-01-07T17:28:51Z", + 1 ], [ - "2065-01-07T17:28:54Z", - 4.0 + "2065-01-07T17:28:53Z", + 3 ] ] }, @@ -35,16 +35,16 @@ expression: values ], "name": "bar", "tags": { - "t1": "a" + "t1": "b" }, "values": [ [ - "2065-01-07T17:28:51Z", - 1.0 + "2065-01-07T17:28:52Z", + 2 ], [ - "2065-01-07T17:28:53Z", - 3.0 + "2065-01-07T17:28:54Z", + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-8.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-8.snap index be3ec2a5c0d..b5768713cd6 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-8.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-8.snap @@ -7,6 +7,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -20,11 +21,11 @@ expression: values "values": [ [ "2065-01-07T17:28:51Z", - 1.0 + 1 ], [ "2065-01-07T17:28:53Z", - 3.0 + 3 ] ] } @@ -49,11 +50,11 @@ expression: values "values": [ [ "2065-01-07T17:28:52Z", - 2.0 + 2 ], [ "2065-01-07T17:28:54Z", - 4.0 + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-9.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-9.snap index 1332706d13d..2710ffde7c1 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-9.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by-9.snap @@ -15,13 +15,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "b", - "t2": "bb" + "t1": "a", + "t2": "aa" }, "values": [ [ - "2065-01-07T17:28:54Z", - 4.0 + "2065-01-07T17:28:51Z", + 1 ] ] }, @@ -32,13 +32,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "b", - "t2": "aa" + "t1": "a", + "t2": "bb" }, "values": [ [ - "2065-01-07T17:28:52Z", - 2.0 + "2065-01-07T17:28:53Z", + 3 ] ] }, @@ -49,13 +49,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "a", - "t2": "bb" + "t1": "b", + "t2": "aa" }, "values": [ [ - "2065-01-07T17:28:53Z", - 3.0 + "2065-01-07T17:28:52Z", + 2 ] ] }, @@ -66,13 +66,13 @@ expression: values ], "name": "bar", "tags": { - "t1": "a", - "t2": "aa" + "t1": "b", + "t2": "bb" }, "values": [ [ - "2065-01-07T17:28:51Z", - 1.0 + "2065-01-07T17:28:54Z", + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by.snap index 2d94ee4a1c3..d1b658338ed 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by.snap @@ -16,18 +16,18 @@ expression: values ], "name": "bar", "tags": { - "t1": "b" + "t1": "a" }, "values": [ [ - "2065-01-07T17:28:52Z", + "2065-01-07T17:28:51Z", "aa", - 2.0 + 1 ], [ - "2065-01-07T17:28:54Z", + "2065-01-07T17:28:53Z", "bb", - 4.0 + 3 ] ] }, @@ -39,18 +39,18 @@ expression: values ], "name": "bar", "tags": { - "t1": "a" + "t1": "b" }, "values": [ [ - "2065-01-07T17:28:51Z", + "2065-01-07T17:28:52Z", "aa", - 1.0 + 2 ], [ - "2065-01-07T17:28:53Z", + "2065-01-07T17:28:54Z", "bb", - 3.0 + 4 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by_with_nulls-2.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by_with_nulls-2.snap index 62b073aef43..25868616170 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by_with_nulls-2.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by_with_nulls-2.snap @@ -7,6 +7,7 @@ expression: values { "results": [ { + "partial": true, "series": [ { "columns": [ @@ -20,11 +21,11 @@ expression: values "values": [ [ "2065-01-07T17:28:51Z", - 1.0 + 1 ], [ "2065-01-07T17:28:53Z", - 3.0 + 3 ] ] } @@ -49,7 +50,7 @@ expression: values "values": [ [ "2065-01-07T17:28:52Z", - 2.0 + 2 ] ] } diff --git a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by_with_nulls.snap b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by_with_nulls.snap index 59c9c163e9c..4be5483f065 100644 --- a/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by_with_nulls.snap +++ b/influxdb3/tests/server/snapshots/lib__server__query__api_v1_query_group_by_with_nulls.snap @@ -15,12 +15,16 @@ expression: values ], "name": "bar", "tags": { - "t1": "" + "t1": "a" }, "values": [ [ - "2065-01-07T17:28:52Z", - 2.0 + "2065-01-07T17:28:51Z", + 1 + ], + [ + "2065-01-07T17:28:53Z", + 3 ] ] }, @@ -31,16 +35,12 @@ expression: values ], "name": "bar", "tags": { - "t1": "a" + "t1": "" }, "values": [ [ - "2065-01-07T17:28:51Z", - 1.0 - ], - [ - "2065-01-07T17:28:53Z", - 3.0 + "2065-01-07T17:28:52Z", + 2 ] ] } diff --git a/influxdb3_catalog/src/catalog/versions/v2/update.rs b/influxdb3_catalog/src/catalog/versions/v2/update.rs index d320748bf87..f34a9ca161c 100644 --- a/influxdb3_catalog/src/catalog/versions/v2/update.rs +++ b/influxdb3_catalog/src/catalog/versions/v2/update.rs @@ -90,6 +90,13 @@ pub struct CreateDatabaseOptions { pub retention_period: Option, } +impl CreateDatabaseOptions { + pub fn retention_period(mut self, retention_period: Duration) -> Self { + self.retention_period = Some(retention_period); + self + } +} + #[derive(Default, Debug, Clone, Copy)] pub struct CreateTableOptions { pub field_family_mode: FieldFamilyMode, diff --git a/influxdb3_clap_blocks/src/datafusion.rs b/influxdb3_clap_blocks/src/datafusion.rs index 798ff964b19..883f819a513 100644 --- a/influxdb3_clap_blocks/src/datafusion.rs +++ b/influxdb3_clap_blocks/src/datafusion.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; -use datafusion::config::ConfigExtension; -use iox_query::config::IoxConfigExt; +use iox_query::config::IOX_CONFIG_PREFIX; /// Extends the standard [`HashMap`] based DataFusion config option in the CLI with specific /// options (along with defaults) for InfluxDB 3 Core/Enterprise. This is intended for customization of @@ -75,13 +74,13 @@ impl IoxQueryDatafusionConfig { /// with the value provided for the `--datafusion-max-parquet-fanout` argument. pub fn build(mut self) -> HashMap { self.datafusion_config.insert( - format!("{prefix}.max_parquet_fanout", prefix = IoxConfigExt::PREFIX), + format!("{prefix}.max_parquet_fanout", prefix = IOX_CONFIG_PREFIX), self.max_parquet_fanout.to_string(), ); self.datafusion_config.insert( format!( "{prefix}.use_cached_parquet_loader", - prefix = IoxConfigExt::PREFIX + prefix = IOX_CONFIG_PREFIX ), self.use_cached_parquet_loader.to_string(), ); @@ -91,7 +90,7 @@ impl IoxQueryDatafusionConfig { self.datafusion_config.insert( format!( "{prefix}.hint_known_object_size_to_object_store", - prefix = IoxConfigExt::PREFIX + prefix = IOX_CONFIG_PREFIX ), false.to_string(), ); diff --git a/influxdb3_internal_api/Cargo.toml b/influxdb3_internal_api/Cargo.toml index 6e7c51976c7..01e7b9a4f3e 100644 --- a/influxdb3_internal_api/Cargo.toml +++ b/influxdb3_internal_api/Cargo.toml @@ -9,18 +9,26 @@ license.workspace = true # Core Crates influxdb_influxql_parser.workspace = true iox_query.workspace = true +iox_query_influxql.workspace = true iox_query_params.workspace = true +schema.workspace = true trace.workspace = true trace_http.workspace = true tracker.workspace = true # Local Crates +influxdb3_catalog = { path = "../influxdb3_catalog" } # Crates.io dependencies anyhow.workspace = true async-trait.workspace = true datafusion.workspace = true +humantime.workspace = true thiserror.workspace = true +[dev-dependencies] +tokio.workspace = true +futures.workspace = true + [lints] workspace = true diff --git a/influxdb3_internal_api/src/query_executor.rs b/influxdb3_internal_api/src/query_executor.rs index c9c10dc7ce1..5237033e007 100644 --- a/influxdb3_internal_api/src/query_executor.rs +++ b/influxdb3_internal_api/src/query_executor.rs @@ -1,11 +1,20 @@ use async_trait::async_trait; +use datafusion::arrow::array::{Array, BooleanArray, RecordBatch, StringArray}; +use datafusion::arrow::datatypes::{DataType, Field, Schema, SchemaRef}; use datafusion::arrow::error::ArrowError; use datafusion::common::DataFusionError; use datafusion::execution::SendableRecordBatchStream; +use datafusion::physical_plan::memory::MemoryStream; +use humantime::format_duration; use influxdb_influxql_parser::statement::Statement; +use influxdb3_catalog::catalog::Catalog; +use influxdb3_catalog::log::RetentionPeriod; use iox_query::query_log::QueryLogEntries; use iox_query::{QueryDatabase, QueryNamespace}; +use iox_query_influxql::show_databases::{InfluxQlShowDatabases, generate_metadata}; +use iox_query_influxql::show_retention_policies::InfluxQlShowRetentionPolicies; use iox_query_params::StatementParams; +use schema::INFLUXQL_MEASUREMENT_COLUMN_NAME; use std::fmt::Debug; use std::sync::Arc; use trace::ctx::SpanContext; @@ -85,6 +94,286 @@ pub trait QueryExecutor: QueryDatabase + Debug + Send + Sync + 'static { fn upcast(&self) -> Arc; } +#[derive(Debug)] +pub struct ShowDatabases(Arc); + +impl ShowDatabases { + pub fn new(catalog: Arc) -> Arc { + Arc::new(Self(catalog)) + } +} + +#[async_trait::async_trait] +impl InfluxQlShowDatabases for ShowDatabases { + /// Produce the Arrow schema for the `SHOW DATABASES` InfluxQL query + fn schema(&self) -> SchemaRef { + Arc::new( + Schema::new(vec![ + Field::new(INFLUXQL_MEASUREMENT_COLUMN_NAME, DataType::Utf8, false), + Field::new("name", DataType::Utf8, false), + ]) + .with_metadata(generate_metadata(0)), + ) + } + + /// Produce a record batch stream containing the results for the `SHOW DATABASES` query + async fn show_databases( + &self, + database_names: Vec, + ) -> Result { + let databases = self + .0 + .db_names() + .into_iter() + .filter(|db| database_names.contains(db)) + .collect::>(); + let measurement_array: StringArray = vec!["databases"; databases.len()].into(); + let names_array: StringArray = databases.into(); + let arrays = vec![ + Arc::new(measurement_array) as Arc, + Arc::new(names_array) as Arc, + ]; + let batch = RecordBatch::try_new(self.schema(), arrays)?; + Ok(Box::pin(MemoryStream::try_new( + vec![batch], + self.schema(), + None, + )?)) + } +} + +#[cfg(test)] +mod show_databases_tests { + use std::sync::Arc; + + use datafusion::{ + arrow::array::RecordBatch, assert_batches_eq, execution::SendableRecordBatchStream, + }; + use futures::StreamExt; + use influxdb3_catalog::catalog::Catalog; + use iox_query_influxql::show_databases::InfluxQlShowDatabases; + + use crate::query_executor::ShowDatabases; + + #[tokio::test] + async fn test_show_databases() { + let catalog = Catalog::new_in_memory("test").await.map(Arc::new).unwrap(); + catalog.create_database("foo").await.unwrap(); + catalog.create_database("bar").await.unwrap(); + catalog.create_database("mop").await.unwrap(); + let show_databases = ShowDatabases::new(catalog); + for (dbs, expected) in [ + ( + vec!["foo"], + vec![ + "+------------------+------+", + "| iox::measurement | name |", + "+------------------+------+", + "| databases | foo |", + "+------------------+------+", + ], + ), + ( + vec!["foo", "bar"], + vec![ + "+------------------+------+", + "| iox::measurement | name |", + "+------------------+------+", + "| databases | foo |", + "| databases | bar |", + "+------------------+------+", + ], + ), + ( + vec!["foo", "bar", "mop"], + vec![ + "+------------------+------+", + "| iox::measurement | name |", + "+------------------+------+", + "| databases | foo |", + "| databases | bar |", + "| databases | mop |", + "+------------------+------+", + ], + ), + ] { + let stream = show_databases + .show_databases(dbs.into_iter().map(|s| s.to_string()).collect()) + .await + .unwrap(); + let batches = collect_stream(stream).await; + assert_batches_eq!(expected, &batches); + } + } + + async fn collect_stream(mut stream: SendableRecordBatchStream) -> Vec { + let mut batches = Vec::new(); + while let Some(batch) = stream.next().await { + batches.push(batch.unwrap()); + } + batches + } +} + +#[derive(Debug)] +pub struct ShowRetentionPolicies(Arc); + +impl ShowRetentionPolicies { + pub fn new(catalog: Arc) -> Arc { + Arc::new(Self(catalog)) + } +} + +/// Implementation of `SHOW RETENTION POLICIES` for the `/query` API. +/// +/// # Note +/// +/// The original v1 /query API reports the following fields: +/// +/// - `shardGroupDuration` +/// - `replicaN` +/// - `futureWriteLimit` +/// - `pastWriteLimit` +/// +/// These are not reported in this implementation since they do not represent anything in the +/// underlying database in v3. +#[async_trait::async_trait] +impl InfluxQlShowRetentionPolicies for ShowRetentionPolicies { + fn schema(&self) -> SchemaRef { + Arc::new( + Schema::new(vec![ + Field::new(INFLUXQL_MEASUREMENT_COLUMN_NAME, DataType::Utf8, false), + Field::new("name", DataType::Utf8, false), + // NOTE(tjh): duration is allowed to be nullable for databases that have `Indefinite` + // retention periods. + Field::new("duration", DataType::Utf8, true), + Field::new("default", DataType::Boolean, false), + ]) + .with_metadata(generate_metadata(0)), + ) + } + + async fn show_retention_policies( + &self, + db_name: String, + ) -> Result { + let Some(db) = self.0.db_schema(&db_name) else { + return Err(DataFusionError::Plan(format!( + "database not found: {db_name}" + ))); + }; + let measurement_array: StringArray = vec!["retention_policies"].into(); + let names_array: StringArray = vec![db.name().as_ref()].into(); + let rp = match &db.retention_period { + RetentionPeriod::Indefinite => None, + // NOTE(tjh): the v1 /query API reports the durations as string formatted durations, e.g., + // "1h30m0s", so use `humantime` to format the standard library `Duration` here. + RetentionPeriod::Duration(duration) => { + Some(format!("{dur}", dur = format_duration(*duration))) + } + }; + let durations_array: StringArray = vec![rp].into(); + let default_array: BooleanArray = vec![true].into(); + + let arrays = vec![ + Arc::new(measurement_array) as Arc, + Arc::new(names_array) as Arc, + Arc::new(durations_array) as Arc, + Arc::new(default_array) as Arc, + ]; + + let batch = RecordBatch::try_new(self.schema(), arrays)?; + Ok(Box::pin(MemoryStream::try_new( + vec![batch], + self.schema(), + None, + )?)) + } +} + +#[cfg(test)] +mod show_retention_policies_tests { + use std::{sync::Arc, time::Duration}; + + use datafusion::{ + arrow::array::RecordBatch, assert_batches_eq, execution::SendableRecordBatchStream, + }; + use futures::StreamExt; + use influxdb3_catalog::catalog::{Catalog, CreateDatabaseOptions}; + use iox_query_influxql::show_retention_policies::InfluxQlShowRetentionPolicies; + + use crate::query_executor::ShowRetentionPolicies; + + #[tokio::test] + async fn test_show_retention_policies() { + let catalog = Catalog::new_in_memory("test").await.map(Arc::new).unwrap(); + let days = |n_days: u64| Duration::from_secs(n_days * 24 * 60 * 60); + catalog + .create_database_opts( + "foo", + CreateDatabaseOptions::default().retention_period(days(7)), + ) + .await + .unwrap(); + catalog + .create_database_opts( + "bar", + CreateDatabaseOptions::default().retention_period(days(30)), + ) + .await + .unwrap(); + catalog.create_database("mop").await.unwrap(); + let show_retention_policies = ShowRetentionPolicies::new(catalog); + for (db, expected) in [ + ( + "foo", + vec![ + "+--------------------+------+----------+---------+", + "| iox::measurement | name | duration | default |", + "+--------------------+------+----------+---------+", + "| retention_policies | foo | 7days | true |", + "+--------------------+------+----------+---------+", + ], + ), + ( + "bar", + vec![ + "+--------------------+------+----------+---------+", + "| iox::measurement | name | duration | default |", + "+--------------------+------+----------+---------+", + "| retention_policies | bar | 30days | true |", + "+--------------------+------+----------+---------+", + ], + ), + ( + "mop", + vec![ + "+--------------------+------+----------+---------+", + "| iox::measurement | name | duration | default |", + "+--------------------+------+----------+---------+", + "| retention_policies | mop | | true |", + "+--------------------+------+----------+---------+", + ], + ), + ] { + let stream = show_retention_policies + .show_retention_policies(db.to_string()) + .await + .unwrap(); + let batches = collect_stream(stream).await; + assert_batches_eq!(expected, &batches); + } + } + + async fn collect_stream(mut stream: SendableRecordBatchStream) -> Vec { + let mut batches = Vec::new(); + while let Some(batch) = stream.next().await { + batches.push(batch.unwrap()); + } + batches + } +} + #[derive(Debug, Copy, Clone)] pub struct UnimplementedQueryExecutor; diff --git a/influxdb3_server/Cargo.toml b/influxdb3_server/Cargo.toml index 39fd71da915..66c30762c92 100644 --- a/influxdb3_server/Cargo.toml +++ b/influxdb3_server/Cargo.toml @@ -19,6 +19,7 @@ iox_http_util.workspace = true iox_query.workspace = true iox_query_params.workspace = true iox_time.workspace = true +iox_v1_query_api.workspace = true metric.workspace = true metric_exporters.workspace = true observability_deps.workspace = true diff --git a/influxdb3_server/src/http.rs b/influxdb3_server/src/http.rs index 621707dd7f1..cfd4c799aa7 100644 --- a/influxdb3_server/src/http.rs +++ b/influxdb3_server/src/http.rs @@ -35,7 +35,9 @@ use influxdb3_catalog::CatalogError; use influxdb3_catalog::catalog::HardDeletionTime; use influxdb3_catalog::log::FieldDataType; use influxdb3_id::TokenId; -use influxdb3_internal_api::query_executor::{QueryExecutor, QueryExecutorError}; +use influxdb3_internal_api::query_executor::{ + QueryExecutor, QueryExecutorError, ShowDatabases, ShowRetentionPolicies, +}; use influxdb3_process::{ INFLUXDB3_BUILD, INFLUXDB3_GIT_HASH_SHORT, INFLUXDB3_VERSION, ProcessUuidWrapper, }; @@ -57,6 +59,7 @@ use iox_http_util::{ use iox_query_influxql_rewrite as rewrite; use iox_query_params::StatementParams; use iox_time::{Time, TimeProvider}; +use iox_v1_query_api::V1HttpHandler; use observability_deps::tracing::{debug, error, info, trace, warn}; use serde::Deserialize; use serde::Serialize; @@ -75,8 +78,6 @@ use trace::ctx::SpanContext; use unicode_segmentation::UnicodeSegmentation; use uuid::Uuid; -mod v1; - pub(crate) const UNKNOWN_VAL: &str = "unknown"; #[derive(Debug, Error)] @@ -232,9 +233,6 @@ pub enum Error { )] InfluxqlDatabaseMismatch { param_db: String, query_db: String }, - #[error("v1 query API error: {0}")] - V1Query(#[from] v1::QueryError), - #[error("Operation with object store failed: {0}")] ObjectStore(#[from] object_store::Error), @@ -430,6 +428,29 @@ impl IntoResponse for V2WriteApiError { } } +#[derive(Debug, Serialize)] +struct V1ErrorResponse { + error: String, +} + +impl IntoResponse for iox_v1_query_api::HttpError { + fn into_response(self) -> Response { + let (status, error) = match self { + Self::NotFound(s) => (StatusCode::NOT_FOUND, s), + Self::Unauthorized(s) => { + // Ensure opaque error message on unauthorized: + warn!(error = s, "unauthorized access attemot to /query API"); + (StatusCode::UNAUTHORIZED, "unauthorized access".to_string()) + } + Self::Invalid(s) => (StatusCode::BAD_REQUEST, s), + Self::InternalError(s) => (StatusCode::INTERNAL_SERVER_ERROR, s), + }; + let response = V1ErrorResponse { error }; + let body = bytes_to_response_body(serde_json::to_vec(&response).unwrap()); + ResponseBuilder::new().status(status).body(body).unwrap() + } +} + #[derive(Debug, Serialize)] struct ErrorMessage { error: String, @@ -2349,7 +2370,24 @@ pub(crate) async fn route_request( (Method::GET | Method::POST, all_paths::API_V3_QUERY_INFLUXQL) => { http_server.query_influxql(req).await } - (Method::GET | Method::POST, all_paths::API_V1_QUERY) => http_server.v1_query(req).await, + (Method::GET | Method::POST, all_paths::API_V1_QUERY) => { + let handler = V1HttpHandler::new( + Arc::clone(&http_server.query_executor) as _, + Some(http_server.authorizer.upcast()), + http_server.common_state.trace_collector(), + INFLUXDB3_VERSION.to_string(), + ) + .with_show_databases(ShowDatabases::new(Arc::clone( + &http_server.common_state.catalog, + ))) + .with_show_retention_policies(ShowRetentionPolicies::new(Arc::clone( + &http_server.common_state.catalog, + ))); + match handler.route_request(req).await { + Ok(r) => Ok(r), + Err(e) => return Ok(e.into_response()), + } + } (Method::GET, all_paths::API_V3_HEALTH | all_paths::API_V1_HEALTH) => http_server.health(), (Method::GET | Method::POST, all_paths::API_PING) => http_server.ping(), (Method::GET, all_paths::API_METRICS) => http_server.handle_metrics(), diff --git a/influxdb3_server/src/http/v1.rs b/influxdb3_server/src/http/v1.rs deleted file mode 100644 index a76b514c415..00000000000 --- a/influxdb3_server/src/http/v1.rs +++ /dev/null @@ -1,1111 +0,0 @@ -use std::{ - collections::{HashMap, VecDeque}, - ops::{Deref, DerefMut}, - pin::Pin, - sync::Arc, - task::{Context, Poll}, -}; - -use anyhow::{Context as AnyhowContext, bail}; -use arrow::{ - array::{ArrayRef, AsArray, as_string_array}, - compute::{CastOptions, cast_with_options}, - datatypes::{ - DataType, Float16Type, Float32Type, Float64Type, Int8Type, Int16Type, Int32Type, Int64Type, - TimeUnit, TimestampMicrosecondType, TimestampMillisecondType, TimestampNanosecondType, - TimestampSecondType, UInt8Type, UInt16Type, UInt32Type, UInt64Type, - }, - record_batch::RecordBatch, -}; -use arrow_schema::{Field, SchemaRef}; -use bytes::Bytes; -use chrono::{DateTime, format::SecondsFormat}; -use datafusion::physical_plan::SendableRecordBatchStream; -use futures::{Stream, StreamExt, TryStreamExt, ready, stream::Fuse}; -use hyper::http::HeaderValue; -use hyper::{StatusCode, header::ACCEPT, header::CONTENT_TYPE}; -use influxdb_influxql_parser::select::{Dimension, GroupByClause}; -use iox_http_util::{Request, Response, ResponseBuilder, stream_results_to_response_body}; -use observability_deps::tracing::info; -use regex::Regex; -use schema::{INFLUXQL_MEASUREMENT_COLUMN_NAME, InfluxColumnType, TIME_COLUMN_NAME}; -use serde::{Deserialize, Serialize}; -use serde_json::Value; - -use super::{Error, HttpApi, Result}; - -const DEFAULT_CHUNK_SIZE: usize = 10_000; - -impl HttpApi { - /// Implements the v1 query API for InfluxDB - /// - /// Accepts the URL parameters, defined by [`QueryParams`]), and returns a stream - /// of [`QueryResponse`]s. If the `chunked` parameter is set to `true`, then the - /// response stream will be chunked into chunks of size `chunk_size`, if provided, - /// or 10,000. For InfluxQL queries that select from multiple measurements, chunks - /// will be split on the `chunk_size`, or series, whichever comes first. - pub(super) async fn v1_query(&self, req: Request) -> Result { - // extract params first from URI: - let uri_params = QueryParams::from_request_uri(&req)?; - // determine the format from the request headers now because we need to consume req to get - // the body: - let mut format = QueryFormat::from_request(&req)?; - // now get the parameters provided in the body: - let body = self.read_body(req).await?; - let body_params = serde_urlencoded::from_bytes::(&body)?; - // now combine them, overwriting parameters from the uri with those from the body: - let combined_params = body_params.combine(uri_params); - // qualify the combination to ensure there is a query string: - let qualified_params = combined_params.qualify()?; - info!(?qualified_params, "handle v1 query API"); - - let QualifiedQueryParams { - chunk_size, - database, - epoch, - pretty, - query, - } = qualified_params; - - let epoch = epoch.or(match format { - QueryFormat::Csv => Some(Precision::Nanoseconds), - _ => None, - }); - - if pretty { - format = format.to_pretty(); - } - - // TODO - Currently not supporting parameterized queries, see - // https://github.com/influxdata/influxdb/issues/24805 - let (stream, group_by) = self.query_influxql_inner(database, &query, None).await?; - let stream = QueryResponseStream::new(0, stream, chunk_size, format, epoch, group_by) - .map_err(QueryError)?; - let body = stream_results_to_response_body(stream.map_err(QueryError)); - - Ok(ResponseBuilder::new() - .status(StatusCode::OK) - .header(CONTENT_TYPE, format.as_content_type()) - .body(body) - .unwrap()) - } -} - -/// Query parameters for the v1 /query API -/// -/// The original API supports a `u` parameter, for "username", as well as a `p`, for "password". -/// The password is extracted upstream, and username is ignored. -/// -/// This makes all fields optional, so that the params can be parsed from both the request URI as -/// well as the request body, and then combined. This must be qualified via [`QueryParams::qualify`] -/// to ensure validity of the incoming request. -#[derive(Debug, Deserialize)] -struct QueryParams { - /// Chunk the response into chunks of size `chunk_size`, or 10,000, or by series - chunked: Option, - /// Define the number of records that will go into a chunk - chunk_size: Option, - /// Database to perform the query against - /// - /// This is optional because the query string may specify the database - #[serde(rename = "db")] - database: Option, - /// Map timestamps to UNIX epoch time, with the given precision - #[allow(dead_code)] - epoch: Option, - /// Format the JSON outputted in pretty format - pretty: Option, - /// The InfluxQL query string - /// - /// This is optional only for deserialization, since we first extract from the request URI - /// then from the body and combine the two sources. - #[serde(rename = "q")] - query: Option, -} - -impl QueryParams { - /// Extract [`QueryParams`] from an HTTP [`Request`] - fn from_request_uri(req: &Request) -> Result { - let query = req.uri().query().unwrap_or_default(); - serde_urlencoded::from_str(query).map_err(Into::into) - } - - /// Combine two [`QueryParams`] objects, prioritizing values in `self` over `other`. - fn combine(self, other: Self) -> Self { - Self { - chunked: self.chunked.or(other.chunked), - chunk_size: self.chunk_size.or(other.chunk_size), - database: self.database.or(other.database), - epoch: self.epoch.or(other.epoch), - pretty: self.pretty.or(other.pretty), - query: self.query.or(other.query), - } - } - - /// Qualify this [`QueryParams`] to determine chunk size and ensure a query string was provided - fn qualify(self) -> Result { - let chunk_size = self - .chunked - .unwrap_or_default() - .then(|| self.chunk_size.unwrap_or(DEFAULT_CHUNK_SIZE)); - let query = self.query.ok_or(Error::MissingQueryV1Params)?; - Ok(QualifiedQueryParams { - chunk_size, - database: self.database, - epoch: self.epoch, - pretty: self.pretty.unwrap_or_default(), - query, - }) - } -} - -/// Qualified version of [`QueryParams`] -#[derive(Debug)] -struct QualifiedQueryParams { - chunk_size: Option, - database: Option, - epoch: Option, - pretty: bool, - query: String, -} - -/// Enum representing the query format for the v1/query API. -/// -/// The original API supports CSV, JSON, and "pretty" JSON formats. -#[derive(Debug, Deserialize, Clone, Copy)] -#[serde(rename_all = "snake_case")] -pub(crate) enum QueryFormat { - Csv, - Json, - JsonPretty, -} - -impl QueryFormat { - /// Returns the content type as a string slice for the query format. - /// - /// Maps the `QueryFormat` variants to their corresponding MIME types as strings. - /// This is useful for setting the `Content-Type` header in HTTP responses. - fn as_content_type(&self) -> &str { - match self { - Self::Csv => "application/csv", - Self::Json | Self::JsonPretty => "application/json", - } - } - - /// Checks if the query format is 'JsonPretty'. - /// - /// Determines if the `QueryFormat` is `JsonPretty`, which indicates that the JSON - /// output should be formatted in a human-readable way. Returns `true` if the - /// format is `JsonPretty`, otherwise returns `false`. - fn is_pretty(&self) -> bool { - match self { - Self::Csv | Self::Json => false, - Self::JsonPretty => true, - } - } - - /// Extracts the [`QueryFormat`] from an HTTP [`Request`]. - /// - /// The function inspects the `Accept` header of the request to determine the - /// format, defaulting to JSON if no specific format is requested. If the format - /// is invalid or non-UTF8, an error is returned. - fn from_request(req: &Request) -> Result { - let mime_type = req.headers().get(ACCEPT).map(HeaderValue::as_bytes); - match mime_type { - Some(b"application/csv" | b"text/csv") => Ok(Self::Csv), - // the default is JSON: - Some(b"application/json" | b"*/*") | None => Ok(Self::Json), - Some(mime_type) => match String::from_utf8(mime_type.to_vec()) { - Ok(s) => Err(Error::InvalidMimeType(s)), - Err(e) => Err(Error::NonUtf8MimeType(e)), - }, - } - } - - /// Convert this from JSON to pretty printed JSON - fn to_pretty(self) -> Self { - match self { - Self::Csv => Self::Csv, - Self::Json | Self::JsonPretty => Self::JsonPretty, - } - } -} - -/// UNIX epoch precision -#[derive(Debug, Deserialize, Clone, Copy)] -enum Precision { - #[serde(rename = "ns")] - Nanoseconds, - #[serde(rename = "u", alias = "ยต")] - Microseconds, - #[serde(rename = "ms")] - Milliseconds, - #[serde(rename = "s")] - Seconds, - #[serde(rename = "m")] - Minutes, - #[serde(rename = "h")] - Hours, -} - -/// Error type for the v1 API -/// -/// This is used to catch errors that occur during the streaming process. -/// [`anyhow::Error`] is used as a catch-all because if anything fails during -/// that process it will result in a 500 INTERNAL ERROR. -#[derive(Debug, thiserror::Error)] -#[error("unexpected query error: {0:#}")] -pub struct QueryError(#[from] anyhow::Error); - -/// The response structure returned by the v1 query API -/// -/// The `pretty` parameter is used during serizliaztion to determine if JSON -/// is pretty formatted or not. -#[derive(Debug, Serialize)] -struct QueryResponse { - results: Vec, - #[serde(skip_serializing)] - format: QueryFormat, -} - -/// Convert `QueryResponse` to [`Bytes`] for the [`stream_results_to_response_body`] method -impl From for Bytes { - fn from(s: QueryResponse) -> Self { - /// Convert a [`QueryResponse`] to a JSON byte vector. - /// - /// This function serializes the `QueryResponse` to JSON. If the format is - /// `JsonPretty`, it will produce human-readable JSON, otherwise it produces - /// compact JSON. - fn to_json(s: QueryResponse) -> Vec { - if s.format.is_pretty() { - serde_json::to_vec_pretty(&s) - .expect("Failed to serialize QueryResponse to pretty JSON") - } else { - serde_json::to_vec(&s).expect("Failed to serialize QueryResponse to JSON") - } - } - - /// Convert a [`QueryResponse`] to a CSV byte vector. - /// - /// This function serializes the `QueryResponse` to CSV format. It dynamically - /// extracts column names from the first series and writes the header and data - /// rows to the CSV writer. - fn to_csv(s: QueryResponse) -> Vec { - let mut wtr = csv::WriterBuilder::new() - .quote_style(csv::QuoteStyle::Never) - .from_writer(vec![]); - // Extract column names dynamically from the first series - let mut headers = vec!["name", "tags"]; - if let Some(first_statement) = s.results.first() - && let Some(first_series) = first_statement.series.first() - { - headers.extend(first_series.columns.iter().map(|s| s.as_str())); - } - // Write the header - wtr.write_record(&headers) - .expect("Failed to write CSV header"); - - // Iterate through the hierarchical structure of QueryResponse to write data - // to the CSV writer. The loop processes each statement, series, and row to - // build and write CSV records. Each record is initialized with the series name - // and an empty tag field, followed by the string representations of the row's values. - // Finally, the record is written to the CSV writer - for statement in s.results { - for series in statement.series { - for row in series.values { - let mut record = vec![series.name.clone(), "".to_string()]; - for v in row.0 { - record.push(match v { - Value::String(s) => s.clone(), - _ => v.to_string(), - }); - } - wtr.write_record(&record) - .expect("Failed to write CSV record"); - } - } - } - - // Flush the CSV writer to ensure all data is written - wtr.flush().expect("flush csv writer"); - - wtr.into_inner().expect("into_inner from csv writer") - } - /// Extend a byte vector with CRLF and convert it to [`Bytes`]. - /// - /// This function appends a CRLF (`\r\n`) sequence to the given byte vector - /// and converts it to a `Bytes` object. - fn extend_with_crlf(mut bytes: Vec) -> Bytes { - bytes.extend_from_slice(b"\r\n"); - Bytes::from(bytes) - } - - match s.format { - QueryFormat::Json | QueryFormat::JsonPretty => extend_with_crlf(to_json(s)), - QueryFormat::Csv => extend_with_crlf(to_csv(s)), - } - } -} - -/// The response to an individual InfluxQL query -#[derive(Debug, Serialize)] -struct StatementResponse { - statement_id: usize, - #[serde(skip_serializing_if = "Vec::is_empty")] - series: Vec, -} - -/// The records produced for a single time series (measurement) -#[derive(Debug, Serialize)] -struct Series { - name: String, - #[serde(skip_serializing_if = "Option::is_none")] - tags: Option>>, - columns: Vec, - values: Vec, -} - -/// A single row, or record in a time series -#[derive(Debug, Serialize)] -struct Row(Vec); - -impl Deref for Row { - type Target = Vec; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for Row { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -/// A buffer for storing records from a stream of [`RecordBatch`]es -/// -/// The optional `size` indicates whether this is operating in `chunked` mode (see -/// [`QueryResponseStream`]), and when specified, gives the size of chunks that will -/// be emitted. -#[derive(Debug)] -struct ChunkBuffer { - size: Option, - series: VecDeque<(String, BufferGroupByTagSet, Vec)>, -} - -impl ChunkBuffer { - fn new(size: Option) -> Self { - Self { - size, - series: VecDeque::new(), - } - } - - /// Get the name of the current measurement [`Series`] being streamed - fn current_measurement_name(&self) -> Option<&str> { - self.series.front().map(|(n, _, _)| n.as_str()) - } - - /// For queries that produce multiple [`Series`], this will be called when - /// the current series is completed streaming - fn push_next_measurement>(&mut self, name: S) { - self.series.push_front((name.into(), None, vec![])); - } - - /// Push a new [`Row`] into the current measurement [`Series`] - /// - /// If the stream is producing tags that are part of a `GROUP BY` clause, then `group_by` should - /// hold a map of those tag keys to tag values for the given row. - fn push_row( - &mut self, - group_by: Option>>, - row: Row, - ) -> Result<(), anyhow::Error> { - let (_, tags, rows) = self - .series - .front() - .context("tried to push row with no measurements buffered")?; - - // Usually series are split on the measurement name. This functin is not concerned with - // that split, as the caller does that. However, if we are processing a query with a `GROUP BY` - // clause, then we make the decision here. If the incoming `group_by` tag key/value pairs do - // not match the those for the current row set, then we need to start a new entry in the - // `series` on the chunk buffer. - use BufferGroupByDecision::*; - let group_by_decision = match (tags, &group_by) { - (None, None) => NotAGroupBy, - (Some(tags), Some(group_by)) => { - if group_by.len() == tags.len() { - if group_by == tags { - NewRowInExistingSet - } else { - NewSet - } - } else { - bail!( - "group by columns in query result and chunk buffer are not the same size" - ); - } - } - (None, Some(_)) => { - if rows.is_empty() { - FirstRowInSeries - } else { - bail!("received inconsistent group by tags in query result"); - } - } - (Some(_), None) => bail!( - "chunk buffer expects group by tags but none were present in the query result" - ), - }; - - match group_by_decision { - NotAGroupBy | NewRowInExistingSet => self.series.front_mut().unwrap().2.push(row), - FirstRowInSeries => { - let (_, tags, rows) = self.series.front_mut().unwrap(); - *tags = group_by; - rows.push(row); - } - NewSet => { - let name = self.series.front().unwrap().0.clone(); - self.series.push_front((name, group_by, vec![row])); - } - } - - Ok(()) - } - - /// Flush a single chunk from the [`ChunkBuffer`], if possible - fn flush_one(&mut self) -> Option<(String, BufferGroupByTagSet, Vec)> { - if !self.can_flush() { - return None; - } - // we can flush, so unwrap is safe: - let size = self.size.unwrap(); - if self - .series - .back() - .is_some_and(|(_, _, rows)| rows.len() <= size) - { - // the back series is smaller than the chunk size, so we just - // pop and take the whole thing: - self.series.pop_back() - } else { - // only drain a chunk's worth from the back series: - self.series.back_mut().map(|(name, tags, rows)| { - (name.to_owned(), tags.clone(), rows.drain(..size).collect()) - }) - } - } - - /// The [`ChunkBuffer`] is operating in chunked mode, and can flush a chunk - fn can_flush(&self) -> bool { - if let (Some(size), Some(m)) = (self.size, self.series.back()) { - m.2.len() >= size || self.series.len() > 1 - } else { - false - } - } - - /// The [`ChunkBuffer`] is empty - fn is_empty(&self) -> bool { - self.series.is_empty() - } -} - -/// Convenience type for representing an optional map of tag name to optional tag values -type BufferGroupByTagSet = Option>>; - -/// Decide how to handle an incoming set of `GROUP BY` tag key value pairs when pushing a row into -/// the `ChunkBuffer` -enum BufferGroupByDecision { - /// The query is not using a `GROUP BY` with tags - NotAGroupBy, - /// This is the first time a row has been pushed to the series with this `GROUP BY` tag - /// key/value combination - FirstRowInSeries, - /// Still adding rows to the current set of `GROUP BY` tag key/value pairs - NewRowInExistingSet, - /// The incoming set of `GROUP BY` tag key/value pairs do not match, so we need to start a - /// new row set in the series. - NewSet, -} - -/// The state of the [`QueryResponseStream`] -enum State { - /// The initial state of the stream; no query results have been streamed - Initialized, - /// Rows have been buffered and/or flushed; query results are being streamed - Buffering, - /// The stream is done - Done, -} - -impl State { - fn is_initialized(&self) -> bool { - matches!(self, Self::Initialized) - } -} - -/// A wrapper around a [`SendableRecordBatchStream`] that buffers streamed -/// [`RecordBatch`]es and outputs [`QueryResponse`]s -/// -/// Can operate in `chunked` mode, in which case, the `chunk_size` provided -/// will determine how often [`QueryResponse`]s are emitted. When not in -/// `chunked` mode, the entire input stream of [`RecordBatch`]es will be buffered -/// into memory before being emitted. -/// -/// `format` will emit CSV, JSON or pretty formatted JSON. -/// -/// Providing an `epoch` [`Precision`] will have the `time` column values emitted -/// as UNIX epoch times with the given precision. -/// -/// The input stream is wrapped in [`Fuse`], because of the [`Stream`] implementation -/// below, it is possible that the input stream is polled after completion. -struct QueryResponseStream { - buffer: ChunkBuffer, - input: Fuse, - column_map: ColumnMap, - statement_id: usize, - format: QueryFormat, - epoch: Option, - state: State, -} - -impl QueryResponseStream { - /// Create a new [`QueryResponseStream`] - /// - /// Specifying a `chunk_size` will have the stream operate in `chunked` mode. - fn new( - statement_id: usize, - input: SendableRecordBatchStream, - chunk_size: Option, - format: QueryFormat, - epoch: Option, - group_by_clause: Option, - ) -> Result { - let schema = input.schema(); - let buffer = ChunkBuffer::new(chunk_size); - let column_map = ColumnMap::new(schema, group_by_clause)?; - Ok(Self { - buffer, - column_map, - input: input.fuse(), - format, - statement_id, - epoch, - state: State::Initialized, - }) - } - - fn buffer_record_batch(&mut self, mut batch: RecordBatch) -> Result<(), anyhow::Error> { - if self.epoch.is_some() { - // If the `epoch` is specified, then we cast the `time` column into an Int64. - // This will be in nanoseconds. The conversion to the given epoch precision - // happens below, when processing the JSON rows - batch = RecordBatch::try_from_iter(batch.schema().fields.iter().map(|f| { - let name = f.name(); - let column = batch.column_by_name(name).unwrap(); - ( - name, - if name == TIME_COLUMN_NAME { - // unwrap should be safe here because the time column cast to Int64 - cast_with_options(column, &DataType::Int64, &CastOptions::default()) - .unwrap() - } else { - Arc::clone(column) - }, - ) - })) - .context("failed to cast batch time column with `epoch` parameter specified")?; - } - let column_map = &self.column_map; - let columns = batch.columns(); - let schema = batch.schema(); - - for row_index in 0..batch.num_rows() { - let mut row = vec![Value::Null; column_map.row_size()]; - let mut tags = None; - - for (col_index, column) in columns.iter().enumerate() { - let field = schema.field(col_index); - let column_name = field.name(); - - let mut cell_value = if !column.is_valid(row_index) { - // NB(trevor): when doing a GROUP BY, the /query API will insert an empty - // string instead of a JSON `null` for tags in the group by clause whose - // value is `NULL`. - if column_map.is_group_by_tag(column_name) { - Value::String("".to_string()) - } else { - continue; - } - } else { - cast_column_value(column, row_index)? - }; - - // Handle the special case for the measurement column - if column_name == INFLUXQL_MEASUREMENT_COLUMN_NAME { - if let Value::String(ref measurement_name) = cell_value - && (self.buffer.current_measurement_name().is_none() - || self - .buffer - .current_measurement_name() - .is_some_and(|n| n != measurement_name)) - { - // we are on the "iox::measurement" column, which gives the name of the time series - // if we are on the first row, or if the measurement changes, we push into the - // buffer queue - self.buffer.push_next_measurement(measurement_name); - } - continue; - } - if column_name == TIME_COLUMN_NAME - && let Some(precision) = self.epoch - { - cell_value = convert_ns_epoch(cell_value, precision)? - } - if let Some(index) = column_map.as_row_index(column_name) { - row[index] = cell_value; - } else if column_map.is_group_by_tag(column_name) { - let tag_val = match cell_value { - Value::Null => None, - Value::String(s) => Some(s), - other => bail!( - "tag column {column_name} expected as a string or null, got {other:?}" - ), - }; - tags.get_or_insert_with(HashMap::new) - .insert(column_name.to_string(), tag_val); - } else if column_map.is_orphan_group_by_tag(column_name) { - tags.get_or_insert_with(HashMap::new) - .insert(column_name.to_string(), Some(String::default())); - } else { - bail!("failed to retrieve column position for column with name {column_name}"); - } - } - self.buffer.push_row(tags.take(), Row(row))?; - } - Ok(()) - } - - fn column_names(&self) -> Vec { - self.column_map.row_column_names() - } - - /// Flush a single chunk, or time series, when operating in chunked mode - fn flush_one(&mut self) -> QueryResponse { - let columns = self.column_names(); - // this unwrap is okay because we only ever call flush_one - // after calling can_flush on the buffer: - let (name, tags, values) = self.buffer.flush_one().unwrap(); - let series = vec![Series { - name, - tags, - columns, - values, - }]; - self.state = State::Buffering; - QueryResponse { - results: vec![StatementResponse { - statement_id: self.statement_id, - series, - }], - format: self.format, - } - } - - /// Flush the entire buffer - fn flush_all(&mut self) -> QueryResponse { - let columns = self.column_names(); - let series = self - .buffer - .series - .drain(..) - .map(|(name, tags, values)| Series { - name, - tags, - columns: columns.clone(), - values, - }) - .collect(); - self.state = State::Buffering; - QueryResponse { - results: vec![StatementResponse { - statement_id: self.statement_id, - series, - }], - format: self.format, - } - } - - /// Flush an empty query result - fn flush_empty(&mut self) -> QueryResponse { - self.state = State::Done; - QueryResponse { - results: vec![StatementResponse { - statement_id: self.statement_id, - series: vec![], - }], - format: self.format, - } - } -} - -/// Convert an epoch time in nanoseconds to the provided precision -fn convert_ns_epoch(value: Value, precision: Precision) -> Result { - let epoch_ns = value - .as_i64() - .context("the provided nanosecond epoch time was not a valid i64")?; - Ok(match precision { - Precision::Nanoseconds => epoch_ns, - Precision::Microseconds => epoch_ns / 1_000, - Precision::Milliseconds => epoch_ns / 1_000_000, - Precision::Seconds => epoch_ns / 1_000_000_000, - Precision::Minutes => epoch_ns / (1_000_000_000 * 60), - Precision::Hours => epoch_ns / (1_000_000_000 * 60 * 60), - } - .into()) -} - -/// Converts a value from an Arrow `ArrayRef` at a given row index into a `serde_json::Value`. -/// -/// This function handles various Arrow data types, converting them into their corresponding -/// JSON representations. For unsupported data types, it returns an error using the `anyhow` crate. -fn cast_column_value(column: &ArrayRef, row_index: usize) -> Result { - let value = match column.data_type() { - DataType::Boolean => Value::Bool(column.as_boolean().value(row_index)), - DataType::Null => Value::Null, - DataType::Int8 => Value::Number(column.as_primitive::().value(row_index).into()), - DataType::Int16 => { - Value::Number(column.as_primitive::().value(row_index).into()) - } - DataType::Int32 => { - Value::Number(column.as_primitive::().value(row_index).into()) - } - DataType::Int64 => { - Value::Number(column.as_primitive::().value(row_index).into()) - } - DataType::UInt8 => { - Value::Number(column.as_primitive::().value(row_index).into()) - } - DataType::UInt16 => { - Value::Number(column.as_primitive::().value(row_index).into()) - } - DataType::UInt32 => { - Value::Number(column.as_primitive::().value(row_index).into()) - } - DataType::UInt64 => { - Value::Number(column.as_primitive::().value(row_index).into()) - } - DataType::Float16 => Value::Number( - serde_json::Number::from_f64( - column - .as_primitive::() - .value(row_index) - .to_f64(), - ) - .context("failed to downcast Float16 column")?, - ), - DataType::Float32 => Value::Number( - serde_json::Number::from_f64( - column.as_primitive::().value(row_index).into(), - ) - .context("failed to downcast Float32 column")?, - ), - DataType::Float64 => Value::Number( - serde_json::Number::from_f64(column.as_primitive::().value(row_index)) - .context("failed to downcast Float64 column")?, - ), - DataType::Utf8 => Value::String(column.as_string::().value(row_index).to_string()), - DataType::LargeUtf8 => { - Value::String(column.as_string::().value(row_index).to_string()) - } - DataType::Dictionary(key, value) => match (key.as_ref(), value.as_ref()) { - (DataType::Int32, DataType::Utf8) => { - let dict_array = column.as_dictionary::(); - let keys = dict_array.keys(); - let values = as_string_array(dict_array.values()); - Value::String(values.value(keys.value(row_index) as usize).to_string()) - } - _ => Value::Null, - }, - DataType::Timestamp(TimeUnit::Nanosecond, None) => Value::String( - DateTime::from_timestamp_nanos( - column - .as_primitive::() - .value(row_index), - ) - .to_rfc3339_opts(SecondsFormat::AutoSi, true), - ), - DataType::Timestamp(TimeUnit::Microsecond, None) => Value::String( - DateTime::from_timestamp_micros( - column - .as_primitive::() - .value(row_index), - ) - .context("failed to downcast TimestampMicrosecondType column")? - .to_rfc3339_opts(SecondsFormat::AutoSi, true), - ), - DataType::Timestamp(TimeUnit::Millisecond, None) => Value::String( - DateTime::from_timestamp_millis( - column - .as_primitive::() - .value(row_index), - ) - .context("failed to downcast TimestampNillisecondType column")? - .to_rfc3339_opts(SecondsFormat::AutoSi, true), - ), - DataType::Timestamp(TimeUnit::Second, None) => Value::String( - DateTime::from_timestamp( - column - .as_primitive::() - .value(row_index), - 0, - ) - .context("failed to downcast TimestampSecondType column")? - .to_rfc3339_opts(SecondsFormat::AutoSi, true), - ), - t => bail!("Unsupported data type: {:?}", t), - }; - Ok(value) -} - -/// Map column names to their respective [`ColumnType`] -struct ColumnMap { - /// The map of column names to column types - map: HashMap, - /// How many columns are in the `values` set, i.e., that are not `GROUP BY` tags - row_size: usize, -} - -/// A column's type in the context of a v1 /query API response -enum ColumnType { - /// A value to be included in the `series.[].values` array, at the given `index` - Value { index: usize }, - /// A tag that is part of the `GROUP BY` clause, either explicitly, or by a regex/wildcard match - /// and is included in the `series.[].tags` map - GroupByTag, - /// This is a case where a GROUP BY clause contains a field which doesn't exist in the table - /// - /// For example, - /// ```text - /// select * from foo group by t1, t2 - /// ``` - /// If `t1` is a tag in the table, but `t2` is not, nor is a field in the table, then the v1 - /// /query API response will include `t2` in the `series.[].tags` property in the results with - /// an empty string for a value (`""`). - OrphanGroupByTag, -} - -impl ColumnMap { - /// Create a new `ColumnMap` - fn new( - schema: SchemaRef, - group_by_clause: Option, - ) -> Result { - let mut map = HashMap::new(); - let group_by = if let Some(clause) = group_by_clause { - GroupByEval::from_clause(clause)? - } else { - None - }; - let mut index = 0; - for field in schema - .fields() - .into_iter() - .filter(|f| f.name() != INFLUXQL_MEASUREMENT_COLUMN_NAME) - { - if group_by - .as_ref() - .is_some_and(|gb| is_tag(field) && gb.evaluate_tag(field.name())) - { - map.insert(field.name().to_string(), ColumnType::GroupByTag); - } else if group_by.as_ref().is_some_and(|gb| { - field.metadata().is_empty() && gb.contains_explicit_col_name(field.name()) - }) { - map.insert(field.name().to_string(), ColumnType::OrphanGroupByTag); - } else { - map.insert(field.name().to_string(), ColumnType::Value { index }); - index += 1; - } - } - Ok(Self { - map, - row_size: index, - }) - } - - fn row_size(&self) -> usize { - self.row_size - } - - fn row_column_names(&self) -> Vec { - let mut result = vec![None; self.row_size]; - self.map.iter().for_each(|(name, c)| { - if let ColumnType::Value { index } = c { - result[*index].replace(name.to_owned()); - } - }); - result.into_iter().flatten().collect() - } - - /// If this column is part of the `values` row data, get its index, or `None` otherwise - fn as_row_index(&self, column_name: &str) -> Option { - self.map.get(column_name).and_then(|col| match col { - ColumnType::Value { index } => Some(*index), - ColumnType::GroupByTag | ColumnType::OrphanGroupByTag => None, - }) - } - - /// This column is a `GROUP BY` tag - fn is_group_by_tag(&self, column_name: &str) -> bool { - self.map - .get(column_name) - .is_some_and(|col| matches!(col, ColumnType::GroupByTag)) - } - - /// This column is an orphan `GROUP BY` tag - fn is_orphan_group_by_tag(&self, column_name: &str) -> bool { - self.map - .get(column_name) - .is_some_and(|col| matches!(col, ColumnType::OrphanGroupByTag)) - } -} - -// TODO: this is defined in schema crate, so needs to be made pub there: -const COLUMN_METADATA_KEY: &str = "iox::column::type"; - -/// Decide based on metadata if this [`Field`] is a tag column -fn is_tag(field: &Arc) -> bool { - field - .metadata() - .get(COLUMN_METADATA_KEY) - .map(|s| InfluxColumnType::try_from(s.as_str())) - .transpose() - .ok() - .flatten() - .is_some_and(|t| matches!(t, InfluxColumnType::Tag)) -} - -/// Derived from a [`GroupByClause`] and used to evaluate whether a given tag column is part of the -/// `GROUP BY` clause in an InfluxQL query -struct GroupByEval(Vec); - -/// The kind of `GROUP BY` evaluator -enum GroupByEvalType { - /// An explicit tag name in a `GROUP BY` clause, e.g., `GROUP BY t1, t2` - Tag(String), - /// A regex in a `GROUP BY` that could match 0-or-more tags, e.g., `GROUP BY /t[1,2]/` - Regex(Regex), - /// A wildcard that matches all tags, e.g., `GROUP BY *` - Wildcard, -} - -impl GroupByEval { - /// Convert a [`GroupByClause`] to a [`GroupByEval`] if any of its members match on tag columns - /// - /// This will produce an error if an invalid regex is provided as one of the `GROUP BY` clauses. - /// That will likely be caught upstream during query parsing, but handle it here anyway. - fn from_clause(clause: GroupByClause) -> Result, anyhow::Error> { - let v = clause - .iter() - .filter_map(|dim| match dim { - Dimension::Time(_) => None, - Dimension::VarRef(tag) => { - Some(Ok(GroupByEvalType::Tag(tag.name.as_str().to_string()))) - } - Dimension::Regex(regex) => Some( - Regex::new(regex.as_str()) - .map(GroupByEvalType::Regex) - .context("invalid regex in group by clause"), - ), - Dimension::Wildcard => Some(Ok(GroupByEvalType::Wildcard)), - }) - .collect::, anyhow::Error>>()?; - - if v.is_empty() { - Ok(None) - } else { - Ok(Some(Self(v))) - } - } - - /// Check if a tag is matched by this set of `GROUP BY` clauses - fn evaluate_tag(&self, tag_name: &str) -> bool { - self.0.iter().any(|eval| eval.test(tag_name)) - } - - /// Check if the tag name is included explicitly in the `GROUP BY` clause. - /// - /// This is for determining orphan `GROUP BY` tag columns. - fn contains_explicit_col_name(&self, col_name: &str) -> bool { - self.0.iter().any(|eval| match eval { - GroupByEvalType::Tag(t) => t == col_name, - _ => false, - }) - } -} - -impl GroupByEvalType { - /// Test the given `tag_name` agains this evaluator - fn test(&self, tag_name: &str) -> bool { - match self { - Self::Tag(t) => t == tag_name, - Self::Regex(regex) => regex.is_match(tag_name), - Self::Wildcard => true, - } - } -} - -impl Stream for QueryResponseStream { - type Item = Result; - - fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - // check for data in the buffer that can be flushed, if we are operating in chunked mode, - // this will drain the buffer as much as possible by repeatedly returning Ready here - // until the buffer can no longer flush, and before the input stream is polled again: - if self.buffer.can_flush() { - return Poll::Ready(Some(Ok(self.flush_one()))); - } - // poll the input record batch stream: - match ready!(self.input.poll_next_unpin(cx)) { - Some(Ok(batch)) => { - // buffer the yielded batch: - if let Err(e) = self.buffer_record_batch(batch) { - return Poll::Ready(Some(Err(e))); - } - if self.buffer.can_flush() { - // if we can flush the buffer, do so now, and return - Poll::Ready(Some(Ok(self.flush_one()))) - } else { - // otherwise, we want to poll again in order to pull more - // batches from the input record batch stream: - cx.waker().wake_by_ref(); - Poll::Pending - } - } - Some(Err(e)) => Poll::Ready(Some(Err(e.into()))), - None => { - if !self.buffer.is_empty() { - // we only get here if we are not operating in chunked mode and - // we need to flush the entire buffer at once, OR if we are in chunked - // mode, and there is less than a chunk's worth of records left - // - // this is why the input stream is fused, because we will end up - // polling the input stream again if we end up here. - Poll::Ready(Some(Ok(self.flush_all()))) - // Poll::Ready(None) - } else if self.state.is_initialized() { - // we are still in an initialized state, which means no records were buffered - // and therefore we need to emit an empty result set before ending the stream: - Poll::Ready(Some(Ok(self.flush_empty()))) - } else { - // this ends the stream: - Poll::Ready(None) - } - } - } - } -} diff --git a/influxdb3_server/src/lib.rs b/influxdb3_server/src/lib.rs index 0171d31b945..ecfae7b3e0a 100644 --- a/influxdb3_server/src/lib.rs +++ b/influxdb3_server/src/lib.rs @@ -28,6 +28,7 @@ use hyper_util::server::conn::auto::Builder as ConnectionBuilder; use hyper_util::server::graceful::GracefulShutdown; use hyper_util::service::TowerToHyperService; use influxdb3_authz::AuthProvider; +use influxdb3_catalog::catalog::Catalog; use influxdb3_telemetry::store::TelemetryStore; use observability_deps::tracing::error; use observability_deps::tracing::info; @@ -88,6 +89,7 @@ pub type Result = std::result::Result; #[derive(Debug, Clone)] pub struct CommonServerState { + catalog: Arc, metrics: Arc, trace_exporter: Option>, trace_header_parser: TraceHeaderParser, @@ -96,12 +98,14 @@ pub struct CommonServerState { impl CommonServerState { pub fn new( + catalog: Arc, metrics: Arc, trace_exporter: Option>, trace_header_parser: TraceHeaderParser, telemetry_store: Arc, ) -> Self { Self { + catalog, metrics, trace_exporter, trace_header_parser, @@ -1747,6 +1751,7 @@ mod tests { ); let write_buffer: Arc = write_buffer_impl; let common_state = crate::CommonServerState::new( + Arc::clone(&catalog), Arc::clone(&metrics), None, trace_header_parser,