diff --git a/Cargo.lock b/Cargo.lock index 1f6f31de2cf76..edae74d715f75 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,16 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + [[package]] name = "addr2line" version = "0.21.0" @@ -23,17 +33,50 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + [[package]] name = "aes" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if", "cipher", "cpufeatures", ] +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "aes-kw" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69fa2b352dcefb5f7f3a5fb840e02665d311d878955380515e4fd50095dd3d8c" +dependencies = [ + "aes", +] + [[package]] name = "ahash" version = "0.7.7" @@ -651,6 +694,56 @@ dependencies = [ "rquickjs", ] +[[package]] +name = "arrow-udf-js-deno" +version = "0.0.1" +source = "git+https://github.com/risingwavelabs/arrow-udf.git?rev=23fe0dd#23fe0dd41616f4646f9139e22a335518e6cc9a47" +dependencies = [ + "anyhow", + "arrow-array 50.0.0", + "arrow-buffer 50.0.0", + "arrow-data 50.0.0", + "arrow-schema 50.0.0", + "arrow-udf-js-deno-runtime", + "async-trait", + "deno_core", + "futures", + "futures-util", + "libc", + "serde", + "serde_json", + "tokio", + "v8", +] + +[[package]] +name = "arrow-udf-js-deno-runtime" +version = "0.0.1" +source = "git+https://github.com/risingwavelabs/arrow-udf.git?rev=23fe0dd#23fe0dd41616f4646f9139e22a335518e6cc9a47" +dependencies = [ + "anyhow", + "deno_ast", + "deno_console", + "deno_core", + "deno_crypto", + "deno_fetch", + "deno_http", + "deno_io", + "deno_net", + "deno_tls", + "deno_url", + "deno_web", + "deno_webidl", + "deno_websocket", + "hyper 0.14.27", + "libc", + "serde", + "serde_json", + "signal-hook-registry", + "tokio", + "v8", +] + [[package]] name = "arrow-udf-python" version = "0.1.0" @@ -691,6 +784,18 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "ast_node" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e3e06ec6ac7d893a0db7127d91063ad7d9da8988f8a1a256f03729e6eec026" +dependencies = [ + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.57", +] + [[package]] name = "async-attributes" version = "1.1.2" @@ -718,6 +823,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc2d0cfb2a7388d34f590e76686704c494ed7aaceed62ee1ba35cbf363abc2a5" dependencies = [ + "brotli", "bzip2", "flate2", "futures-core", @@ -1280,7 +1386,7 @@ dependencies = [ "http 0.2.9", "http-body 0.4.5", "hyper 0.14.27", - "hyper-rustls", + "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", "pin-utils", @@ -1310,7 +1416,7 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d4bb944488536cd2fef43212d829bc7e9a8bfc4afa079d21170441e7be8d2d0" dependencies = [ - "base64-simd", + "base64-simd 0.8.0", "bytes", "bytes-utils", "futures-core", @@ -1358,7 +1464,7 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "http 0.2.9", - "rustc_version", + "rustc_version 0.4.0", "tracing", ] @@ -1403,7 +1509,7 @@ dependencies = [ "http 1.0.0", "http-body 1.0.0", "http-body-util", - "hyper 1.2.0", + "hyper 1.1.0", "hyper-util", "itoa", "matchit", @@ -1546,13 +1652,22 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +[[package]] +name = "base64-simd" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" +dependencies = [ + "simd-abstraction", +] + [[package]] name = "base64-simd" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" dependencies = [ - "outref", + "outref 0.5.1", "vsimd", ] @@ -1591,6 +1706,15 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f40afb3abbf90895dda3ddbc6d8734d24215130a22d646067690f5e318f81bc" +[[package]] +name = "better_scoped_tls" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "794edcc9b3fb07bb4aecaa11f093fd45663b4feadb782d68303a2268bc2701de" +dependencies = [ + "scoped-tls", +] + [[package]] name = "bigdecimal" version = "0.3.1" @@ -1663,7 +1787,7 @@ dependencies = [ "rustc-hash", "shlex", "syn 2.0.57", - "which", + "which 4.4.2", ] [[package]] @@ -1937,6 +2061,12 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "cache_control" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf2a5fb3207c12b5d208ebc145f967fea5cac41a021c37417ccc31ba40f39ee" + [[package]] name = "camino" version = "1.1.6" @@ -2034,7 +2164,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver", + "semver 1.0.18", "serde", "serde_json", ] @@ -2465,6 +2595,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "convert_case" version = "0.6.0" @@ -2474,6 +2610,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cooked-waker" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147be55d677052dabc6b22252d5dd0fd4c29c8c27aa4f2fbef0f94aa003b406f" + [[package]] name = "core-foundation" version = "0.9.3" @@ -2653,7 +2795,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8f48d60e5b4d2c53d5c2b1d8a58c849a70ae5e5509b08a48d047e3b65714a74" dependencies = [ - "rustc_version", + "rustc_version 0.4.0", ] [[package]] @@ -2858,6 +3000,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", + "rand_core", "typenum", ] @@ -2882,11 +3025,20 @@ dependencies = [ "memchr", ] +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + [[package]] name = "curve25519-dalek" -version = "4.1.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622178105f911d937a42cdb140730ba4a3ed2becd8ae6ce39c7d28b5d75d4588" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ "cfg-if", "cpufeatures", @@ -2894,7 +3046,7 @@ dependencies = [ "digest", "fiat-crypto", "platforms", - "rustc_version", + "rustc_version 0.4.0", "subtle", "zeroize", ] @@ -3344,6 +3496,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ + "serde", "uuid", ] @@ -3352,7 +3505,7 @@ name = "delta_btree_map" version = "1.7.0-alpha" dependencies = [ "educe 0.5.7", - "enum-as-inner", + "enum-as-inner 0.6.0", ] [[package]] @@ -3417,112 +3570,469 @@ dependencies = [ ] [[package]] -name = "der" -version = "0.6.1" +name = "deno_ast" +version = "0.34.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +checksum = "58d986a1df3f1538ffa04162b5c5f00b856121391b860dc003bde2a6a741e878" dependencies = [ - "const-oid", - "zeroize", + "anyhow", + "base64 0.21.7", + "deno_media_type", + "deno_terminal", + "dprint-swc-ext", + "once_cell", + "percent-encoding", + "serde", + "swc_atoms", + "swc_common", + "swc_config", + "swc_config_macro", + "swc_ecma_ast", + "swc_ecma_codegen", + "swc_ecma_codegen_macros", + "swc_ecma_loader", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_transforms_classes", + "swc_ecma_transforms_macros", + "swc_ecma_transforms_proposal", + "swc_ecma_transforms_react", + "swc_ecma_transforms_typescript", + "swc_ecma_utils", + "swc_ecma_visit", + "swc_eq_ignore_macros", + "swc_macros_common", + "swc_visit", + "swc_visit_macros", + "text_lines", + "unicode-width", + "url", ] [[package]] -name = "der" -version = "0.7.8" +name = "deno_console" +version = "0.144.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "372a00d0d0c42c3f5a451037e0ce327fa284144112c3109d32b50b40a2ef9532" dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", + "deno_core", ] [[package]] -name = "deranged" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +name = "deno_core" +version = "0.272.0" +source = "git+https://github.com/bakjos/deno_core?rev=9b241c6#9b241c6aa536fd64add55b34b9532efc2ced9b7c" dependencies = [ - "powerfmt", + "anyhow", + "bincode 1.3.3", + "bit-set", + "bit-vec", + "bytes", + "cooked-waker", + "deno_core_icudata", + "deno_ops", + "deno_unsync", + "futures", + "libc", + "log", + "memoffset", + "parking_lot 0.12.1", + "pin-project", "serde", + "serde_json", + "serde_v8", + "smallvec", + "sourcemap 7.1.1", + "static_assertions", + "tokio", + "url", + "v8", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "deno_core_icudata" +version = "0.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "a13951ea98c0a4c372f162d669193b4c9d991512de9f2381dd161027f34b26b1" [[package]] -name = "derive_builder" -version = "0.12.0" +name = "deno_crypto" +version = "0.158.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +checksum = "b26b7ac283934ee9c1ebb0b2328e4edda1487dd147d444c886993a96edf74b79" dependencies = [ - "derive_builder_macro 0.12.0", + "aes", + "aes-gcm", + "aes-kw", + "base64 0.21.7", + "cbc", + "const-oid", + "ctr", + "curve25519-dalek", + "deno_core", + "deno_web", + "elliptic-curve 0.13.8", + "num-traits", + "once_cell", + "p256 0.13.2", + "p384", + "p521", + "rand", + "ring 0.17.5", + "rsa", + "serde", + "serde_bytes", + "sha1", + "sha2", + "signature 2.2.0", + "spki 0.7.2", + "tokio", + "uuid", + "x25519-dalek", ] [[package]] -name = "derive_builder" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" +name = "deno_fetch" +version = "0.168.0" +source = "git+https://github.com/bakjos/deno?rev=787a232#787a232c51f1ea390a2aff2b622016217d854328" dependencies = [ - "derive_builder_macro 0.20.0", + "bytes", + "data-url", + "deno_core", + "deno_tls", + "dyn-clone", + "http 1.0.0", + "pin-project", + "reqwest 0.12.2", + "serde", + "serde_json", + "tokio", + "tokio-util", ] [[package]] -name = "derive_builder_core" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +name = "deno_http" +version = "0.141.0" +source = "git+https://github.com/bakjos/deno?rev=787a232#787a232c51f1ea390a2aff2b622016217d854328" dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", + "async-compression", + "async-trait", + "base64 0.21.7", + "brotli", + "bytes", + "cache_control", + "deno_core", + "deno_net", + "deno_websocket", + "flate2", + "http 1.0.0", + "httparse", + "hyper 0.14.27", + "hyper 1.1.0", + "hyper-util", + "itertools 0.10.5", + "memmem", + "mime", + "once_cell", + "percent-encoding", + "phf", + "pin-project", + "ring 0.17.5", + "scopeguard", + "serde", + "smallvec", + "thiserror", + "tokio", + "tokio-util", ] [[package]] -name = "derive_builder_core" -version = "0.20.0" +name = "deno_io" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" +checksum = "3200f90cc9d232fd864cfcf25c535ab114fe824d9a38161e89418676360915e4" dependencies = [ - "darling 0.20.8", - "proc-macro2", - "quote", - "syn 2.0.57", + "async-trait", + "deno_core", + "filetime", + "fs3", + "once_cell", + "os_pipe", + "rand", + "tokio", + "winapi", ] [[package]] -name = "derive_builder_macro" -version = "0.12.0" +name = "deno_media_type" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +checksum = "edf9879493856d1622be70f396b0b0d3e519538dd6501b7c609ecbaa7e2194d2" dependencies = [ - "derive_builder_core 0.12.0", - "syn 1.0.109", + "data-url", + "serde", + "url", ] [[package]] -name = "derive_builder_macro" -version = "0.20.0" +name = "deno_native_certs" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" +checksum = "f4785d0bdc13819b665b71e4fb7e119d859568471e4c245ec5610857e70c9345" dependencies = [ - "derive_builder_core 0.20.0", - "syn 2.0.57", + "dlopen2", + "dlopen2_derive", + "once_cell", + "rustls-native-certs 0.6.3", + "rustls-pemfile 1.0.4", ] [[package]] -name = "derive_utils" -version = "0.14.1" +name = "deno_net" +version = "0.136.0" +source = "git+https://github.com/bakjos/deno?rev=787a232#787a232c51f1ea390a2aff2b622016217d854328" +dependencies = [ + "deno_core", + "deno_tls", + "enum-as-inner 0.5.1", + "log", + "pin-project", + "rustls-tokio-stream", + "serde", + "socket2 0.5.6", + "tokio", + "trust-dns-proto 0.22.0", + "trust-dns-resolver 0.22.0", +] + +[[package]] +name = "deno_ops" +version = "0.148.0" +source = "git+https://github.com/bakjos/deno_core?rev=9b241c6#9b241c6aa536fd64add55b34b9532efc2ced9b7c" +dependencies = [ + "proc-macro-rules", + "proc-macro2", + "quote", + "strum 0.25.0", + "strum_macros 0.25.3", + "syn 2.0.57", + "thiserror", +] + +[[package]] +name = "deno_terminal" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e6337d4e7f375f8b986409a76fbeecfa4bd8a1343e63355729ae4befa058eaf" +dependencies = [ + "once_cell", + "termcolor", +] + +[[package]] +name = "deno_tls" +version = "0.131.0" +source = "git+https://github.com/bakjos/deno?rev=787a232#787a232c51f1ea390a2aff2b622016217d854328" +dependencies = [ + "deno_core", + "deno_native_certs", + "once_cell", + "rustls 0.22.3", + "rustls-pemfile 1.0.4", + "rustls-tokio-stream", + "rustls-webpki 0.101.7", + "serde", + "webpki-roots 0.25.2", +] + +[[package]] +name = "deno_unsync" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30dff7e03584dbae188dae96a0f1876740054809b2ad0cf7c9fc5d361f20e739" +dependencies = [ + "tokio", +] + +[[package]] +name = "deno_url" +version = "0.144.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e172f44cffc771f0050d1befb12523d0420b6a44983d0c74d572609f4d3e02e3" +dependencies = [ + "deno_core", + "serde", + "urlpattern", +] + +[[package]] +name = "deno_web" +version = "0.175.0" +source = "git+https://github.com/bakjos/deno?rev=787a232#787a232c51f1ea390a2aff2b622016217d854328" +dependencies = [ + "async-trait", + "base64-simd 0.8.0", + "bytes", + "deno_core", + "encoding_rs", + "flate2", + "futures", + "serde", + "tokio", + "uuid", + "windows-sys 0.48.0", +] + +[[package]] +name = "deno_webidl" +version = "0.144.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c0484ffd8b436e926538fc0db4bc588832800b6681e554cebb3ae21f346c84e" +dependencies = [ + "deno_core", +] + +[[package]] +name = "deno_websocket" +version = "0.149.0" +source = "git+https://github.com/bakjos/deno?rev=787a232#787a232c51f1ea390a2aff2b622016217d854328" +dependencies = [ + "bytes", + "deno_core", + "deno_net", + "deno_tls", + "fastwebsockets", + "h2 0.4.4", + "http 1.0.0", + "http-body-util", + "hyper 1.1.0", + "hyper-util", + "once_cell", + "rustls-tokio-stream", + "serde", + "tokio", +] + +[[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.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro 0.12.0", +] + +[[package]] +name = "derive_builder" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" +dependencies = [ + "derive_builder_macro 0.20.0", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" +dependencies = [ + "darling 0.20.8", + "proc-macro2", + "quote", + "syn 2.0.57", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core 0.12.0", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" +dependencies = [ + "derive_builder_core 0.20.0", + "syn 2.0.57", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case 0.4.0", + "proc-macro2", + "quote", + "rustc_version 0.4.0", + "syn 1.0.109", +] + +[[package]] +name = "derive_utils" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61bb5a1014ce6dfc2a378578509abe775a5aa06bff584a547555d9efdb81b926" dependencies = [ @@ -3626,6 +4136,29 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632" +[[package]] +name = "dlopen2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bc2c7ed06fd72a8513ded8d0d2f6fd2655a85d6885c48cae8625d80faf28c03" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "dlv-list" version = "0.5.2" @@ -3659,6 +4192,21 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "dprint-swc-ext" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bad772f9e49af3a613fcddf1671d1e2e877e0a6d94f2b7162bfea4ac8140bee" +dependencies = [ + "num-bigint", + "rustc-hash", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_parser", + "text_lines", +] + [[package]] name = "duct" version = "0.13.6" @@ -3717,15 +4265,15 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.16.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der 0.7.8", "digest", - "elliptic-curve 0.13.6", + "elliptic-curve 0.13.8", "rfc6979 0.4.0", - "signature 2.0.0", + "signature 2.2.0", "spki 0.7.2", ] @@ -3736,20 +4284,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ "pkcs8 0.10.2", - "signature 2.0.0", + "signature 2.2.0", ] [[package]] name = "ed25519-dalek" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", "serde", "sha2", - "signature 2.0.0", + "signature 2.2.0", + "subtle", "zeroize", ] @@ -3808,9 +4357,9 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.13.6" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct 0.2.0", "crypto-bigint 0.5.5", @@ -3842,6 +4391,18 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-as-inner" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "enum-as-inner" version = "0.6.0" @@ -3869,7 +4430,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0ce3a36047ede676eb0d2721d065beed8410cf4f113f489604d2971331cb378" dependencies = [ - "convert_case", + "convert_case 0.6.0", "quote", "syn 1.0.109", ] @@ -4103,6 +4664,25 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +[[package]] +name = "fastwebsockets" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63dd7b57f9b33b1741fa631c9522eb35d43e96dcca4a6a91d5e4ca7c93acdc1" +dependencies = [ + "base64 0.21.7", + "http-body-util", + "hyper 1.1.0", + "hyper-util", + "pin-project", + "rand", + "sha1", + "simdutf8", + "thiserror", + "tokio", + "utf-8", +] + [[package]] name = "fd-lock" version = "4.0.1" @@ -4150,16 +4730,28 @@ dependencies = [ ] [[package]] -name = "findshlibs" -version = "0.10.2" +name = "filetime" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b9e59cd0f7e0806cca4be089683ecb6434e602038df21fe6bf6711b2f07f64" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ - "cc", - "lazy_static", + "cfg-if", "libc", - "winapi", -] + "redox_syscall 0.4.1", + "windows-sys 0.52.0", +] + +[[package]] +name = "findshlibs" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40b9e59cd0f7e0806cca4be089683ecb6434e602038df21fe6bf6711b2f07f64" +dependencies = [ + "cc", + "lazy_static", + "libc", + "winapi", +] [[package]] name = "finl_unicode" @@ -4212,7 +4804,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dac53e22462d78c16d64a1cd22371b54cc3fe94aa15e7886a2fa6e5d1ab8640" dependencies = [ "bitflags 1.3.2", - "rustc_version", + "rustc_version 0.4.0", ] [[package]] @@ -4429,6 +5021,17 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" +[[package]] +name = "from_variant" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a0b11eeb173ce52f84ebd943d42e58813a2ebb78a6a3ff0a243b71c5199cd7b" +dependencies = [ + "proc-macro2", + "swc_macros_common", + "syn 2.0.57", +] + [[package]] name = "frunk" version = "0.4.2" @@ -4511,12 +5114,33 @@ dependencies = [ "winapi", ] +[[package]] +name = "fs3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb17cf6ed704f72485332f6ab65257460c4f9f3083934cf402bf9f5b3b600a90" +dependencies = [ + "libc", + "rustc_version 0.2.3", + "winapi", +] + [[package]] name = "fs_extra" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" +[[package]] +name = "fslock" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04412b8935272e3a9bae6f48c7bfff74c2911f60525404edfdd28e49884c3bfb" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "function_name" version = "0.3.0" @@ -4724,7 +5348,7 @@ dependencies = [ "async-trait", "dyn-clone", "hyper 0.14.27", - "hyper-rustls", + "hyper-rustls 0.24.2", "log", "reqwest 0.11.20", "serde", @@ -4790,6 +5414,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + [[package]] name = "gimli" version = "0.28.0" @@ -4815,7 +5449,7 @@ dependencies = [ "tonic 0.10.2", "tower", "tracing", - "trust-dns-resolver", + "trust-dns-resolver 0.23.2", ] [[package]] @@ -4963,6 +5597,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "gzip-header" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95cc527b92e6029a62960ad99aa8a6660faa4555fe5f731aab13aa6a921795a2" +dependencies = [ + "crc32fast", +] + [[package]] name = "h2" version = "0.3.26" @@ -5158,6 +5801,20 @@ dependencies = [ "windows 0.52.0", ] +[[package]] +name = "hstr" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0f5356d62012374578cd3a5c013d6586de3efbca3b53379fc1edfbb95c9db14" +dependencies = [ + "hashbrown 0.14.3", + "new_debug_unreachable", + "once_cell", + "phf", + "rustc-hash", + "triomphe", +] + [[package]] name = "http" version = "0.2.9" @@ -5264,9 +5921,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" dependencies = [ "bytes", "futures-channel", @@ -5278,7 +5935,6 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "smallvec", "tokio", "want", ] @@ -5297,7 +5953,24 @@ dependencies = [ "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", - "webpki-roots", + "webpki-roots 0.25.2", +] + +[[package]] +name = "hyper-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +dependencies = [ + "futures-util", + "http 1.0.0", + "hyper 1.1.0", + "hyper-util", + "rustls 0.22.3", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.25.0", + "tower-service", ] [[package]] @@ -5333,7 +6006,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.2.0", + "hyper 1.1.0", "hyper-util", "native-tls", "tokio", @@ -5352,7 +6025,7 @@ dependencies = [ "futures-util", "http 1.0.0", "http-body 1.0.0", - "hyper 1.2.0", + "hyper 1.1.0", "pin-project-lite", "socket2 0.5.6", "tokio", @@ -5456,6 +6129,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "idna" version = "0.4.0" @@ -5476,6 +6160,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "if_chain" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" + [[package]] name = "indexmap" version = "1.9.3" @@ -5639,6 +6329,18 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +[[package]] +name = "is-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a85abdc13717906baccb5a1e435556ce0df215f242892f721dff62bf25288f" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "is-terminal" version = "0.4.9" @@ -6435,6 +7137,12 @@ dependencies = [ "libc", ] +[[package]] +name = "memmem" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64a92489e2744ce060c349162be1c5f33c6969234104dbd99ddb5feb08b8c15" + [[package]] name = "memoffset" version = "0.9.0" @@ -6468,9 +7176,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -6535,7 +7243,7 @@ dependencies = [ "once_cell", "parking_lot 0.12.1", "quanta", - "rustc_version", + "rustc_version 0.4.0", "skeptic", "smallvec", "tagptr", @@ -6687,6 +7395,12 @@ dependencies = [ "tempfile", ] +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + [[package]] name = "newline-converter" version = "0.3.0" @@ -6834,6 +7548,8 @@ dependencies = [ "autocfg", "num-integer", "num-traits", + "rand", + "serde", ] [[package]] @@ -7025,9 +7741,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -7035,6 +7751,12 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + [[package]] name = "opendal" version = "0.45.1" @@ -7269,12 +7991,12 @@ dependencies = [ [[package]] name = "os_pipe" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -7321,6 +8043,12 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "outref" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" + [[package]] name = "outref" version = "0.5.1" @@ -7356,8 +8084,8 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "ecdsa 0.16.8", - "elliptic-curve 0.13.6", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "primeorder", "sha2", ] @@ -7368,9 +8096,23 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" dependencies = [ - "ecdsa 0.16.8", - "elliptic-curve 0.13.6", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", + "primeorder", + "sha2", +] + +[[package]] +name = "p521" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc9e2161f1f215afdfce23677034ae137bbd45016a880c2eb3ba8eb95f085b2" +dependencies = [ + "base16ct 0.2.0", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "primeorder", + "rand_core", "sha2", ] @@ -7563,6 +8305,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + [[package]] name = "pbjson" version = "0.6.0" @@ -7685,6 +8433,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ + "phf_macros", "phf_shared", ] @@ -7708,6 +8457,19 @@ dependencies = [ "rand", ] +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "phf_shared" version = "0.11.2" @@ -7838,6 +8600,17 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "pmutil" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52a40bc70c2c58040d2d8b167ba9a5ff59fc9dab7ad44771cfde3dcfde7a09c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "polling" version = "2.8.0" @@ -7854,6 +8627,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + [[package]] name = "portable-atomic" version = "1.4.3" @@ -8036,11 +8821,11 @@ dependencies = [ [[package]] name = "primeorder" -version = "0.13.2" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2fcef82c0ec6eefcc179b978446c399b3cdf73c392c35604e399eee6df1ee3" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "elliptic-curve 0.13.6", + "elliptic-curve 0.13.8", ] [[package]] @@ -8127,6 +8912,29 @@ version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" +[[package]] +name = "proc-macro-rules" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07c277e4e643ef00c1233393c673f655e3672cf7eb3ba08a00bdd0ea59139b5f" +dependencies = [ + "proc-macro-rules-macros", + "proc-macro2", + "syn 2.0.57", +] + +[[package]] +name = "proc-macro-rules-macros" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "207fffb0fe655d1d47f6af98cc2793405e85929bdbc420d685554ff07be27ac7" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "proc-macro2" version = "1.0.79" @@ -8195,7 +9003,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7849dd7319357e220886589ea0a0760ff138cde2eedfbbfd2708caee0b15dfc" dependencies = [ - "enum-as-inner", + "enum-as-inner 0.6.0", "mime", "reqwest 0.11.20", "serde", @@ -8242,7 +9050,7 @@ dependencies = [ "regex", "syn 1.0.109", "tempfile", - "which", + "which 4.4.2", ] [[package]] @@ -8264,7 +9072,7 @@ dependencies = [ "regex", "syn 2.0.57", "tempfile", - "which", + "which 4.4.2", ] [[package]] @@ -8865,7 +9673,7 @@ dependencies = [ "http 0.2.9", "http-body 0.4.5", "hyper 0.14.27", - "hyper-rustls", + "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -8891,7 +9699,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams 0.3.0", "web-sys", - "webpki-roots", + "webpki-roots 0.25.2", "winreg", ] @@ -8901,6 +9709,7 @@ version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d66674f2b6fb864665eea7a3c1ac4e3dfacd2fda83cf6f935a612e01b0e3338" dependencies = [ + "async-compression", "base64 0.21.7", "bytes", "encoding_rs", @@ -8911,7 +9720,8 @@ dependencies = [ "http 1.0.0", "http-body 1.0.0", "http-body-util", - "hyper 1.2.0", + "hyper 1.1.0", + "hyper-rustls 0.26.0", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -8922,7 +9732,9 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls 0.22.3", "rustls-pemfile 1.0.4", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", @@ -8930,6 +9742,8 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", + "tokio-rustls 0.25.0", + "tokio-socks", "tokio-util", "tower-service", "url", @@ -8937,6 +9751,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams 0.4.0", "web-sys", + "webpki-roots 0.26.1", "winreg", ] @@ -9268,7 +10083,7 @@ dependencies = [ "easy-ext", "educe 0.5.7", "either", - "enum-as-inner", + "enum-as-inner 0.6.0", "enumflags2", "ethnum", "expect-test", @@ -9574,7 +10389,7 @@ dependencies = [ "deltalake", "duration-str", "easy-ext", - "enum-as-inner", + "enum-as-inner 0.6.0", "expect-test", "futures", "futures-async-stream", @@ -9760,6 +10575,7 @@ dependencies = [ "arrow-array 50.0.0", "arrow-schema 50.0.0", "arrow-udf-js", + "arrow-udf-js-deno", "arrow-udf-python", "arrow-udf-wasm", "async-trait", @@ -9772,8 +10588,9 @@ dependencies = [ "easy-ext", "educe 0.5.7", "either", - "enum-as-inner", + "enum-as-inner 0.6.0", "expect-test", + "futures", "futures-async-stream", "futures-util", "itertools 0.12.1", @@ -9874,7 +10691,7 @@ dependencies = [ "easy-ext", "educe 0.5.7", "either", - "enum-as-inner", + "enum-as-inner 0.6.0", "expect-test", "fancy-regex", "fixedbitset 0.5.0", @@ -10096,7 +10913,7 @@ dependencies = [ "crepe", "easy-ext", "either", - "enum-as-inner", + "enum-as-inner 0.6.0", "expect-test", "fail", "function_name", @@ -10272,7 +11089,7 @@ dependencies = [ "fail", "futures", "hyper 0.14.27", - "hyper-rustls", + "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "itertools 0.12.1", "madsim", @@ -10294,7 +11111,7 @@ dependencies = [ name = "risingwave_pb" version = "1.7.0-alpha" dependencies = [ - "enum-as-inner", + "enum-as-inner 0.6.0", "fs-err", "madsim-tonic", "madsim-tonic-build", @@ -10554,7 +11371,7 @@ dependencies = [ "dashmap", "dyn-clone", "either", - "enum-as-inner", + "enum-as-inner 0.6.0", "expect-test", "fail", "fiemap", @@ -10622,7 +11439,7 @@ dependencies = [ "delta_btree_map", "educe 0.5.7", "either", - "enum-as-inner", + "enum-as-inner 0.6.0", "expect-test", "fail", "foyer", @@ -10795,22 +11612,20 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.2" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" +checksum = "af6c4b23d99685a1408194da11270ef8e9809aff951cc70ec9b17350b087e474" dependencies = [ - "byteorder", "const-oid", "digest", "num-bigint-dig", "num-integer", - "num-iter", "num-traits", "pkcs1", "pkcs8 0.10.2", "rand_core", "sha2", - "signature 2.0.0", + "signature 2.2.0", "spki 0.7.2", "subtle", "zeroize", @@ -10910,13 +11725,22 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver", + "semver 1.0.18", ] [[package]] @@ -11053,6 +11877,18 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +[[package]] +name = "rustls-tokio-stream" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "696a389edb0b54b9bb888c8318404d9a0c0b9091fb03ca3d9c64731511db03f6" +dependencies = [ + "futures", + "rustls 0.22.3", + "socket2 0.5.6", + "tokio", +] + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -11150,6 +11986,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +[[package]] +name = "ryu-js" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" + [[package]] name = "salsa20" version = "0.10.2" @@ -11207,6 +12049,12 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -11474,6 +12322,15 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e388332cd64eb80cd595a00941baf513caffae8dce9cfd0467fc9c66397dade6" +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.18" @@ -11483,6 +12340,12 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + [[package]] name = "seq-macro" version = "0.3.5" @@ -11631,6 +12494,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_v8" +version = "0.181.0" +source = "git+https://github.com/bakjos/deno_core?rev=9b241c6#9b241c6aa536fd64add55b34b9532efc2ced9b7c" +dependencies = [ + "bytes", + "num-bigint", + "serde", + "smallvec", + "thiserror", + "v8", +] + [[package]] name = "serde_with" version = "3.7.0" @@ -11699,11 +12575,22 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "sha-1" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -11718,9 +12605,9 @@ checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -11814,7 +12701,7 @@ checksum = "c1e303f8205714074f6068773f0e29527e0453937fe837c9717d066635b65f31" dependencies = [ "pkcs8 0.10.2", "rand_core", - "signature 2.0.0", + "signature 2.2.0", "zeroize", ] @@ -11830,16 +12717,25 @@ dependencies = [ [[package]] name = "signature" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fe458c98333f9c8152221191a77e2a44e8325d0193484af2e9421a53019e57d" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", "rand_core", ] [[package]] -name = "simd-json" +name = "simd-abstraction" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" +dependencies = [ + "outref 0.1.0", +] + +[[package]] +name = "simd-json" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d123f285a3635e423ec2ef5b67e0168dcf86c0d62fffbcea88fcd1c926e47413" @@ -11954,6 +12850,17 @@ dependencies = [ "serde", ] +[[package]] +name = "smartstring" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" +dependencies = [ + "autocfg", + "static_assertions", + "version_check", +] + [[package]] name = "snafu" version = "0.7.5" @@ -12002,6 +12909,39 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sourcemap" +version = "6.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4cbf65ca7dc576cf50e21f8d0712d96d4fcfd797389744b7b222a85cdf5bd90" +dependencies = [ + "data-encoding", + "debugid", + "if_chain", + "rustc_version 0.2.3", + "serde", + "serde_json", + "unicode-id", + "url", +] + +[[package]] +name = "sourcemap" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7768edd06c02535e0d50653968f46e1e0d3aa54742190d35dd9466f59de9c71" +dependencies = [ + "base64-simd 0.7.0", + "data-encoding", + "debugid", + "if_chain", + "rustc_version 0.2.3", + "serde", + "serde_json", + "unicode-id-start", + "url", +] + [[package]] name = "speedate" version = "0.14.0" @@ -12368,6 +13308,18 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091b6114800a5f2141aee1d1b9d6ca3592ac062dc5decb3764ec5895a47b4eb" +[[package]] +name = "string_enum" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b650ea2087d32854a0f20b837fc56ec987a1cb4f758c9757e1171ee9812da63" +dependencies = [ + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.57", +] + [[package]] name = "stringprep" version = "0.1.4" @@ -12380,110 +13332,461 @@ dependencies = [ ] [[package]] -name = "strsim" -version = "0.10.0" +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + +[[package]] +name = "structmeta" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e1575d8d40908d70f6fd05537266b90ae71b15dbbe7a8b7dffa2b759306d329" +dependencies = [ + "proc-macro2", + "quote", + "structmeta-derive", + "syn 2.0.57", +] + +[[package]] +name = "structmeta-derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.57", +] + +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros 0.25.3", +] + +[[package]] +name = "strum" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +dependencies = [ + "strum_macros 0.26.1", +] + +[[package]] +name = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.57", +] + +[[package]] +name = "strum_macros" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.57", +] + +[[package]] +name = "subprocess" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2e86926081dda636c546d8c5e641661049d7562a68f5488be4a1f7f66f6086" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "subst" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca1318e5d6716d6541696727c88d9b8dfc8cfe6afd6908e186546fd4af7f5b98" +dependencies = [ + "memchr", + "unicode-width", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "swc_atoms" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d538eaaa6f085161d088a04cf0a3a5a52c5a7f2b3bd9b83f73f058b0ed357c0" +dependencies = [ + "hstr", + "once_cell", + "rustc-hash", + "serde", +] + +[[package]] +name = "swc_cached" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630c761c74ac8021490b78578cc2223aa4a568241e26505c27bf0e4fd4ad8ec2" +dependencies = [ + "ahash 0.8.6", + "anyhow", + "dashmap", + "once_cell", + "regex", + "serde", +] + +[[package]] +name = "swc_common" +version = "0.33.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85e8b15d0fb87691e27c8f3cf953748db3ccd2a39e165d6d5275a48fb0d29e3" +dependencies = [ + "ast_node", + "better_scoped_tls", + "cfg-if", + "either", + "from_variant", + "new_debug_unreachable", + "num-bigint", + "once_cell", + "rustc-hash", + "serde", + "siphasher", + "sourcemap 6.4.1", + "swc_atoms", + "swc_eq_ignore_macros", + "swc_visit", + "tracing", + "unicode-width", + "url", +] + +[[package]] +name = "swc_config" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce837c5eae1cb200a310940de989fd9b3d12ed62d7752bc69b39ef8aa775ec04" +dependencies = [ + "anyhow", + "indexmap 2.0.0", + "serde", + "serde_json", + "swc_cached", + "swc_config_macro", +] + +[[package]] +name = "swc_config_macro" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2574f75082322a27d990116cd2a24de52945fc94172b24ca0b3e9e2a6ceb6b" +dependencies = [ + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.57", +] + +[[package]] +name = "swc_ecma_ast" +version = "0.112.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36226eb87bfd2f5620bde04f149a4b869ab34e78496d60cb0d8eb9da765d0732" +dependencies = [ + "bitflags 2.5.0", + "is-macro", + "num-bigint", + "phf", + "scoped-tls", + "serde", + "string_enum", + "swc_atoms", + "swc_common", + "unicode-id", +] + +[[package]] +name = "swc_ecma_codegen" +version = "0.148.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ba8669ab28bb5d1e65c1e8690257c026745ac368e0101c2c6544d4a03afc95e" +dependencies = [ + "memchr", + "num-bigint", + "once_cell", + "rustc-hash", + "serde", + "sourcemap 6.4.1", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_codegen_macros", + "tracing", +] + +[[package]] +name = "swc_ecma_codegen_macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "394b8239424b339a12012ceb18726ed0244fce6bf6345053cb9320b2791dcaa5" +dependencies = [ + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.57", +] + +[[package]] +name = "swc_ecma_loader" +version = "0.45.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0058cf970880f5382effe43eb2b727a73ba09ae41922fa140c2c3fa6ca9b2d1" +dependencies = [ + "anyhow", + "pathdiff", + "serde", + "swc_atoms", + "swc_common", + "tracing", +] + +[[package]] +name = "swc_ecma_parser" +version = "0.143.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20823cac99a9adbd4c03fb5e126aaccbf92446afedad99252a0e1fc76e2ffc43" +dependencies = [ + "either", + "new_debug_unreachable", + "num-bigint", + "num-traits", + "phf", + "serde", + "smallvec", + "smartstring", + "stacker", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "tracing", + "typed-arena", +] + +[[package]] +name = "swc_ecma_transforms_base" +version = "0.137.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66539401f619730b26d380a120b91b499f80cbdd9bb15d00aa73bc3a4d4cc394" +dependencies = [ + "better_scoped_tls", + "bitflags 2.5.0", + "indexmap 2.0.0", + "once_cell", + "phf", + "rustc-hash", + "serde", + "smallvec", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_parser", + "swc_ecma_utils", + "swc_ecma_visit", + "tracing", +] + +[[package]] +name = "swc_ecma_transforms_classes" +version = "0.126.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebf9048e687b746d2bbe6149601c3eedd819fef08d7657e5fddcef99b22febba" +dependencies = [ + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_utils", + "swc_ecma_visit", +] + +[[package]] +name = "swc_ecma_transforms_macros" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "17e309b88f337da54ef7fe4c5b99c2c522927071f797ee6c9fb8b6bf2d100481" +dependencies = [ + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.57", +] [[package]] -name = "strsim" -version = "0.11.0" +name = "swc_ecma_transforms_proposal" +version = "0.171.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "35f0a72ee781aa9208836046fd2c12e483f5515898858511b68863290cb97b45" +dependencies = [ + "either", + "rustc-hash", + "serde", + "smallvec", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_classes", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", +] [[package]] -name = "structmeta" -version = "0.3.0" +name = "swc_ecma_transforms_react" +version = "0.183.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e1575d8d40908d70f6fd05537266b90ae71b15dbbe7a8b7dffa2b759306d329" +checksum = "f0ec75c1194365abe4d44d94e58f918ec853469ecd39733b381a089cfdcdee1a" dependencies = [ - "proc-macro2", - "quote", - "structmeta-derive", - "syn 2.0.57", + "base64 0.21.7", + "dashmap", + "indexmap 2.0.0", + "once_cell", + "serde", + "sha-1", + "string_enum", + "swc_atoms", + "swc_common", + "swc_config", + "swc_ecma_ast", + "swc_ecma_parser", + "swc_ecma_transforms_base", + "swc_ecma_transforms_macros", + "swc_ecma_utils", + "swc_ecma_visit", ] [[package]] -name = "structmeta-derive" -version = "0.3.0" +name = "swc_ecma_transforms_typescript" +version = "0.188.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" +checksum = "fec5e95a9c840eb13562884123eaa627cb6e05e0461c94a2ce69ae7e70313010" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.57", + "ryu-js", + "serde", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_transforms_base", + "swc_ecma_transforms_react", + "swc_ecma_utils", + "swc_ecma_visit", ] [[package]] -name = "strum" -version = "0.25.0" +name = "swc_ecma_utils" +version = "0.127.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "14482e455df85486d68a51533a31645d511e56df93a35cadf0eabbe7abe96b98" dependencies = [ - "strum_macros 0.25.3", + "indexmap 2.0.0", + "num_cpus", + "once_cell", + "rustc-hash", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_ecma_visit", + "tracing", + "unicode-id", ] [[package]] -name = "strum" -version = "0.26.1" +name = "swc_ecma_visit" +version = "0.98.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +checksum = "df0127694c36d656ea9eab5c170cdd8ab398246ae2a335de26961c913a4aca47" dependencies = [ - "strum_macros 0.26.1", + "num-bigint", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "swc_visit", + "tracing", ] [[package]] -name = "strum_macros" -version = "0.25.3" +name = "swc_eq_ignore_macros" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +checksum = "695a1d8b461033d32429b5befbf0ad4d7a2c4d6ba9cd5ba4e0645c615839e8e4" dependencies = [ - "heck 0.4.1", "proc-macro2", "quote", - "rustversion", "syn 2.0.57", ] [[package]] -name = "strum_macros" -version = "0.26.1" +name = "swc_macros_common" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +checksum = "50176cfc1cbc8bb22f41c6fe9d1ec53fbe057001219b5954961b8ad0f336fce9" dependencies = [ - "heck 0.4.1", "proc-macro2", "quote", - "rustversion", "syn 2.0.57", ] [[package]] -name = "subprocess" -version = "0.2.9" +name = "swc_visit" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2e86926081dda636c546d8c5e641661049d7562a68f5488be4a1f7f66f6086" +checksum = "358e246dedeb4ae8efacebcce1360dc2f9b6c0b4c1ad8b737cc60f5b6633691a" dependencies = [ - "libc", - "winapi", + "either", + "swc_visit_macros", ] [[package]] -name = "subst" -version = "0.3.0" +name = "swc_visit_macros" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca1318e5d6716d6541696727c88d9b8dfc8cfe6afd6908e186546fd4af7f5b98" +checksum = "fbbbb9d77d5112f90ed7ea00477135b16c4370c872b93a0b63b766e8710650ad" dependencies = [ - "memchr", - "unicode-width", + "Inflector", + "pmutil", + "proc-macro2", + "quote", + "swc_macros_common", + "syn 2.0.57", ] -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - [[package]] name = "symbolic-common" version = "12.4.0" @@ -12664,6 +13967,15 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +[[package]] +name = "text_lines" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fd5828de7deaa782e1dd713006ae96b3bee32d3279b79eb67ecf8072c059bcf" +dependencies = [ + "serde", +] + [[package]] name = "thiserror" version = "1.0.58" @@ -12971,6 +14283,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-socks" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51165dfa029d2a65969413a6cc96f354b86b464498702f174a4efa13608fd8c0" +dependencies = [ + "either", + "futures-util", + "thiserror", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.14" @@ -13133,7 +14457,7 @@ dependencies = [ "tower-layer", "tower-service", "tracing", - "webpki-roots", + "webpki-roots 0.25.2", ] [[package]] @@ -13351,9 +14675,13 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee8098afad3fb0c54a9007aab6804558410503ad676d4633f9c2559a00ac0f" +checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +dependencies = [ + "serde", + "stable_deref_trait", +] [[package]] name = "triple_accel" @@ -13361,6 +14689,32 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622b09ce2fe2df4618636fb92176d205662f59803f39e70d1c333393082de96c" +[[package]] +name = "trust-dns-proto" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner 0.5.1", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "rand", + "serde", + "smallvec", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + [[package]] name = "trust-dns-proto" version = "0.23.2" @@ -13370,7 +14724,7 @@ dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner", + "enum-as-inner 0.6.0", "futures-channel", "futures-io", "futures-util", @@ -13386,6 +14740,27 @@ dependencies = [ "url", ] +[[package]] +name = "trust-dns-resolver" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lazy_static", + "lru-cache", + "parking_lot 0.12.1", + "resolv-conf", + "serde", + "smallvec", + "thiserror", + "tokio", + "tracing", + "trust-dns-proto 0.22.0", +] + [[package]] name = "trust-dns-resolver" version = "0.23.2" @@ -13404,7 +14779,7 @@ dependencies = [ "thiserror", "tokio", "tracing", - "trust-dns-proto", + "trust-dns-proto 0.23.2", ] [[package]] @@ -13435,6 +14810,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + [[package]] name = "typed-builder" version = "0.16.2" @@ -13490,6 +14871,47 @@ dependencies = [ "version_check", ] +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-ucd-ident" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] + [[package]] name = "unicase" version = "2.7.0" @@ -13505,6 +14927,18 @@ version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +[[package]] +name = "unicode-id" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" + +[[package]] +name = "unicode-id-start" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8f73150333cb58412db36f2aca8f2875b013049705cc77b94ded70a1ab1f5da" + [[package]] name = "unicode-ident" version = "1.0.11" @@ -13550,6 +14984,16 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "unsafe-libyaml" version = "0.2.10" @@ -13586,6 +15030,25 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "urlpattern" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9bd5ff03aea02fa45b13a7980151fe45009af1980ba69f651ec367121a31609" +dependencies = [ + "derive_more", + "regex", + "serde", + "unic-ucd-ident", + "url", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + [[package]] name = "utf8parse" version = "0.2.1" @@ -13603,6 +15066,21 @@ dependencies = [ "serde", ] +[[package]] +name = "v8" +version = "0.89.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe2197fbef82c98f7953d13568a961d4e1c663793b5caf3c74455a13918cdf33" +dependencies = [ + "bitflags 2.5.0", + "fslock", + "gzip-header", + "home", + "miniz_oxide", + "once_cell", + "which 5.0.0", +] + [[package]] name = "valuable" version = "0.1.0" @@ -13844,7 +15322,7 @@ checksum = "84e5df6dba6c0d7fafc63a450f1738451ed7a0b52295d83e868218fa286bf708" dependencies = [ "bitflags 2.5.0", "indexmap 2.0.0", - "semver", + "semver 1.0.18", ] [[package]] @@ -13881,7 +15359,7 @@ dependencies = [ "paste", "rayon", "rustix 0.38.31", - "semver", + "semver 1.0.18", "serde", "serde_derive", "serde_json", @@ -14216,6 +15694,15 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +[[package]] +name = "webpki-roots" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "which" version = "4.4.2" @@ -14228,6 +15715,19 @@ dependencies = [ "rustix 0.38.31", ] +[[package]] +name = "which" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bf3ea8596f3a0dd5980b46430f2058dfe2c36a27ccfbb1845d6fbfcd9ba6e14" +dependencies = [ + "either", + "home", + "once_cell", + "rustix 0.38.31", + "windows-sys 0.48.0", +] + [[package]] name = "whoami" version = "1.5.0" @@ -14627,7 +16127,7 @@ dependencies = [ "id-arena", "indexmap 2.0.0", "log", - "semver", + "semver 1.0.18", "serde", "serde_derive", "serde_json", @@ -14682,6 +16182,18 @@ dependencies = [ "tap", ] +[[package]] +name = "x25519-dalek" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" +dependencies = [ + "curve25519-dalek", + "rand_core", + "serde", + "zeroize", +] + [[package]] name = "xmlparser" version = "0.13.5" @@ -14740,7 +16252,7 @@ dependencies = [ "futures", "http 0.2.9", "hyper 0.14.27", - "hyper-rustls", + "hyper-rustls 0.24.2", "itertools 0.10.5", "log", "percent-encoding", @@ -14786,6 +16298,20 @@ name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +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.57", +] [[package]] name = "zstd" diff --git a/Cargo.toml b/Cargo.toml index 2bd253f9e4d23..165549c719930 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -140,6 +140,7 @@ arrow-select = "50" arrow-ord = "50" arrow-row = "50" arrow-udf-js = "0.1" +arrow-udf-js-deno = { git = "https://github.com/risingwavelabs/arrow-udf.git", rev = "23fe0dd" } arrow-udf-wasm = { version = "0.2.1", features = ["build"] } arrow-udf-python = { git = "https://github.com/risingwavelabs/arrow-udf.git", rev = "6c32f71" } arrow-array-deltalake = { package = "arrow-array", version = "48.0.1" } @@ -315,6 +316,15 @@ futures-timer = { git = "https://github.com/madsim-rs/futures-timer.git", rev = etcd-client = { git = "https://github.com/risingwavelabs/etcd-client.git", rev = "4e84d40" } # todo(wcy-fdu): remove this patch fork after opendal release a new version to apply azure workload identity change. reqsign = { git = "https://github.com/wcy-fdu/reqsign.git", rev = "002ee2a" } +# patch to remove preserve_order from serde_json +deno_core = { git = "https://github.com/bakjos/deno_core", rev = "9b241c6" } +# patch to user reqwest 0.12.2 +deno_fetch = { git = "https://github.com/bakjos/deno", rev = "787a232" } +deno_http = { git = "https://github.com/bakjos/deno", rev = "787a232" } +deno_net = { git = "https://github.com/bakjos/deno", rev = "787a232" } +deno_tls = { git = "https://github.com/bakjos/deno", rev = "787a232" } +deno_web = { git = "https://github.com/bakjos/deno", rev = "787a232" } +deno_websocket = { git = "https://github.com/bakjos/deno", rev = "787a232" } [workspace.metadata.dylint] libraries = [{ path = "./lints" }] diff --git a/Makefile.toml b/Makefile.toml index f95ed99e5ec43..5e9d65c00dd31 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -35,6 +35,7 @@ is_release = get_env ENABLE_RELEASE_PROFILE is_not_release = not ${is_release} is_dynamic_linking = get_env ENABLE_DYNAMIC_LINKING is_hummock_trace = get_env ENABLE_HUMMOCK_TRACE +is_deno_udf_enabled = get_env ENABLE_DENO_UDF is_python_udf_enabled = get_env ENABLE_PYTHON_UDF if ${is_sanitizer_enabled} @@ -58,6 +59,11 @@ else set_env RISINGWAVE_FEATURE_FLAGS "--features rw-static-link" end +if ${is_deno_udf_enabled} + flags = get_env RISINGWAVE_FEATURE_FLAGS + set_env RISINGWAVE_FEATURE_FLAGS "${flags} --features embedded-deno-udf" +end + if ${is_python_udf_enabled} flags = get_env RISINGWAVE_FEATURE_FLAGS set_env RISINGWAVE_FEATURE_FLAGS "${flags} --features embedded-python-udf" diff --git a/ci/scripts/build.sh b/ci/scripts/build.sh index 0f4d40d8ff65c..f50c5a794ec8d 100755 --- a/ci/scripts/build.sh +++ b/ci/scripts/build.sh @@ -54,6 +54,7 @@ cargo build \ -p risingwave_compaction_test \ -p risingwave_e2e_extended_mode_test \ "${RISINGWAVE_FEATURE_FLAGS[@]}" \ + --features embedded-deno-udf \ --features embedded-python-udf \ --profile "$profile" diff --git a/ci/scripts/run-e2e-test.sh b/ci/scripts/run-e2e-test.sh index 9c205e418222f..da42fb5acac39 100755 --- a/ci/scripts/run-e2e-test.sh +++ b/ci/scripts/run-e2e-test.sh @@ -123,10 +123,12 @@ sqllogictest -p 4566 -d dev './e2e_test/udf/external_udf.slt' pkill java echo "--- e2e, $mode, embedded udf" +python3 -m pip install --break-system-packages flask waitress sqllogictest -p 4566 -d dev './e2e_test/udf/wasm_udf.slt' sqllogictest -p 4566 -d dev './e2e_test/udf/rust_udf.slt' sqllogictest -p 4566 -d dev './e2e_test/udf/js_udf.slt' sqllogictest -p 4566 -d dev './e2e_test/udf/python_udf.slt' +sqllogictest -p 4566 -d dev './e2e_test/udf/deno_udf.slt' echo "--- Kill cluster" cluster_stop diff --git a/ci/workflows/main-cron.yml b/ci/workflows/main-cron.yml index 7cb23f76ce25c..bf09d5fe66344 100644 --- a/ci/workflows/main-cron.yml +++ b/ci/workflows/main-cron.yml @@ -472,72 +472,6 @@ steps: timeout_in_minutes: 10 retry: *auto-retry - - label: "S3 source check on AWS" - key: "s3-source-check-aws" - command: "ci/scripts/s3-source-test.sh -p ci-release -s run.py" - if: | - !(build.pull_request.labels includes "ci/main-cron/skip-ci") && build.env("CI_STEPS") == null - || build.pull_request.labels includes "ci/run-s3-source-tests" - || build.env("CI_STEPS") =~ /(^|,)s3-source-tests?(,|$$)/ - depends_on: build - plugins: - - seek-oss/aws-sm#v2.3.1: - env: - S3_SOURCE_TEST_CONF: ci_s3_source_test_aws - - docker-compose#v5.1.0: - run: rw-build-env - config: ci/docker-compose.yml - mount-buildkite-agent: true - environment: - - S3_SOURCE_TEST_CONF - - ./ci/plugins/upload-failure-logs - timeout_in_minutes: 20 - retry: *auto-retry - - - label: "S3 source check on AWS (json parser)" - key: "s3-source-check-aws-json-parser" - command: "ci/scripts/s3-source-test.sh -p ci-release -s json_file.py" - if: | - !(build.pull_request.labels includes "ci/main-cron/skip-ci") && build.env("CI_STEPS") == null - || build.pull_request.labels includes "ci/run-s3-source-tests" - || build.env("CI_STEPS") =~ /(^|,)s3-source-tests?(,|$$)/ - depends_on: build - plugins: - - seek-oss/aws-sm#v2.3.1: - env: - S3_SOURCE_TEST_CONF: ci_s3_source_test_aws - - docker-compose#v5.1.0: - run: rw-build-env - config: ci/docker-compose.yml - mount-buildkite-agent: true - environment: - - S3_SOURCE_TEST_CONF - - ./ci/plugins/upload-failure-logs - timeout_in_minutes: 25 - retry: *auto-retry - - - label: "S3 source check on AWS (csv parser)" - key: "s3-source-check-aws-csv-parser" - command: "ci/scripts/s3-source-test.sh -p ci-release -s run_csv.py" - if: | - !(build.pull_request.labels includes "ci/main-cron/skip-ci") && build.env("CI_STEPS") == null - || build.pull_request.labels includes "ci/run-s3-source-tests" - || build.env("CI_STEPS") =~ /(^|,)s3-source-tests?(,|$$)/ - depends_on: build - plugins: - - seek-oss/aws-sm#v2.3.1: - env: - S3_SOURCE_TEST_CONF: ci_s3_source_test_aws - - docker-compose#v5.1.0: - run: rw-build-env - config: ci/docker-compose.yml - mount-buildkite-agent: true - environment: - - S3_SOURCE_TEST_CONF - - ./ci/plugins/upload-failure-logs - timeout_in_minutes: 25 - retry: *auto-retry - - label: "S3_v2 source check on AWS (json parser)" key: "s3-v2-source-check-aws-json-parser" command: "ci/scripts/s3-source-test.sh -p ci-release -s fs_source_v2.py -t json" @@ -621,28 +555,6 @@ steps: timeout_in_minutes: 25 retry: *auto-retry - - label: "S3 source on OpenDAL fs engine" - key: "s3-source-test-for-opendal-fs-engine" - command: "ci/scripts/s3-source-test-for-opendal-fs-engine.sh -p ci-release -s run.py" - if: | - !(build.pull_request.labels includes "ci/main-cron/skip-ci") && build.env("CI_STEPS") == null - || build.pull_request.labels includes "ci/run-s3-source-tests" - || build.env("CI_STEPS") =~ /(^|,)s3-source-tests?(,|$$)/ - depends_on: build - plugins: - - seek-oss/aws-sm#v2.3.1: - env: - S3_SOURCE_TEST_CONF: ci_s3_source_test_aws - - docker-compose#v5.1.0: - run: rw-build-env - config: ci/docker-compose.yml - mount-buildkite-agent: true - environment: - - S3_SOURCE_TEST_CONF - - ./ci/plugins/upload-failure-logs - timeout_in_minutes: 20 - retry: *auto-retry - # TODO(Kexiang): Enable this test after we have a GCS_SOURCE_TEST_CONF. # - label: "GCS source on OpenDAL fs engine" # key: "s3-source-test-for-opendal-fs-engine" diff --git a/docker/Dockerfile b/docker/Dockerfile index 8f6bbeb045a6d..3d902bc2ffc6c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -75,7 +75,7 @@ WORKDIR /risingwave ENV ENABLE_BUILD_DASHBOARD=1 RUN cargo fetch && \ - cargo build -p risingwave_cmd_all --release --features "rw-static-link" --features embedded-python-udf && \ + cargo build -p risingwave_cmd_all --release --features "rw-static-link" --features embedded-deno-udf --features embedded-python-udf && \ mkdir -p /risingwave/bin && \ mv /risingwave/target/release/risingwave /risingwave/bin/ && \ mv /risingwave/target/release/risingwave.dwp /risingwave/bin/ && \ diff --git a/docker/Dockerfile.hdfs b/docker/Dockerfile.hdfs index 482f8758aac74..53a6da30fe6e0 100644 --- a/docker/Dockerfile.hdfs +++ b/docker/Dockerfile.hdfs @@ -105,7 +105,7 @@ ENV JAVA_HOME ${JAVA_HOME_PATH} ENV LD_LIBRARY_PATH ${JAVA_HOME_PATH}/lib/server:${LD_LIBRARY_PATH} RUN cargo fetch && \ - cargo build -p risingwave_cmd_all --release -p risingwave_object_store --features hdfs-backend --features "rw-static-link" --features embedded-python-udf && \ + cargo build -p risingwave_cmd_all --release -p risingwave_object_store --features hdfs-backend --features "rw-static-link" --features embedded-deno-udf --features embedded-python-udf && \ mkdir -p /risingwave/bin && \ mv /risingwave/target/release/risingwave /risingwave/bin/ && \ mv /risingwave/target/release/risingwave.dwp /risingwave/bin/ && \ diff --git a/e2e_test/s3/json_file.py b/e2e_test/s3/json_file.py deleted file mode 100644 index 76ec86fae0dc4..0000000000000 --- a/e2e_test/s3/json_file.py +++ /dev/null @@ -1,122 +0,0 @@ -import os -import string -import json -import string -from time import sleep -from minio import Minio -import psycopg2 -import random - - -def do_test(client, config, N, prefix): - conn = psycopg2.connect( - host="localhost", - port="4566", - user="root", - database="dev" - ) - - # Open a cursor to execute SQL statements - cur = conn.cursor() - - # Execute a SELECT statement - cur.execute(f'''CREATE TABLE s3_test_jsonfile( - id int, - name TEXT, - sex int, - mark int, - ) - include file as file_col - WITH ( - connector = 's3', - match_pattern = '{prefix}*.json', - s3.region_name = '{config['S3_REGION']}', - s3.bucket_name = '{config['S3_BUCKET']}', - s3.credentials.access = '{config['S3_ACCESS_KEY']}', - s3.credentials.secret = '{config['S3_SECRET_KEY']}', - s3.endpoint_url = 'https://{config['S3_ENDPOINT']}' - ) FORMAT PLAIN ENCODE JSON;''') - - for i in range(N): - try: - client.fput_object( - config["S3_BUCKET"], - f"{run_id}_data_{i}.json", - f"data_{i}.json" - ) - print(f"Uploaded {run_id}_data_{i}.json to S3") - os.remove(f"data_{i}.json") - except Exception as e: - print(f"Error uploading data_{i}.json: {e}") - - total_row = int(N) - while True: - sleep(60) - cur.execute('select count(*) from s3_test_jsonfile') - result = cur.fetchone() - if result[0] == total_row: - break - print( - f"Now got {result[0]} rows in table, {total_row} expected, wait 60s") - - cur.execute( - 'select count(*), sum(id), sum(sex), sum(mark) from s3_test_jsonfile') - result = cur.fetchone() - print(result) - - assert result[0] == total_row - assert result[1] == int(((N - 1) * N / 2)) - assert result[2] == int(N / 2) - assert result[3] == 0 - - cur.execute('select file_col from s3_test_jsonfile') - result = cur.fetchone() - file_col = result[0] - print(file_col) - - cur.execute('drop table s3_test_jsonfile') - - cur.close() - conn.close() - - -if __name__ == "__main__": - config = json.loads(os.environ["S3_SOURCE_TEST_CONF"]) - run_id = str(random.randint(1000, 9999)) - N = 1080 - - for i in range(N): - with open(f"data_{i}.json", "w") as f: - f.write(json.dumps( - { - "id": i, - "name": str(i), - "sex": i % 2, - "mark": -1 if i % 2 else 1, - } - )) - os.fsync(f.fileno()) - - client = Minio( - config["S3_ENDPOINT"], - access_key=config["S3_ACCESS_KEY"], - secret_key=config["S3_SECRET_KEY"], - secure=True - ) - return_code = 0 - try: - do_test(client, config, N, run_id) - except Exception as e: - print("Test failed", e) - return_code = 1 - - # Clean up - for i in range(N): - try: - client.remove_object( - config["S3_BUCKET"], f"{run_id}_data_{i}.json") - print(f"Removed {run_id}_data_{i}.json from S3") - except Exception as e: - print(f"Error removing data_{i}.json: {e}") - - exit(return_code) diff --git a/e2e_test/s3/run.py b/e2e_test/s3/run.py deleted file mode 100644 index 58e3c5765c0ef..0000000000000 --- a/e2e_test/s3/run.py +++ /dev/null @@ -1,128 +0,0 @@ -import os -import string -import json -import string -from time import sleep -from minio import Minio -import psycopg2 -import random - -def do_test(config, N, n, prefix): - conn = psycopg2.connect( - host="localhost", - port="4566", - user="root", - database="dev" - ) - - # Open a cursor to execute SQL statements - cur = conn.cursor() - - # Execute a SELECT statement - cur.execute(f'''CREATE TABLE s3_test( - id int, - name TEXT, - sex int, - mark int, - ) WITH ( - connector = 's3', - match_pattern = '{prefix}*.ndjson', - s3.region_name = '{config['S3_REGION']}', - s3.bucket_name = '{config['S3_BUCKET']}', - s3.credentials.access = '{config['S3_ACCESS_KEY']}', - s3.credentials.secret = '{config['S3_SECRET_KEY']}', - s3.endpoint_url = 'https://{config['S3_ENDPOINT']}' - ) FORMAT PLAIN ENCODE JSON;''') - - total_row = int(N * n) - sleep(120) - while True: - sleep(60) - cur.execute('select count(*) from s3_test') - result = cur.fetchone() - if result[0] == total_row: - break - print( - f"Now got {result[0]} rows in table, {total_row} expected, wait 60s") - - cur.execute('select count(*), sum(id), sum(sex), sum(mark) from s3_test') - result = cur.fetchone() - - print(result) - - assert result[0] == total_row - assert result[1] == int(((N - 1) * N / 2) * n) - assert result[2] == int(N*n / 2) - assert result[3] == 0 - - cur.execute('drop table s3_test') - - cur.close() - conn.close() - - -if __name__ == "__main__": - config = json.loads(os.environ["S3_SOURCE_TEST_CONF"]) - run_id = str(random.randint(1000, 9999)) - N = 10000 - - items = [ - { - "id": j, - "name": str(j), - "sex": j % 2, - "mark": -1 if j % 2 else 1, - } - for j in range(N) - ] - - data = "\n".join([json.dumps(item) for item in items]) + "\n" - n = 0 - with open("data_0.ndjson", "w") as f: - for _ in range(1000): - n += 1 - f.write(data) - os.fsync(f.fileno()) - - for i in range(1, 20): - with open(f"data_{i}.ndjson", "w") as f: - n += 1 - f.write(data) - os.fsync(f.fileno()) - - client = Minio( - config["S3_ENDPOINT"], - access_key=config["S3_ACCESS_KEY"], - secret_key=config["S3_SECRET_KEY"], - secure=True - ) - - for i in range(20): - try: - client.fput_object( - config["S3_BUCKET"], - f"{run_id}_data_{i}.ndjson", - f"data_{i}.ndjson" - - ) - print(f"Uploaded {run_id}_data_{i}.ndjson to S3") - os.remove(f"data_{i}.ndjson") - except Exception as e: - print(f"Error uploading data_{i}.ndjson: {e}") - - return_code = 0 - try: - do_test(config, N, n, run_id) - except Exception as e: - print("Test failed", e) - return_code = 1 - - # Clean up - for i in range(20): - try: - client.remove_object(config["S3_BUCKET"], f"{run_id}_data_{i}.ndjson") - print(f"Removed {run_id}_data_{i}.ndjson from S3") - except Exception as e: - print(f"Error removing data_{i}.ndjson: {e}") - - exit(return_code) diff --git a/e2e_test/s3/run_csv.py b/e2e_test/s3/run_csv.py deleted file mode 100644 index a6c0dc37bc4ca..0000000000000 --- a/e2e_test/s3/run_csv.py +++ /dev/null @@ -1,154 +0,0 @@ -import os -import json -import string -from time import sleep -from minio import Minio -import psycopg2 -import random - - -def do_test(config, N, n, prefix): - conn = psycopg2.connect( - host="localhost", - port="4566", - user="root", - database="dev" - ) - - # Open a cursor to execute SQL statements - cur = conn.cursor() - cur.execute(f'''CREATE TABLE s3_test_csv_without_headers( - a int, - b int, - c int, - ) WITH ( - connector = 's3', - match_pattern = '{prefix}_data_without_headers.csv', - s3.region_name = '{config['S3_REGION']}', - s3.bucket_name = '{config['S3_BUCKET']}', - s3.credentials.access = '{config['S3_ACCESS_KEY']}', - s3.credentials.secret = '{config['S3_SECRET_KEY']}', - s3.endpoint_url = 'https://{config['S3_ENDPOINT']}' - ) FORMAT PLAIN ENCODE CSV (delimiter = ',', without_header = true);''') - - cur.execute(f'''CREATE TABLE s3_test_csv_with_headers( - a int, - b int, - c int, - ) WITH ( - connector = 's3', - match_pattern = '{prefix}_data_with_headers.csv', - s3.region_name = '{config['S3_REGION']}', - s3.bucket_name = '{config['S3_BUCKET']}', - s3.credentials.access = '{config['S3_ACCESS_KEY']}', - s3.credentials.secret = '{config['S3_SECRET_KEY']}', - s3.endpoint_url = 'https://{config['S3_ENDPOINT']}' - ) FORMAT PLAIN ENCODE CSV (delimiter = ',');''') - - total_row = int(N * n) - sleep(60) - while True: - sleep(60) - cur.execute('select count(*) from s3_test_csv_with_headers') - result_with_headers = cur.fetchone() - cur.execute('select count(*) from s3_test_csv_without_headers') - result_without_headers = cur.fetchone() - if result_with_headers[0] == total_row and result_without_headers[0] == total_row: - break - print( - f"Now got {result_with_headers[0]} rows in table, {total_row} expected, wait 60s") - - cur.execute( - 'select count(*), sum(a), sum(b), sum(c) from s3_test_csv_with_headers') - result_with_headers = cur.fetchone() - - cur.execute( - 'select count(*), sum(a), sum(b), sum(c) from s3_test_csv_without_headers') - s3_test_csv_without_headers = cur.fetchone() - - print(result_with_headers, s3_test_csv_without_headers, - int(((N - 1) * N / 2) * n), int(N*n / 2)) - - assert s3_test_csv_without_headers[0] == total_row - assert s3_test_csv_without_headers[1] == int(((N - 1) * N / 2) * n) - assert s3_test_csv_without_headers[2] == int(N*n / 2) - assert s3_test_csv_without_headers[3] == 0 - - assert result_with_headers[0] == total_row - assert result_with_headers[1] == 0 - assert result_with_headers[2] == int(N*n / 2) - assert result_with_headers[3] == int(((N - 1) * N / 2) * n) - - cur.execute('drop table s3_test_csv_with_headers') - cur.execute('drop table s3_test_csv_without_headers') - - cur.close() - conn.close() - - -if __name__ == "__main__": - config = json.loads(os.environ["S3_SOURCE_TEST_CONF"]) - run_id = str(random.randint(1000, 9999)) - N = 10000 - # do_test(config, N, 0, run_id) - items = [",".join([str(j), str(j % 2), str(-1 if j % 2 else 1)]) - for j in range(N) - ] - - data = "\n".join(items) + "\n" - n = 10 - with open("data_without_headers.csv", "w") as f: - for _ in range(10): - f.write(data) - os.fsync(f.fileno()) - - with open("data_with_headers.csv", "w") as f: - f.write("c,b,a\n") - for _ in range(10): - f.write(data) - os.fsync(f.fileno()) - - client = Minio( - config["S3_ENDPOINT"], - access_key=config["S3_ACCESS_KEY"], - secret_key=config["S3_SECRET_KEY"], - secure=True - ) - - try: - client.fput_object( - config["S3_BUCKET"], - f"{run_id}_data_without_headers.csv", - f"data_without_headers.csv" - - ) - client.fput_object( - config["S3_BUCKET"], - f"{run_id}_data_with_headers.csv", - f"data_with_headers.csv" - ) - print( - f"Uploaded {run_id}_data_with_headers.csv & {run_id}_data_with_headers.csv to S3") - os.remove(f"data_with_headers.csv") - os.remove(f"data_without_headers.csv") - except Exception as e: - print(f"Error uploading test files") - - return_code = 0 - try: - do_test(config, N, n, run_id) - except Exception as e: - print("Test failed", e) - return_code = 1 - - # Clean up - for i in range(20): - try: - client.remove_object( - config["S3_BUCKET"], f"{run_id}_data_with_headers.csv") - client.remove_object( - config["S3_BUCKET"], f"{run_id}_data_without_headers.csv") - except Exception as e: - print(f"Error removing testing files {e}") - - exit(return_code) diff --git a/e2e_test/streaming/aggregate/count_star.slt b/e2e_test/streaming/aggregate/count_star.slt index 134a850930eae..2bc6c88c96fd1 100644 --- a/e2e_test/streaming/aggregate/count_star.slt +++ b/e2e_test/streaming/aggregate/count_star.slt @@ -1,3 +1,6 @@ +statement ok +SET RW_IMPLICIT_FLUSH TO true; + statement ok create table t (v int); @@ -7,9 +10,6 @@ insert into t values (114), (514); statement ok create materialized view mv as select * from t; -statement ok -flush; - query I select count(*) from t; ---- diff --git a/e2e_test/udf/deno_udf.slt b/e2e_test/udf/deno_udf.slt new file mode 100644 index 0000000000000..35e16daea16a2 --- /dev/null +++ b/e2e_test/udf/deno_udf.slt @@ -0,0 +1,233 @@ +statement ok +CREATE FUNCTION gcd(a int, b int) RETURNS int LANGUAGE javascript RUNTIME deno AS $$ + if(a == null || b == null) { + return null; + } + while (b != 0) { + let t = b; + b = a % b; + a = t; + } + return a; +$$; + +query I +select gcd(25, 15); +---- +5 + +statement ok +drop function gcd; + +statement ok +create function decimal_add(a decimal, b decimal) returns decimal language javascript RUNTIME deno as $$ + return a.add(b); +$$; + +query R +select decimal_add(1.11, 2.22); +---- +3.33 + +statement ok +drop function decimal_add; + + +statement ok +create function to_string(a boolean, b smallint, c int, d bigint, e real, f float, g decimal, h varchar, i bytea, j jsonb) returns varchar language javascript RUNTIME deno as $$ + return a.toString() + b.toString() + c.toString() + d.toString() + e.toString() + f.toString() + g.toString() + h.toString() + i.toString() + JSON.stringify(j); +$$; + +query T +select to_string(false, 1::smallint, 2, 3, 4.5, 6.7, 8.9, 'abc', '\x010203', '{"key": 1}'); +---- +false1234.56.78.9abc1,2,3{"key":1} + +statement ok +drop function to_string; + +# show data types in javascript +statement ok +create function js_typeof(a boolean, b smallint, c int, d bigint, e real, f float, g decimal, h varchar, i bytea, j jsonb) returns jsonb language javascript RUNTIME deno as $$ + return { + boolean: typeof a, + smallint: typeof b, + int: typeof c, + bigint: typeof d, + real: typeof e, + float: typeof f, + decimal: typeof g, + varchar: typeof h, + bytea: typeof i, + jsonb: typeof j, + }; +$$; + +query T +select js_typeof(false, 1::smallint, 2, 3, 4.5, 6.7, 8.9, 'abc', '\x010203', '{"key": 1}'); +---- +{"bigint": "bigint", "boolean": "boolean", "bytea": "object", "decimal": "object", "float": "number", "int": "number", "jsonb": "object", "real": "number", "smallint": "number", "varchar": "string"} + +statement ok +drop function js_typeof; + +statement ok +create function return_all(a boolean, b smallint, c int, d bigint, e real, f float, g decimal, h varchar, i bytea, j jsonb, s struct) +returns struct> +language javascript runtime deno as $$ + return {a,b,c,d,e,f,g,h,i,j,s}; +$$; + +query T +select (return_all( + true, + 1 ::smallint, + 1, + 1, + 1, + 1, + 12345678901234567890.12345678, + 'string', + 'bytes', + '{"key":1}', + row(1, 2)::struct +)).*; +---- +t 1 1 1 1 1 12345678901234567890.12345678 string \x6279746573 {"key": 1} (1,2) + +statement ok +drop function return_all; + + +statement ok +create function series(n int) returns table (x int) language javascript RUNTIME deno as $$ + for(let i = 0; i < n; i++) { + yield i; + } +$$; + +query I +select series(5); +---- +0 +1 +2 +3 +4 + +statement ok +drop function series; + + +statement ok +create function split(s varchar) returns table (word varchar, length int) language javascript RUNTIME deno as $$ + for(let word of s.split(' ')) { + yield { word: word, length: word.length }; + } +$$; + +query IT +select * from split('rising wave'); +---- +rising 6 +wave 4 + +statement ok +drop function split; + + +statement ok +CREATE FUNCTION digest( t string ) RETURNS bytea LANGUAGE javascript RUNTIME deno AS $$ + const subtle = crypto.subtle; + const key = await subtle.generateKey({ + name: 'HMAC', + hash: 'SHA-256', + length: 256, + }, true, ['sign', 'verify']); + const enc = new TextEncoder(); + const message = enc.encode(t); + const result = await subtle.sign({ + name: 'HMAC', + }, key, message); + return result; +$$ ASYNC; + +query I +select bit_length(digest('Hello')); +---- +256 + +statement ok +drop function digest; + +statement ok +CREATE FUNCTION delay_response() + RETURNS TABLE (x int) LANGUAGE javascript RUNTIME deno AS $$ + const delayedResponses = { + delays: [50, 10, 15], + wait(delay) { + return new Promise((resolve) => { + setTimeout(resolve, delay); + }); + }, + async *[Symbol.asyncIterator]() { + for (const delay of this.delays) { + await this.wait(delay); + yield delay; + } + }, + }; + return delayedResponses; +$$ SYNC; + +query I +select * FROM delay_response(); +---- +50 +10 +15 + +statement ok +drop function delay_response; + +system ok +python3 e2e_test/udf/mock_server.py & + +# wait for server to start +sleep 1s + +statement ok +CREATE FUNCTION call_sse() RETURNS TABLE ( data struct>) LANGUAGE javascript RUNTIME deno USING LINK 'fs://e2e_test/udf/sse/bundled.table.js' SYNC; + +query I +select * FROM call_sse(); +---- +(Hi) +(Bonjour) +(Hola) +(Ciao) +(Zdravo) + +statement ok +drop function call_sse; + +statement ok +CREATE FUNCTION fetch_api() RETURNS TABLE ( data struct< idx int>) LANGUAGE javascript RUNTIME deno AS $$ + const response = await fetch('http://127.0.0.1:4200'); + const resp = await response.json(); + for (const r of resp.results) { + yield r; + } +$$ ASYNC GENERATOR; + +query I +select * FROM fetch_api(); +---- +1 +2 + +statement ok +drop function fetch_api; + +system ok +pkill -9 python3 diff --git a/e2e_test/udf/mock_server.py b/e2e_test/udf/mock_server.py new file mode 100644 index 0000000000000..8f525f946ee43 --- /dev/null +++ b/e2e_test/udf/mock_server.py @@ -0,0 +1,43 @@ +import json + +from flask import Flask, Response, stream_with_context, jsonify + +app = Flask(__name__) +def format_sse(data: str | None, event=None) -> str: + if data: + msg = f'data: {data}\n\n' + else: + msg = '\n' + + if event is not None: + msg = f'event: {event}\n{msg}' + + return msg + +@app.route('/') +def home(): + return jsonify({"results": [{"idx": 1}, {"idx": 2}]}) + +@app.route('/graphql/stream', methods=['POST']) +def stream(): + print("sse stream called") + @stream_with_context + def eventStream(): + messages = ["Hi", "Bonjour", "Hola", "Ciao", "Zdravo"] + for msg in messages: + data = { + "data": { + "greetings": msg + } + } + yield format_sse(json.dumps(data), "next") + + yield format_sse(None, "complete") + return Response(eventStream(), mimetype="text/event-stream") + +if __name__ == '__main__': + from waitress import serve + from werkzeug.serving import WSGIRequestHandler + WSGIRequestHandler.protocol_version = "HTTP/1.1" + serve(app, host="127.0.0.1", port=4200) + print("Server stopped.") \ No newline at end of file diff --git a/e2e_test/udf/requirements.txt b/e2e_test/udf/requirements.txt new file mode 100644 index 0000000000000..8642e2b1ec254 --- /dev/null +++ b/e2e_test/udf/requirements.txt @@ -0,0 +1,2 @@ +flask +waitress \ No newline at end of file diff --git a/e2e_test/udf/sse/bundled.table.js b/e2e_test/udf/sse/bundled.table.js new file mode 100644 index 0000000000000..91c7b3dd2af87 --- /dev/null +++ b/e2e_test/udf/sse/bundled.table.js @@ -0,0 +1,186 @@ +//This code was generated using esbuild +var z=(()=>{var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pn=h(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.isObject=void 0;function Zd(e){return typeof e=="object"&&e!==null}jn.isObject=Zd});var dr=h(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.isAsyncGenerator=Re.isAsyncIterable=Re.parseStreamData=Re.print=Re.validateStreamEvent=Re.TOKEN_QUERY_KEY=Re.TOKEN_HEADER_KEY=void 0;var ef=Pn();Re.TOKEN_HEADER_KEY="x-graphql-event-stream-token";Re.TOKEN_QUERY_KEY="token";function tf(e){if(e=e,e!=="next"&&e!=="complete")throw new Error(`Invalid stream event "${e}"`);return e}Re.validateStreamEvent=tf;function rf(e){let t=`event: ${e.event} +data:`;return e.data&&(t+=" ",t+=JSON.stringify(e.data)),t+=` + +`,t}Re.print=rf;function nf(e,t){if(t)try{t=JSON.parse(t)}catch{throw new Error("Invalid stream data")}if(e==="next"&&!t)throw new Error('Stream data must be an object for "next" events');return t||null}Re.parseStreamData=nf;function sf(e){return typeof Object(e)[Symbol.asyncIterator]=="function"}Re.isAsyncIterable=sf;function af(e){return(0,ef.isObject)(e)&&typeof Object(e)[Symbol.asyncIterator]=="function"&&typeof e.return=="function"&&typeof e.throw=="function"&&typeof e.next=="function"}Re.isAsyncGenerator=af});var Gu=h(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.versionInfo=fr.version=void 0;var of="16.8.1";fr.version=of;var uf=Object.freeze({major:16,minor:8,patch:1,preReleaseTag:null});fr.versionInfo=uf});var Fe=h(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.devAssert=cf;function cf(e,t){if(!!!e)throw new Error(t)}});var wn=h(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.isPromise=lf;function lf(e){return typeof e?.then=="function"}});var pt=h(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.isObjectLike=pf;function pf(e){return typeof e=="object"&&e!==null}});var je=h(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.invariant=df;function df(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}});var Fn=h(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.getLocation=yf;var ff=je(),mf=/\r\n|[\n\r]/g;function yf(e,t){let r=0,n=1;for(let i of e.body.matchAll(mf)){if(typeof i.index=="number"||(0,ff.invariant)(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}});var os=h(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.printLocation=vf;kn.printSourceLocation=Qu;var hf=Fn();function vf(e){return Qu(e.source,(0,hf.getLocation)(e.source,e.start))}function Qu(e,t){let r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,s=e.locationOffset.line-1,a=t.line+s,o=t.line===1?r:0,u=t.column+o,c=`${e.name}:${a}:${u} +`,l=n.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){let d=Math.floor(u/80),y=u%80,T=[];for(let I=0;I["|",I]),["|","^".padStart(y)],["|",T[d+1]]])}return c+Cu([[`${a-1} |`,l[i-1]],[`${a} |`,f],["|","^".padStart(u)],[`${a+1} |`,l[i+1]]])}function Cu(e){let t=e.filter(([n,i])=>i!==void 0),r=Math.max(...t.map(([n])=>n.length));return t.map(([n,i])=>n.padStart(r)+(i?" "+i:"")).join(` +`)}});var q=h(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.GraphQLError=void 0;mr.formatError=Ef;mr.printError=gf;var Tf=pt(),Uu=Fn(),Ku=os();function bf(e){let t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var us=class e extends Error{constructor(t,...r){var n,i,s;let{nodes:a,source:o,positions:u,path:c,originalError:l,extensions:f}=bf(r);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=l??void 0,this.nodes=$u(Array.isArray(a)?a:a?[a]:void 0);let d=$u((n=this.nodes)===null||n===void 0?void 0:n.map(T=>T.loc).filter(T=>T!=null));this.source=o??(d==null||(i=d[0])===null||i===void 0?void 0:i.source),this.positions=u??d?.map(T=>T.start),this.locations=u&&o?u.map(T=>(0,Uu.getLocation)(o,T)):d?.map(T=>(0,Uu.getLocation)(T.source,T.start));let y=(0,Tf.isObjectLike)(l?.extensions)?l?.extensions:void 0;this.extensions=(s=f??y)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let r of this.nodes)r.loc&&(t+=` + +`+(0,Ku.printLocation)(r.loc));else if(this.source&&this.locations)for(let r of this.locations)t+=` + +`+(0,Ku.printSourceLocation)(this.source,r);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};mr.GraphQLError=us;function $u(e){return e===void 0||e.length===0?void 0:e}function gf(e){return e.toString()}function Ef(e){return e.toJSON()}});var qn=h(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.syntaxError=Nf;var _f=q();function Nf(e,t,r){return new _f.GraphQLError(`Syntax Error: ${r}`,{source:e,positions:[t]})}});var dt=h(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.Token=Ke.QueryDocumentKeys=Ke.OperationTypeNode=Ke.Location=void 0;Ke.isNode=If;var ls=class{constructor(t,r,n){this.start=t.start,this.end=r.end,this.startToken=t,this.endToken=r,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};Ke.Location=ls;var ps=class{constructor(t,r,n,i,s,a){this.kind=t,this.start=r,this.end=n,this.line=i,this.column=s,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}};Ke.Token=ps;var Bu={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};Ke.QueryDocumentKeys=Bu;var Of=new Set(Object.keys(Bu));function If(e){let t=e?.kind;return typeof t=="string"&&Of.has(t)}var ds;Ke.OperationTypeNode=ds;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(ds||(Ke.OperationTypeNode=ds={}))});var yr=h(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.DirectiveLocation=void 0;var fs;wr.DirectiveLocation=fs;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(fs||(wr.DirectiveLocation=fs={}))});var H=h(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.Kind=void 0;var ms;Fr.Kind=ms;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(ms||(Fr.Kind=ms={}))});var xn=h(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.isDigit=Yu;Qt.isLetter=ys;Qt.isNameContinue=Df;Qt.isNameStart=Sf;Qt.isWhiteSpace=Lf;function Lf(e){return e===9||e===32}function Yu(e){return e>=48&&e<=57}function ys(e){return e>=97&&e<=122||e>=65&&e<=90}function Sf(e){return ys(e)||e===95}function Df(e){return ys(e)||Yu(e)||e===95}});var qr=h(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.dedentBlockStringLines=Af;kr.isPrintableAsBlockString=jf;kr.printBlockString=Pf;var hs=xn();function Af(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let a=0;ao===0?a:a.slice(r)).slice((t=n)!==null&&t!==void 0?t:0,i+1)}function Rf(e){let t=0;for(;t1&&n.slice(1).every(y=>y.length===0||(0,hs.isWhiteSpace)(y.charCodeAt(0))),a=r.endsWith('\\"""'),o=e.endsWith('"')&&!a,u=e.endsWith("\\"),c=o||u,l=!(t!=null&&t.minimize)&&(!i||e.length>70||c||s||a),f="",d=i&&(0,hs.isWhiteSpace)(e.charCodeAt(0));return(l&&!d||s)&&(f+=` +`),f+=r,(l||c)&&(f+=` +`),'"""'+f+'"""'}});var Vr=h(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.TokenKind=void 0;var vs;xr.TokenKind=vs;(function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(vs||(xr.TokenKind=vs={}))});var Mn=h(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.Lexer=void 0;Gr.isPunctuatorTokenKind=Ff;var rt=qn(),Xu=dt(),wf=qr(),Ut=xn(),U=Vr(),bs=class{constructor(t){let r=new Xu.Token(U.TokenKind.SOF,0,0,0,0);this.source=t,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==U.TokenKind.EOF)do if(t.next)t=t.next;else{let r=kf(this,t.end);t.next=r,r.prev=t,t=r}while(t.kind===U.TokenKind.COMMENT);return t}};Gr.Lexer=bs;function Ff(e){return e===U.TokenKind.BANG||e===U.TokenKind.DOLLAR||e===U.TokenKind.AMP||e===U.TokenKind.PAREN_L||e===U.TokenKind.PAREN_R||e===U.TokenKind.SPREAD||e===U.TokenKind.COLON||e===U.TokenKind.EQUALS||e===U.TokenKind.AT||e===U.TokenKind.BRACKET_L||e===U.TokenKind.BRACKET_R||e===U.TokenKind.BRACE_L||e===U.TokenKind.PIPE||e===U.TokenKind.BRACE_R}function hr(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Vn(e,t){return Hu(e.charCodeAt(t))&&zu(e.charCodeAt(t+1))}function Hu(e){return e>=55296&&e<=56319}function zu(e){return e>=56320&&e<=57343}function Kt(e,t){let r=e.source.body.codePointAt(t);if(r===void 0)return U.TokenKind.EOF;if(r>=32&&r<=126){let n=String.fromCodePoint(r);return n==='"'?`'"'`:`"${n}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function ve(e,t,r,n,i){let s=e.line,a=1+r-e.lineStart;return new Xu.Token(t,r,n,s,a,i)}function kf(e,t){let r=e.source.body,n=r.length,i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Cf(e,t){let r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` +`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw(0,rt.syntaxError)(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function Qf(e,t){let r=e.source.body,n=r.length,i=e.lineStart,s=t+3,a=s,o="",u=[];for(;s{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.inspect=$f;var Kf=10,Wu=2;function $f(e){return Gn(e,[])}function Gn(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return Bf(e,t);default:return String(e)}}function Bf(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let r=[...t,e];if(Yf(e)){let n=e.toJSON();if(n!==e)return typeof n=="string"?n:Gn(n,r)}else if(Array.isArray(e))return Xf(e,r);return Jf(e,r)}function Yf(e){return typeof e.toJSON=="function"}function Jf(e,t){let r=Object.entries(e);return r.length===0?"{}":t.length>Wu?"["+Hf(e)+"]":"{ "+r.map(([i,s])=>i+": "+Gn(s,t)).join(", ")+" }"}function Xf(e,t){if(e.length===0)return"[]";if(t.length>Wu)return"[Array]";let r=Math.min(Kf,e.length),n=e.length-r,i=[];for(let s=0;s1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}function Hf(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}});var Cr=h(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.instanceOf=void 0;var zf=re(),Wf=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(t,r){return t instanceof r}:function(t,r){if(t instanceof r)return!0;if(typeof t=="object"&&t!==null){var n;let i=r.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(n=t.constructor)===null||n===void 0?void 0:n.name;if(i===s){let a=(0,zf.inspect)(t);throw new Error(`Cannot use ${i} "${a}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions + +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`)}}return!1};Cn.instanceOf=Wf});var Un=h(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.Source=void 0;Qr.isSource=tm;var Es=Fe(),Zf=re(),em=Cr(),Qn=class{constructor(t,r="GraphQL request",n={line:1,column:1}){typeof t=="string"||(0,Es.devAssert)(!1,`Body must be a string. Received: ${(0,Zf.inspect)(t)}.`),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||(0,Es.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,Es.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};Qr.Source=Qn;function tm(e){return(0,em.instanceOf)(e,Qn)}});var vr=h(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.Parser=void 0;Pt.parse=nm;Pt.parseConstValue=sm;Pt.parseType=am;Pt.parseValue=im;var $t=qn(),Ur=dt(),rm=yr(),M=H(),ec=Mn(),Zu=Un(),O=Vr();function nm(e,t){return new Bt(e,t).parseDocument()}function im(e,t){let r=new Bt(e,t);r.expectToken(O.TokenKind.SOF);let n=r.parseValueLiteral(!1);return r.expectToken(O.TokenKind.EOF),n}function sm(e,t){let r=new Bt(e,t);r.expectToken(O.TokenKind.SOF);let n=r.parseConstValueLiteral();return r.expectToken(O.TokenKind.EOF),n}function am(e,t){let r=new Bt(e,t);r.expectToken(O.TokenKind.SOF);let n=r.parseTypeReference();return r.expectToken(O.TokenKind.EOF),n}var Bt=class{constructor(t,r={}){let n=(0,Zu.isSource)(t)?t:new Zu.Source(t);this._lexer=new ec.Lexer(n),this._options=r,this._tokenCounter=0}parseName(){let t=this.expectToken(O.TokenKind.NAME);return this.node(t,{kind:M.Kind.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:M.Kind.DOCUMENT,definitions:this.many(O.TokenKind.SOF,this.parseDefinition,O.TokenKind.EOF)})}parseDefinition(){if(this.peek(O.TokenKind.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),r=t?this._lexer.lookahead():this._lexer.token;if(r.kind===O.TokenKind.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw(0,$t.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(O.TokenKind.BRACE_L))return this.node(t,{kind:M.Kind.OPERATION_DEFINITION,operation:Ur.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let r=this.parseOperationType(),n;return this.peek(O.TokenKind.NAME)&&(n=this.parseName()),this.node(t,{kind:M.Kind.OPERATION_DEFINITION,operation:r,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(O.TokenKind.NAME);switch(t.value){case"query":return Ur.OperationTypeNode.QUERY;case"mutation":return Ur.OperationTypeNode.MUTATION;case"subscription":return Ur.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(O.TokenKind.PAREN_L,this.parseVariableDefinition,O.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:M.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(O.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(O.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(O.TokenKind.DOLLAR),this.node(t,{kind:M.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:M.Kind.SELECTION_SET,selections:this.many(O.TokenKind.BRACE_L,this.parseSelection,O.TokenKind.BRACE_R)})}parseSelection(){return this.peek(O.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,r=this.parseName(),n,i;return this.expectOptionalToken(O.TokenKind.COLON)?(n=r,i=this.parseName()):i=r,this.node(t,{kind:M.Kind.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(O.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let r=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(O.TokenKind.PAREN_L,r,O.TokenKind.PAREN_R)}parseArgument(t=!1){let r=this._lexer.token,n=this.parseName();return this.expectToken(O.TokenKind.COLON),this.node(r,{kind:M.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(O.TokenKind.SPREAD);let r=this.expectOptionalKeyword("on");return!r&&this.peek(O.TokenKind.NAME)?this.node(t,{kind:M.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:M.Kind.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:M.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:M.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let r=this._lexer.token;switch(r.kind){case O.TokenKind.BRACKET_L:return this.parseList(t);case O.TokenKind.BRACE_L:return this.parseObject(t);case O.TokenKind.INT:return this.advanceLexer(),this.node(r,{kind:M.Kind.INT,value:r.value});case O.TokenKind.FLOAT:return this.advanceLexer(),this.node(r,{kind:M.Kind.FLOAT,value:r.value});case O.TokenKind.STRING:case O.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case O.TokenKind.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:M.Kind.BOOLEAN,value:!0});case"false":return this.node(r,{kind:M.Kind.BOOLEAN,value:!1});case"null":return this.node(r,{kind:M.Kind.NULL});default:return this.node(r,{kind:M.Kind.ENUM,value:r.value})}case O.TokenKind.DOLLAR:if(t)if(this.expectToken(O.TokenKind.DOLLAR),this._lexer.token.kind===O.TokenKind.NAME){let n=this._lexer.token.value;throw(0,$t.syntaxError)(this._lexer.source,r.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:M.Kind.STRING,value:t.value,block:t.kind===O.TokenKind.BLOCK_STRING})}parseList(t){let r=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:M.Kind.LIST,values:this.any(O.TokenKind.BRACKET_L,r,O.TokenKind.BRACKET_R)})}parseObject(t){let r=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:M.Kind.OBJECT,fields:this.any(O.TokenKind.BRACE_L,r,O.TokenKind.BRACE_R)})}parseObjectField(t){let r=this._lexer.token,n=this.parseName();return this.expectToken(O.TokenKind.COLON),this.node(r,{kind:M.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(t)})}parseDirectives(t){let r=[];for(;this.peek(O.TokenKind.AT);)r.push(this.parseDirective(t));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let r=this._lexer.token;return this.expectToken(O.TokenKind.AT),this.node(r,{kind:M.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,r;if(this.expectOptionalToken(O.TokenKind.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(O.TokenKind.BRACKET_R),r=this.node(t,{kind:M.Kind.LIST_TYPE,type:n})}else r=this.parseNamedType();return this.expectOptionalToken(O.TokenKind.BANG)?this.node(t,{kind:M.Kind.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:M.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(O.TokenKind.STRING)||this.peek(O.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.many(O.TokenKind.BRACE_L,this.parseOperationTypeDefinition,O.TokenKind.BRACE_R);return this.node(t,{kind:M.Kind.SCHEMA_DEFINITION,description:r,directives:n,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,r=this.parseOperationType();this.expectToken(O.TokenKind.COLON);let n=this.parseNamedType();return this.node(t,{kind:M.Kind.OPERATION_TYPE_DEFINITION,operation:r,type:n})}parseScalarTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:M.Kind.SCALAR_TYPE_DEFINITION,description:r,name:n,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:M.Kind.OBJECT_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(O.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(O.TokenKind.BRACE_L,this.parseFieldDefinition,O.TokenKind.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,r=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(O.TokenKind.COLON);let s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:M.Kind.FIELD_DEFINITION,description:r,name:n,arguments:i,type:s,directives:a})}parseArgumentDefs(){return this.optionalMany(O.TokenKind.PAREN_L,this.parseInputValueDef,O.TokenKind.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(O.TokenKind.COLON);let i=this.parseTypeReference(),s;this.expectOptionalToken(O.TokenKind.EQUALS)&&(s=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:M.Kind.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:M.Kind.INTERFACE_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:M.Kind.UNION_TYPE_DEFINITION,description:r,name:n,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(O.TokenKind.EQUALS)?this.delimitedMany(O.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:M.Kind.ENUM_TYPE_DEFINITION,description:r,name:n,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(O.TokenKind.BRACE_L,this.parseEnumValueDefinition,O.TokenKind.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,r=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:M.Kind.ENUM_VALUE_DEFINITION,description:r,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw(0,$t.syntaxError)(this._lexer.source,this._lexer.token.start,`${Kn(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:M.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:n,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(O.TokenKind.BRACE_L,this.parseInputValueDef,O.TokenKind.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===O.TokenKind.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let r=this.parseConstDirectives(),n=this.optionalMany(O.TokenKind.BRACE_L,this.parseOperationTypeDefinition,O.TokenKind.BRACE_R);if(r.length===0&&n.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.SCHEMA_EXTENSION,directives:r,operationTypes:n})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let r=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.SCALAR_TYPE_EXTENSION,name:r,directives:n})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.OBJECT_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.INTERFACE_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.UNION_TYPE_EXTENSION,name:r,directives:n,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.ENUM_TYPE_EXTENSION,name:r,directives:n,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:M.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:n,fields:i})}parseDirectiveDefinition(){let t=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(O.TokenKind.AT);let n=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:M.Kind.DIRECTIVE_DEFINITION,description:r,name:n,arguments:i,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(O.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(rm.DirectiveLocation,r.value))return r;throw this.unexpected(t)}node(t,r){return this._options.noLocation!==!0&&(r.loc=new Ur.Location(t,this._lexer.lastToken,this._lexer.source)),r}peek(t){return this._lexer.token.kind===t}expectToken(t){let r=this._lexer.token;if(r.kind===t)return this.advanceLexer(),r;throw(0,$t.syntaxError)(this._lexer.source,r.start,`Expected ${tc(t)}, found ${Kn(r)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let r=this._lexer.token;if(r.kind===O.TokenKind.NAME&&r.value===t)this.advanceLexer();else throw(0,$t.syntaxError)(this._lexer.source,r.start,`Expected "${t}", found ${Kn(r)}.`)}expectOptionalKeyword(t){let r=this._lexer.token;return r.kind===O.TokenKind.NAME&&r.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let r=t??this._lexer.token;return(0,$t.syntaxError)(this._lexer.source,r.start,`Unexpected ${Kn(r)}.`)}any(t,r,n){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(n);)i.push(r.call(this));return i}optionalMany(t,r,n){if(this.expectOptionalToken(t)){let i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(t,r,n){this.expectToken(t);let i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(t,r){this.expectOptionalToken(t);let n=[];do n.push(r.call(this));while(this.expectOptionalToken(t));return n}advanceLexer(){let{maxTokens:t}=this._options,r=this._lexer.advance();if(t!==void 0&&r.kind!==O.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw(0,$t.syntaxError)(this._lexer.source,r.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};Pt.Parser=Bt;function Kn(e){let t=e.value;return tc(e.kind)+(t!=null?` "${t}"`:"")}function tc(e){return(0,ec.isPunctuatorTokenKind)(e)?`"${e}"`:e}});var wt=h(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.didYouMean=um;var om=5;function um(e,t){let[r,n]=t?[e,t]:[void 0,e],i=" Did you mean ";r&&(i+=r+" ");let s=n.map(u=>`"${u}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}let a=s.slice(0,om),o=a.pop();return i+a.join(", ")+", or "+o+"?"}});var rc=h(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.identityFunc=cm;function cm(e){return e}});var Ft=h(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.keyMap=lm;function lm(e,t){let r=Object.create(null);for(let n of e)r[t(n)]=n;return r}});var Kr=h(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.keyValMap=pm;function pm(e,t,r){let n=Object.create(null);for(let i of e)n[t(i)]=r(i);return n}});var Ss=h(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.mapValue=dm;function dm(e,t){let r=Object.create(null);for(let n of Object.keys(e))r[n]=t(e[n],n);return r}});var $r=h(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.naturalCompare=fm;function fm(e,t){let r=0,n=0;for(;r0);let o=0;do++n,o=o*10+s-Ds,s=t.charCodeAt(n);while($n(s)&&o>0);if(ao)return 1}else{if(is)return 1;++r,++n}}return e.length-t.length}var Ds=48,mm=57;function $n(e){return!isNaN(e)&&Ds<=e&&e<=mm}});var kt=h(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.suggestionList=hm;var ym=$r();function hm(e,t){let r=Object.create(null),n=new Rs(e),i=Math.floor(e.length*.4)+1;for(let s of t){let a=n.measure(s,i);a!==void 0&&(r[s]=a)}return Object.keys(r).sort((s,a)=>{let o=r[s]-r[a];return o!==0?o:(0,ym.naturalCompare)(s,a)})}var Rs=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=nc(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,r){if(this._input===t)return 0;let n=t.toLowerCase();if(this._inputLowerCase===n)return 1;let i=nc(n),s=this._inputArray;if(i.lengthr)return;let u=this._rows;for(let l=0;l<=o;l++)u[0][l]=l;for(let l=1;l<=a;l++){let f=u[(l-1)%3],d=u[l%3],y=d[0]=l;for(let T=1;T<=o;T++){let I=i[l-1]===s[T-1]?0:1,E=Math.min(f[T]+1,d[T-1]+1,f[T-1]+I);if(l>1&&T>1&&i[l-1]===s[T-2]&&i[l-2]===s[T-1]){let L=u[(l-2)%3][T-2];E=Math.min(E,L+1)}Er)return}let c=u[a%3][o];return c<=r?c:void 0}};function nc(e){let t=e.length,r=new Array(t);for(let n=0;n{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.toObjMap=vm;function vm(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[r,n]of Object.entries(e))t[r]=n;return t}});var ic=h(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.printString=Tm;function Tm(e){return`"${e.replace(bm,gm)}"`}var bm=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function gm(e){return Em[e.charCodeAt(0)]}var Em=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]});var Yt=h(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.BREAK=void 0;qt.getEnterLeaveForKind=Yn;qt.getVisitFn=Lm;qt.visit=Om;qt.visitInParallel=Im;var _m=Fe(),Nm=re(),Fs=dt(),sc=H(),Tr=Object.freeze({});qt.BREAK=Tr;function Om(e,t,r=Fs.QueryDocumentKeys){let n=new Map;for(let L of Object.values(sc.Kind))n.set(L,Yn(t,L));let i,s=Array.isArray(e),a=[e],o=-1,u=[],c=e,l,f,d=[],y=[];do{o++;let L=o===a.length,F=L&&u.length!==0;if(L){if(l=y.length===0?void 0:d[d.length-1],c=f,f=y.pop(),F)if(s){c=c.slice();let P=0;for(let[G,C]of u){let w=G-P;C===null?(c.splice(w,1),P++):c[w]=C}}else{c=Object.defineProperties({},Object.getOwnPropertyDescriptors(c));for(let[P,G]of u)c[P]=G}o=i.index,a=i.keys,u=i.edits,s=i.inArray,i=i.prev}else if(f){if(l=s?o:a[o],c=f[l],c==null)continue;d.push(l)}let k;if(!Array.isArray(c)){var T,I;(0,Fs.isNode)(c)||(0,_m.devAssert)(!1,`Invalid AST Node: ${(0,Nm.inspect)(c)}.`);let P=L?(T=n.get(c.kind))===null||T===void 0?void 0:T.leave:(I=n.get(c.kind))===null||I===void 0?void 0:I.enter;if(k=P?.call(t,c,l,f,d,y),k===Tr)break;if(k===!1){if(!L){d.pop();continue}}else if(k!==void 0&&(u.push([l,k]),!L))if((0,Fs.isNode)(k))c=k;else{d.pop();continue}}if(k===void 0&&F&&u.push([l,c]),L)d.pop();else{var E;i={inArray:s,index:o,keys:a,edits:u,prev:i},s=Array.isArray(c),a=s?c:(E=r[c.kind])!==null&&E!==void 0?E:[],o=-1,u=[],f&&y.push(f),f=c}}while(i!==void 0);return u.length!==0?u[u.length-1][1]:e}function Im(e){let t=new Array(e.length).fill(null),r=Object.create(null);for(let n of Object.values(sc.Kind)){let i=!1,s=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let u=0;u{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.print=Rm;var Sm=qr(),Dm=ic(),Am=Yt();function Rm(e){return(0,Am.visit)(e,Pm)}var jm=80,Pm={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>A(e.definitions,` + +`)},OperationDefinition:{leave(e){let t=B("(",A(e.variableDefinitions,", "),")"),r=A([e.operation,A([e.name,t]),A(e.directives," ")]," ");return(r==="query"?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+B(" = ",r)+B(" ",A(n," "))},SelectionSet:{leave:({selections:e})=>nt(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){let s=B("",e,": ")+t,a=s+B("(",A(r,", "),")");return a.length>jm&&(a=s+B(`( +`,Jn(A(r,` +`)),` +)`)),A([a,A(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+B(" ",A(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>A(["...",B("on ",e),A(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${B("(",A(r,", "),")")} on ${t} ${B("",A(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,Sm.printBlockString)(e):(0,Dm.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+A(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+A(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+B("(",A(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>B("",e,` +`)+A(["schema",A(t," "),nt(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>B("",e,` +`)+A(["scalar",t,A(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>B("",e,` +`)+A(["type",t,B("implements ",A(r," & ")),A(n," "),nt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>B("",e,` +`)+t+(ac(r)?B(`( +`,Jn(A(r,` +`)),` +)`):B("(",A(r,", "),")"))+": "+n+B(" ",A(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>B("",e,` +`)+A([t+": "+r,B("= ",n),A(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>B("",e,` +`)+A(["interface",t,B("implements ",A(r," & ")),A(n," "),nt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>B("",e,` +`)+A(["union",t,A(r," "),B("= ",A(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>B("",e,` +`)+A(["enum",t,A(r," "),nt(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>B("",e,` +`)+A([t,A(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>B("",e,` +`)+A(["input",t,A(r," "),nt(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>B("",e,` +`)+"directive @"+t+(ac(r)?B(`( +`,Jn(A(r,` +`)),` +)`):B("(",A(r,", "),")"))+(n?" repeatable":"")+" on "+A(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>A(["extend schema",A(e," "),nt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>A(["extend scalar",e,A(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>A(["extend type",e,B("implements ",A(t," & ")),A(r," "),nt(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>A(["extend interface",e,B("implements ",A(t," & ")),A(r," "),nt(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>A(["extend union",e,A(t," "),B("= ",A(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>A(["extend enum",e,A(t," "),nt(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>A(["extend input",e,A(t," "),nt(r)]," ")}};function A(e,t=""){var r;return(r=e?.filter(n=>n).join(t))!==null&&r!==void 0?r:""}function nt(e){return B(`{ +`,Jn(A(e,` +`)),` +}`)}function B(e,t,r=""){return t!=null&&t!==""?e+t+r:""}function Jn(e){return B(" ",e.replace(/\n/g,` + `))}function ac(e){var t;return(t=e?.some(r=>r.includes(` +`)))!==null&&t!==void 0?t:!1}});var Vs=h(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.valueFromASTUntyped=qs;var wm=Kr(),Ot=H();function qs(e,t){switch(e.kind){case Ot.Kind.NULL:return null;case Ot.Kind.INT:return parseInt(e.value,10);case Ot.Kind.FLOAT:return parseFloat(e.value);case Ot.Kind.STRING:case Ot.Kind.ENUM:case Ot.Kind.BOOLEAN:return e.value;case Ot.Kind.LIST:return e.values.map(r=>qs(r,t));case Ot.Kind.OBJECT:return(0,wm.keyValMap)(e.fields,r=>r.name.value,r=>qs(r.value,t));case Ot.Kind.VARIABLE:return t?.[e.name.value]}}});var Br=h(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.assertEnumValueName=Fm;Hn.assertName=cc;var oc=Fe(),Xn=q(),uc=xn();function cc(e){if(e!=null||(0,oc.devAssert)(!1,"Must provide name."),typeof e=="string"||(0,oc.devAssert)(!1,"Expected name to be a string."),e.length===0)throw new Xn.GraphQLError("Expected name to be a non-empty string.");for(let t=1;t{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.GraphQLUnionType=j.GraphQLScalarType=j.GraphQLObjectType=j.GraphQLNonNull=j.GraphQLList=j.GraphQLInterfaceType=j.GraphQLInputObjectType=j.GraphQLEnumType=void 0;j.argsToArgsConfig=Ec;j.assertAbstractType=ey;j.assertCompositeType=Zm;j.assertEnumType=Bm;j.assertInputObjectType=Ym;j.assertInputType=Hm;j.assertInterfaceType=Km;j.assertLeafType=Wm;j.assertListType=Jm;j.assertNamedType=iy;j.assertNonNullType=Xm;j.assertNullableType=ry;j.assertObjectType=Um;j.assertOutputType=zm;j.assertScalarType=Qm;j.assertType=Cm;j.assertUnionType=$m;j.assertWrappingType=ty;j.defineArguments=bc;j.getNamedType=sy;j.getNullableType=ny;j.isAbstractType=yc;j.isCompositeType=mc;j.isEnumType=zt;j.isInputObjectType=Jr;j.isInputType=Ms;j.isInterfaceType=Xt;j.isLeafType=fc;j.isListType=ui;j.isNamedType=hc;j.isNonNullType=Vt;j.isNullableType=Cs;j.isObjectType=gr;j.isOutputType=Gs;j.isRequiredArgument=ay;j.isRequiredInputField=ly;j.isScalarType=Jt;j.isType=oi;j.isUnionType=Ht;j.isWrappingType=Xr;j.resolveObjMapThunk=Us;j.resolveReadonlyArrayThunk=Qs;var Se=Fe(),km=wt(),lc=rc(),se=re(),xt=Cr(),qm=pt(),xm=Ft(),dc=Kr(),ai=Ss(),Vm=kt(),ft=Bn(),Yr=q(),Mm=H(),pc=Ce(),Gm=Vs(),mt=Br();function oi(e){return Jt(e)||gr(e)||Xt(e)||Ht(e)||zt(e)||Jr(e)||ui(e)||Vt(e)}function Cm(e){if(!oi(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL type.`);return e}function Jt(e){return(0,xt.instanceOf)(e,ei)}function Qm(e){if(!Jt(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Scalar type.`);return e}function gr(e){return(0,xt.instanceOf)(e,ti)}function Um(e){if(!gr(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Object type.`);return e}function Xt(e){return(0,xt.instanceOf)(e,ri)}function Km(e){if(!Xt(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Interface type.`);return e}function Ht(e){return(0,xt.instanceOf)(e,ni)}function $m(e){if(!Ht(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Union type.`);return e}function zt(e){return(0,xt.instanceOf)(e,ii)}function Bm(e){if(!zt(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Enum type.`);return e}function Jr(e){return(0,xt.instanceOf)(e,si)}function Ym(e){if(!Jr(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Input Object type.`);return e}function ui(e){return(0,xt.instanceOf)(e,Wn)}function Jm(e){if(!ui(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL List type.`);return e}function Vt(e){return(0,xt.instanceOf)(e,Zn)}function Xm(e){if(!Vt(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL Non-Null type.`);return e}function Ms(e){return Jt(e)||zt(e)||Jr(e)||Xr(e)&&Ms(e.ofType)}function Hm(e){if(!Ms(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL input type.`);return e}function Gs(e){return Jt(e)||gr(e)||Xt(e)||Ht(e)||zt(e)||Xr(e)&&Gs(e.ofType)}function zm(e){if(!Gs(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL output type.`);return e}function fc(e){return Jt(e)||zt(e)}function Wm(e){if(!fc(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL leaf type.`);return e}function mc(e){return gr(e)||Xt(e)||Ht(e)}function Zm(e){if(!mc(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL composite type.`);return e}function yc(e){return Xt(e)||Ht(e)}function ey(e){if(!yc(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL abstract type.`);return e}var Wn=class{constructor(t){oi(t)||(0,Se.devAssert)(!1,`Expected ${(0,se.inspect)(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}};j.GraphQLList=Wn;var Zn=class{constructor(t){Cs(t)||(0,Se.devAssert)(!1,`Expected ${(0,se.inspect)(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};j.GraphQLNonNull=Zn;function Xr(e){return ui(e)||Vt(e)}function ty(e){if(!Xr(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL wrapping type.`);return e}function Cs(e){return oi(e)&&!Vt(e)}function ry(e){if(!Cs(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL nullable type.`);return e}function ny(e){if(e)return Vt(e)?e.ofType:e}function hc(e){return Jt(e)||gr(e)||Xt(e)||Ht(e)||zt(e)||Jr(e)}function iy(e){if(!hc(e))throw new Error(`Expected ${(0,se.inspect)(e)} to be a GraphQL named type.`);return e}function sy(e){if(e){let t=e;for(;Xr(t);)t=t.ofType;return t}}function Qs(e){return typeof e=="function"?e():e}function Us(e){return typeof e=="function"?e():e}var ei=class{constructor(t){var r,n,i,s;let a=(r=t.parseValue)!==null&&r!==void 0?r:lc.identityFunc;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(n=t.serialize)!==null&&n!==void 0?n:lc.identityFunc,this.parseValue=a,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(o,u)=>a((0,Gm.valueFromASTUntyped)(o,u)),this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(s=t.extensionASTNodes)!==null&&s!==void 0?s:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||(0,Se.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,se.inspect)(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||(0,Se.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||(0,Se.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLScalarType=ei;var ti=class{constructor(t){var r;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=()=>Tc(t),this._interfaces=()=>vc(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||(0,Se.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,se.inspect)(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:gc(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLObjectType=ti;function vc(e){var t;let r=Qs((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(r)||(0,Se.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),r}function Tc(e){let t=Us(e.fields);return br(t)||(0,Se.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,ai.mapValue)(t,(r,n)=>{var i;br(r)||(0,Se.devAssert)(!1,`${e.name}.${n} field config must be an object.`),r.resolve==null||typeof r.resolve=="function"||(0,Se.devAssert)(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${(0,se.inspect)(r.resolve)}.`);let s=(i=r.args)!==null&&i!==void 0?i:{};return br(s)||(0,Se.devAssert)(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:(0,mt.assertName)(n),description:r.description,type:r.type,args:bc(s),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:(0,ft.toObjMap)(r.extensions),astNode:r.astNode}})}function bc(e){return Object.entries(e).map(([t,r])=>({name:(0,mt.assertName)(t),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:(0,ft.toObjMap)(r.extensions),astNode:r.astNode}))}function br(e){return(0,qm.isObjectLike)(e)&&!Array.isArray(e)}function gc(e){return(0,ai.mapValue)(e,t=>({description:t.description,type:t.type,args:Ec(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function Ec(e){return(0,dc.keyValMap)(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function ay(e){return Vt(e.type)&&e.defaultValue===void 0}var ri=class{constructor(t){var r;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=Tc.bind(void 0,t),this._interfaces=vc.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,Se.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,se.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:gc(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLInterfaceType=ri;var ni=class{constructor(t){var r;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._types=oy.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||(0,Se.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,se.inspect)(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLUnionType=ni;function oy(e){let t=Qs(e.types);return Array.isArray(t)||(0,Se.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}var ii=class{constructor(t){var r;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._values=uy(this.name,t.values),this._valueLookup=new Map(this._values.map(n=>[n.value,n])),this._nameLookup=(0,xm.keyMap)(this._values,n=>n.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(t){return this._nameLookup[t]}serialize(t){let r=this._valueLookup.get(t);if(r===void 0)throw new Yr.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,se.inspect)(t)}`);return r.name}parseValue(t){if(typeof t!="string"){let n=(0,se.inspect)(t);throw new Yr.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+zn(this,n))}let r=this.getValue(t);if(r==null)throw new Yr.GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+zn(this,t));return r.value}parseLiteral(t,r){if(t.kind!==Mm.Kind.ENUM){let i=(0,pc.print)(t);throw new Yr.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+zn(this,i),{nodes:t})}let n=this.getValue(t.value);if(n==null){let i=(0,pc.print)(t);throw new Yr.GraphQLError(`Value "${i}" does not exist in "${this.name}" enum.`+zn(this,i),{nodes:t})}return n.value}toConfig(){let t=(0,dc.keyValMap)(this.getValues(),r=>r.name,r=>({description:r.description,value:r.value,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLEnumType=ii;function zn(e,t){let r=e.getValues().map(i=>i.name),n=(0,Vm.suggestionList)(t,r);return(0,km.didYouMean)("the enum value",n)}function uy(e,t){return br(t)||(0,Se.devAssert)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([r,n])=>(br(n)||(0,Se.devAssert)(!1,`${e}.${r} must refer to an object with a "value" key representing an internal value but got: ${(0,se.inspect)(n)}.`),{name:(0,mt.assertEnumValueName)(r),description:n.description,value:n.value!==void 0?n.value:r,deprecationReason:n.deprecationReason,extensions:(0,ft.toObjMap)(n.extensions),astNode:n.astNode}))}var si=class{constructor(t){var r;this.name=(0,mt.assertName)(t.name),this.description=t.description,this.extensions=(0,ft.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=cy.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=(0,ai.mapValue)(this.getFields(),r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};j.GraphQLInputObjectType=si;function cy(e){let t=Us(e.fields);return br(t)||(0,Se.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,ai.mapValue)(t,(r,n)=>(!("resolve"in r)||(0,Se.devAssert)(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,mt.assertName)(n),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:(0,ft.toObjMap)(r.extensions),astNode:r.astNode}))}function ly(e){return Vt(e.type)&&e.defaultValue===void 0}});var zr=h(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.doTypesOverlap=py;Hr.isEqualType=Ks;Hr.isTypeSubTypeOf=ci;var Pe=Y();function Ks(e,t){return e===t?!0:(0,Pe.isNonNullType)(e)&&(0,Pe.isNonNullType)(t)||(0,Pe.isListType)(e)&&(0,Pe.isListType)(t)?Ks(e.ofType,t.ofType):!1}function ci(e,t,r){return t===r?!0:(0,Pe.isNonNullType)(r)?(0,Pe.isNonNullType)(t)?ci(e,t.ofType,r.ofType):!1:(0,Pe.isNonNullType)(t)?ci(e,t.ofType,r):(0,Pe.isListType)(r)?(0,Pe.isListType)(t)?ci(e,t.ofType,r.ofType):!1:(0,Pe.isListType)(t)?!1:(0,Pe.isAbstractType)(r)&&((0,Pe.isInterfaceType)(t)||(0,Pe.isObjectType)(t))&&e.isSubType(r,t)}function py(e,t,r){return t===r?!0:(0,Pe.isAbstractType)(t)?(0,Pe.isAbstractType)(r)?e.getPossibleTypes(t).some(n=>e.isSubType(r,n)):e.isSubType(t,r):(0,Pe.isAbstractType)(r)?e.isSubType(r,t):!1}});var yt=h(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.GraphQLString=ge.GraphQLInt=ge.GraphQLID=ge.GraphQLFloat=ge.GraphQLBoolean=ge.GRAPHQL_MIN_INT=ge.GRAPHQL_MAX_INT=void 0;ge.isSpecifiedScalarType=dy;ge.specifiedScalarTypes=void 0;var it=re(),_c=pt(),De=q(),Wt=H(),Wr=Ce(),Zr=Y(),li=2147483647;ge.GRAPHQL_MAX_INT=li;var pi=-2147483648;ge.GRAPHQL_MIN_INT=pi;var Nc=new Zr.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=en(e);if(typeof t=="boolean")return t?1:0;let r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),typeof r!="number"||!Number.isInteger(r))throw new De.GraphQLError(`Int cannot represent non-integer value: ${(0,it.inspect)(t)}`);if(r>li||rli||eli||te.name===t)}function en(e){if((0,_c.isObjectLike)(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!(0,_c.isObjectLike)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}});var Ve=h(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.GraphQLSpecifiedByDirective=Ee.GraphQLSkipDirective=Ee.GraphQLIncludeDirective=Ee.GraphQLDirective=Ee.GraphQLDeprecatedDirective=Ee.DEFAULT_DEPRECATION_REASON=void 0;Ee.assertDirective=Ty;Ee.isDirective=Rc;Ee.isSpecifiedDirective=by;Ee.specifiedDirectives=void 0;var Ac=Fe(),fy=re(),my=Cr(),yy=pt(),hy=Bn(),st=yr(),vy=Br(),tn=Y(),di=yt();function Rc(e){return(0,my.instanceOf)(e,Mt)}function Ty(e){if(!Rc(e))throw new Error(`Expected ${(0,fy.inspect)(e)} to be a GraphQL directive.`);return e}var Mt=class{constructor(t){var r,n;this.name=(0,vy.assertName)(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(r=t.isRepeatable)!==null&&r!==void 0?r:!1,this.extensions=(0,hy.toObjMap)(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||(0,Ac.devAssert)(!1,`@${t.name} locations must be an Array.`);let i=(n=t.args)!==null&&n!==void 0?n:{};(0,yy.isObjectLike)(i)&&!Array.isArray(i)||(0,Ac.devAssert)(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=(0,tn.defineArguments)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,tn.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}};Ee.GraphQLDirective=Mt;var jc=new Mt({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[st.DirectiveLocation.FIELD,st.DirectiveLocation.FRAGMENT_SPREAD,st.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new tn.GraphQLNonNull(di.GraphQLBoolean),description:"Included when true."}}});Ee.GraphQLIncludeDirective=jc;var Pc=new Mt({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[st.DirectiveLocation.FIELD,st.DirectiveLocation.FRAGMENT_SPREAD,st.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new tn.GraphQLNonNull(di.GraphQLBoolean),description:"Skipped when true."}}});Ee.GraphQLSkipDirective=Pc;var wc="No longer supported";Ee.DEFAULT_DEPRECATION_REASON=wc;var Fc=new Mt({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[st.DirectiveLocation.FIELD_DEFINITION,st.DirectiveLocation.ARGUMENT_DEFINITION,st.DirectiveLocation.INPUT_FIELD_DEFINITION,st.DirectiveLocation.ENUM_VALUE],args:{reason:{type:di.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:wc}}});Ee.GraphQLDeprecatedDirective=Fc;var kc=new Mt({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[st.DirectiveLocation.SCALAR],args:{url:{type:new tn.GraphQLNonNull(di.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});Ee.GraphQLSpecifiedByDirective=kc;var qc=Object.freeze([jc,Pc,Fc,kc]);Ee.specifiedDirectives=qc;function by(e){return qc.some(({name:t})=>t===e.name)}});var fi=h($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.isIterableObject=gy;function gy(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}});var sn=h(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.astFromValue=nn;var xc=re(),Ey=je(),_y=fi(),Ny=pt(),$e=H(),rn=Y(),Oy=yt();function nn(e,t){if((0,rn.isNonNullType)(t)){let r=nn(e,t.ofType);return r?.kind===$e.Kind.NULL?null:r}if(e===null)return{kind:$e.Kind.NULL};if(e===void 0)return null;if((0,rn.isListType)(t)){let r=t.ofType;if((0,_y.isIterableObject)(e)){let n=[];for(let i of e){let s=nn(i,r);s!=null&&n.push(s)}return{kind:$e.Kind.LIST,values:n}}return nn(e,r)}if((0,rn.isInputObjectType)(t)){if(!(0,Ny.isObjectLike)(e))return null;let r=[];for(let n of Object.values(t.getFields())){let i=nn(e[n.name],n.type);i&&r.push({kind:$e.Kind.OBJECT_FIELD,name:{kind:$e.Kind.NAME,value:n.name},value:i})}return{kind:$e.Kind.OBJECT,fields:r}}if((0,rn.isLeafType)(t)){let r=t.serialize(e);if(r==null)return null;if(typeof r=="boolean")return{kind:$e.Kind.BOOLEAN,value:r};if(typeof r=="number"&&Number.isFinite(r)){let n=String(r);return Vc.test(n)?{kind:$e.Kind.INT,value:n}:{kind:$e.Kind.FLOAT,value:n}}if(typeof r=="string")return(0,rn.isEnumType)(t)?{kind:$e.Kind.ENUM,value:r}:t===Oy.GraphQLID&&Vc.test(r)?{kind:$e.Kind.INT,value:r}:{kind:$e.Kind.STRING,value:r};throw new TypeError(`Cannot convert value to AST: ${(0,xc.inspect)(r)}.`)}(0,Ey.invariant)(!1,"Unexpected input type: "+(0,xc.inspect)(t))}var Vc=/^-?(?:0|[1-9][0-9]*)$/});var Ye=h(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.introspectionTypes=ne.__TypeKind=ne.__Type=ne.__Schema=ne.__InputValue=ne.__Field=ne.__EnumValue=ne.__DirectiveLocation=ne.__Directive=ne.TypeNameMetaFieldDef=ne.TypeMetaFieldDef=ne.TypeKind=ne.SchemaMetaFieldDef=void 0;ne.isIntrospectionType=Py;var Iy=re(),Ly=je(),_e=yr(),Sy=Ce(),Dy=sn(),R=Y(),ae=yt(),Ys=new R.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:ae.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new R.GraphQLNonNull(new R.GraphQLList(new R.GraphQLNonNull(Be))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new R.GraphQLNonNull(Be),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Be,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Be,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new R.GraphQLNonNull(new R.GraphQLList(new R.GraphQLNonNull(Js))),resolve:e=>e.getDirectives()}})});ne.__Schema=Ys;var Js=new R.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. + +In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new R.GraphQLNonNull(ae.GraphQLString),resolve:e=>e.name},description:{type:ae.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new R.GraphQLNonNull(ae.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new R.GraphQLNonNull(new R.GraphQLList(new R.GraphQLNonNull(Xs))),resolve:e=>e.locations},args:{type:new R.GraphQLNonNull(new R.GraphQLList(new R.GraphQLNonNull(an))),args:{includeDeprecated:{type:ae.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(r=>r.deprecationReason==null)}}})});ne.__Directive=Js;var Xs=new R.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:_e.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:_e.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:_e.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:_e.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:_e.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:_e.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:_e.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:_e.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:_e.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:_e.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:_e.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:_e.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:_e.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:_e.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:_e.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:_e.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:_e.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:_e.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:_e.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});ne.__DirectiveLocation=Xs;var Be=new R.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new R.GraphQLNonNull(Ws),resolve(e){if((0,R.isScalarType)(e))return Ne.SCALAR;if((0,R.isObjectType)(e))return Ne.OBJECT;if((0,R.isInterfaceType)(e))return Ne.INTERFACE;if((0,R.isUnionType)(e))return Ne.UNION;if((0,R.isEnumType)(e))return Ne.ENUM;if((0,R.isInputObjectType)(e))return Ne.INPUT_OBJECT;if((0,R.isListType)(e))return Ne.LIST;if((0,R.isNonNullType)(e))return Ne.NON_NULL;(0,Ly.invariant)(!1,`Unexpected type: "${(0,Iy.inspect)(e)}".`)}},name:{type:ae.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:ae.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:ae.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new R.GraphQLList(new R.GraphQLNonNull(Hs)),args:{includeDeprecated:{type:ae.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,R.isObjectType)(e)||(0,R.isInterfaceType)(e)){let r=Object.values(e.getFields());return t?r:r.filter(n=>n.deprecationReason==null)}}},interfaces:{type:new R.GraphQLList(new R.GraphQLNonNull(Be)),resolve(e){if((0,R.isObjectType)(e)||(0,R.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new R.GraphQLList(new R.GraphQLNonNull(Be)),resolve(e,t,r,{schema:n}){if((0,R.isAbstractType)(e))return n.getPossibleTypes(e)}},enumValues:{type:new R.GraphQLList(new R.GraphQLNonNull(zs)),args:{includeDeprecated:{type:ae.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,R.isEnumType)(e)){let r=e.getValues();return t?r:r.filter(n=>n.deprecationReason==null)}}},inputFields:{type:new R.GraphQLList(new R.GraphQLNonNull(an)),args:{includeDeprecated:{type:ae.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,R.isInputObjectType)(e)){let r=Object.values(e.getFields());return t?r:r.filter(n=>n.deprecationReason==null)}}},ofType:{type:Be,resolve:e=>"ofType"in e?e.ofType:void 0}})});ne.__Type=Be;var Hs=new R.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new R.GraphQLNonNull(ae.GraphQLString),resolve:e=>e.name},description:{type:ae.GraphQLString,resolve:e=>e.description},args:{type:new R.GraphQLNonNull(new R.GraphQLList(new R.GraphQLNonNull(an))),args:{includeDeprecated:{type:ae.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(r=>r.deprecationReason==null)}},type:{type:new R.GraphQLNonNull(Be),resolve:e=>e.type},isDeprecated:{type:new R.GraphQLNonNull(ae.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:ae.GraphQLString,resolve:e=>e.deprecationReason}})});ne.__Field=Hs;var an=new R.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new R.GraphQLNonNull(ae.GraphQLString),resolve:e=>e.name},description:{type:ae.GraphQLString,resolve:e=>e.description},type:{type:new R.GraphQLNonNull(Be),resolve:e=>e.type},defaultValue:{type:ae.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:r}=e,n=(0,Dy.astFromValue)(r,t);return n?(0,Sy.print)(n):null}},isDeprecated:{type:new R.GraphQLNonNull(ae.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:ae.GraphQLString,resolve:e=>e.deprecationReason}})});ne.__InputValue=an;var zs=new R.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new R.GraphQLNonNull(ae.GraphQLString),resolve:e=>e.name},description:{type:ae.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new R.GraphQLNonNull(ae.GraphQLBoolean),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:ae.GraphQLString,resolve:e=>e.deprecationReason}})});ne.__EnumValue=zs;var Ne;ne.TypeKind=Ne;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(Ne||(ne.TypeKind=Ne={}));var Ws=new R.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Ne.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Ne.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Ne.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Ne.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Ne.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Ne.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Ne.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Ne.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});ne.__TypeKind=Ws;var Ay={name:"__schema",type:new R.GraphQLNonNull(Ys),description:"Access the current type schema of this server.",args:[],resolve:(e,t,r,{schema:n})=>n,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};ne.SchemaMetaFieldDef=Ay;var Ry={name:"__type",type:Be,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new R.GraphQLNonNull(ae.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},r,{schema:n})=>n.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};ne.TypeMetaFieldDef=Ry;var jy={name:"__typename",type:new R.GraphQLNonNull(ae.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,r,{parentType:n})=>n.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};ne.TypeNameMetaFieldDef=jy;var Mc=Object.freeze([Ys,Js,Xs,Be,Hs,an,zs,Ws]);ne.introspectionTypes=Mc;function Py(e){return Mc.some(({name:t})=>e.name===t)}});var Zt=h(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.GraphQLSchema=void 0;Er.assertSchema=xy;Er.isSchema=Cc;var mi=Fe(),ea=re(),wy=Cr(),Fy=pt(),ky=Bn(),Zs=dt(),at=Y(),Gc=Ve(),qy=Ye();function Cc(e){return(0,wy.instanceOf)(e,yi)}function xy(e){if(!Cc(e))throw new Error(`Expected ${(0,ea.inspect)(e)} to be a GraphQL schema.`);return e}var yi=class{constructor(t){var r,n;this.__validationErrors=t.assumeValid===!0?[]:void 0,(0,Fy.isObjectLike)(t)||(0,mi.devAssert)(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||(0,mi.devAssert)(!1,`"types" must be Array if provided but got: ${(0,ea.inspect)(t.types)}.`),!t.directives||Array.isArray(t.directives)||(0,mi.devAssert)(!1,`"directives" must be Array if provided but got: ${(0,ea.inspect)(t.directives)}.`),this.description=t.description,this.extensions=(0,ky.toObjMap)(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(r=t.extensionASTNodes)!==null&&r!==void 0?r:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(n=t.directives)!==null&&n!==void 0?n:Gc.specifiedDirectives;let i=new Set(t.types);if(t.types!=null)for(let s of t.types)i.delete(s),ot(s,i);this._queryType!=null&&ot(this._queryType,i),this._mutationType!=null&&ot(this._mutationType,i),this._subscriptionType!=null&&ot(this._subscriptionType,i);for(let s of this._directives)if((0,Gc.isDirective)(s))for(let a of s.args)ot(a.type,i);ot(qy.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let s of i){if(s==null)continue;let a=s.name;if(a||(0,mi.devAssert)(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[a]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${a}".`);if(this._typeMap[a]=s,(0,at.isInterfaceType)(s)){for(let o of s.getInterfaces())if((0,at.isInterfaceType)(o)){let u=this._implementationsMap[o.name];u===void 0&&(u=this._implementationsMap[o.name]={objects:[],interfaces:[]}),u.interfaces.push(s)}}else if((0,at.isObjectType)(s)){for(let o of s.getInterfaces())if((0,at.isInterfaceType)(o)){let u=this._implementationsMap[o.name];u===void 0&&(u=this._implementationsMap[o.name]={objects:[],interfaces:[]}),u.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Zs.OperationTypeNode.QUERY:return this.getQueryType();case Zs.OperationTypeNode.MUTATION:return this.getMutationType();case Zs.OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return(0,at.isUnionType)(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let r=this._implementationsMap[t.name];return r??{objects:[],interfaces:[]}}isSubType(t,r){let n=this._subTypeMap[t.name];if(n===void 0){if(n=Object.create(null),(0,at.isUnionType)(t))for(let i of t.getTypes())n[i.name]=!0;else{let i=this.getImplementations(t);for(let s of i.objects)n[s.name]=!0;for(let s of i.interfaces)n[s.name]=!0}this._subTypeMap[t.name]=n}return n[r.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(r=>r.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}};Er.GraphQLSchema=yi;function ot(e,t){let r=(0,at.getNamedType)(e);if(!t.has(r)){if(t.add(r),(0,at.isUnionType)(r))for(let n of r.getTypes())ot(n,t);else if((0,at.isObjectType)(r)||(0,at.isInterfaceType)(r)){for(let n of r.getInterfaces())ot(n,t);for(let n of Object.values(r.getFields())){ot(n.type,t);for(let i of n.args)ot(i.type,t)}}else if((0,at.isInputObjectType)(r))for(let n of Object.values(r.getFields()))ot(n.type,t)}return t}});var un=h(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.assertValidSchema=Cy;hi.validateSchema=Yc;var we=re(),Vy=q(),ta=dt(),Qc=zr(),he=Y(),Bc=Ve(),My=Ye(),Gy=Zt();function Yc(e){if((0,Gy.assertSchema)(e),e.__validationErrors)return e.__validationErrors;let t=new na(e);Qy(t),Uy(t),Ky(t);let r=t.getErrors();return e.__validationErrors=r,r}function Cy(e){let t=Yc(e);if(t.length!==0)throw new Error(t.map(r=>r.message).join(` + +`))}var na=class{constructor(t){this._errors=[],this.schema=t}reportError(t,r){let n=Array.isArray(r)?r.filter(Boolean):r;this._errors.push(new Vy.GraphQLError(t,{nodes:n}))}getErrors(){return this._errors}};function Qy(e){let t=e.schema,r=t.getQueryType();if(!r)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,he.isObjectType)(r)){var n;e.reportError(`Query root type must be Object type, it cannot be ${(0,we.inspect)(r)}.`,(n=ra(t,ta.OperationTypeNode.QUERY))!==null&&n!==void 0?n:r.astNode)}let i=t.getMutationType();if(i&&!(0,he.isObjectType)(i)){var s;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,we.inspect)(i)}.`,(s=ra(t,ta.OperationTypeNode.MUTATION))!==null&&s!==void 0?s:i.astNode)}let a=t.getSubscriptionType();if(a&&!(0,he.isObjectType)(a)){var o;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,we.inspect)(a)}.`,(o=ra(t,ta.OperationTypeNode.SUBSCRIPTION))!==null&&o!==void 0?o:a.astNode)}}function ra(e,t){var r;return(r=[e.astNode,...e.extensionASTNodes].flatMap(n=>{var i;return(i=n?.operationTypes)!==null&&i!==void 0?i:[]}).find(n=>n.operation===t))===null||r===void 0?void 0:r.type}function Uy(e){for(let r of e.schema.getDirectives()){if(!(0,Bc.isDirective)(r)){e.reportError(`Expected directive but got: ${(0,we.inspect)(r)}.`,r?.astNode);continue}er(e,r);for(let n of r.args)if(er(e,n),(0,he.isInputType)(n.type)||e.reportError(`The type of @${r.name}(${n.name}:) must be Input Type but got: ${(0,we.inspect)(n.type)}.`,n.astNode),(0,he.isRequiredArgument)(n)&&n.deprecationReason!=null){var t;e.reportError(`Required argument @${r.name}(${n.name}:) cannot be deprecated.`,[ia(n.astNode),(t=n.astNode)===null||t===void 0?void 0:t.type])}}}function er(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Ky(e){let t=Hy(e),r=e.schema.getTypeMap();for(let n of Object.values(r)){if(!(0,he.isNamedType)(n)){e.reportError(`Expected GraphQL named type but got: ${(0,we.inspect)(n)}.`,n.astNode);continue}(0,My.isIntrospectionType)(n)||er(e,n),(0,he.isObjectType)(n)||(0,he.isInterfaceType)(n)?(Uc(e,n),Kc(e,n)):(0,he.isUnionType)(n)?Yy(e,n):(0,he.isEnumType)(n)?Jy(e,n):(0,he.isInputObjectType)(n)&&(Xy(e,n),t(n))}}function Uc(e,t){let r=Object.values(t.getFields());r.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let a of r){if(er(e,a),!(0,he.isOutputType)(a.type)){var n;e.reportError(`The type of ${t.name}.${a.name} must be Output Type but got: ${(0,we.inspect)(a.type)}.`,(n=a.astNode)===null||n===void 0?void 0:n.type)}for(let o of a.args){let u=o.name;if(er(e,o),!(0,he.isInputType)(o.type)){var i;e.reportError(`The type of ${t.name}.${a.name}(${u}:) must be Input Type but got: ${(0,we.inspect)(o.type)}.`,(i=o.astNode)===null||i===void 0?void 0:i.type)}if((0,he.isRequiredArgument)(o)&&o.deprecationReason!=null){var s;e.reportError(`Required argument ${t.name}.${a.name}(${u}:) cannot be deprecated.`,[ia(o.astNode),(s=o.astNode)===null||s===void 0?void 0:s.type])}}}}function Kc(e,t){let r=Object.create(null);for(let n of t.getInterfaces()){if(!(0,he.isInterfaceType)(n)){e.reportError(`Type ${(0,we.inspect)(t)} must only implement Interface types, it cannot implement ${(0,we.inspect)(n)}.`,on(t,n));continue}if(t===n){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,on(t,n));continue}if(r[n.name]){e.reportError(`Type ${t.name} can only implement ${n.name} once.`,on(t,n));continue}r[n.name]=!0,By(e,t,n),$y(e,t,n)}}function $y(e,t,r){let n=t.getFields();for(let u of Object.values(r.getFields())){let c=u.name,l=n[c];if(!l){e.reportError(`Interface field ${r.name}.${c} expected but ${t.name} does not provide it.`,[u.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!(0,Qc.isTypeSubTypeOf)(e.schema,l.type,u.type)){var i,s;e.reportError(`Interface field ${r.name}.${c} expects type ${(0,we.inspect)(u.type)} but ${t.name}.${c} is type ${(0,we.inspect)(l.type)}.`,[(i=u.astNode)===null||i===void 0?void 0:i.type,(s=l.astNode)===null||s===void 0?void 0:s.type])}for(let f of u.args){let d=f.name,y=l.args.find(T=>T.name===d);if(!y){e.reportError(`Interface field argument ${r.name}.${c}(${d}:) expected but ${t.name}.${c} does not provide it.`,[f.astNode,l.astNode]);continue}if(!(0,Qc.isEqualType)(f.type,y.type)){var a,o;e.reportError(`Interface field argument ${r.name}.${c}(${d}:) expects type ${(0,we.inspect)(f.type)} but ${t.name}.${c}(${d}:) is type ${(0,we.inspect)(y.type)}.`,[(a=f.astNode)===null||a===void 0?void 0:a.type,(o=y.astNode)===null||o===void 0?void 0:o.type])}}for(let f of l.args){let d=f.name;!u.args.find(T=>T.name===d)&&(0,he.isRequiredArgument)(f)&&e.reportError(`Object field ${t.name}.${c} includes required argument ${d} that is missing from the Interface field ${r.name}.${c}.`,[f.astNode,u.astNode])}}}function By(e,t,r){let n=t.getInterfaces();for(let i of r.getInterfaces())n.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${r.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${r.name}.`,[...on(r,i),...on(t,r)])}function Yy(e,t){let r=t.getTypes();r.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let n=Object.create(null);for(let i of r){if(n[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,$c(t,i.name));continue}n[i.name]=!0,(0,he.isObjectType)(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,we.inspect)(i)}.`,$c(t,String(i)))}}function Jy(e,t){let r=t.getValues();r.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let n of r)er(e,n)}function Xy(e,t){let r=Object.values(t.getFields());r.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let s of r){if(er(e,s),!(0,he.isInputType)(s.type)){var n;e.reportError(`The type of ${t.name}.${s.name} must be Input Type but got: ${(0,we.inspect)(s.type)}.`,(n=s.astNode)===null||n===void 0?void 0:n.type)}if((0,he.isRequiredInputField)(s)&&s.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${s.name} cannot be deprecated.`,[ia(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type])}}}function Hy(e){let t=Object.create(null),r=[],n=Object.create(null);return i;function i(s){if(t[s.name])return;t[s.name]=!0,n[s.name]=r.length;let a=Object.values(s.getFields());for(let o of a)if((0,he.isNonNullType)(o.type)&&(0,he.isInputObjectType)(o.type.ofType)){let u=o.type.ofType,c=n[u.name];if(r.push(o),c===void 0)i(u);else{let l=r.slice(c),f=l.map(d=>d.name).join(".");e.reportError(`Cannot reference Input Object "${u.name}" within itself through a series of non-null fields: "${f}".`,l.map(d=>d.astNode))}r.pop()}n[s.name]=void 0}}function on(e,t){let{astNode:r,extensionASTNodes:n}=e;return(r!=null?[r,...n]:n).flatMap(s=>{var a;return(a=s.interfaces)!==null&&a!==void 0?a:[]}).filter(s=>s.name.value===t.name)}function $c(e,t){let{astNode:r,extensionASTNodes:n}=e;return(r!=null?[r,...n]:n).flatMap(s=>{var a;return(a=s.types)!==null&&a!==void 0?a:[]}).filter(s=>s.name.value===t)}function ia(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(r=>r.name.value===Bc.GraphQLDeprecatedDirective.name)}});var ht=h(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.typeFromAST=aa;var sa=H(),Jc=Y();function aa(e,t){switch(t.kind){case sa.Kind.LIST_TYPE:{let r=aa(e,t.type);return r&&new Jc.GraphQLList(r)}case sa.Kind.NON_NULL_TYPE:{let r=aa(e,t.type);return r&&new Jc.GraphQLNonNull(r)}case sa.Kind.NAMED_TYPE:return e.getType(t.name.value)}}});var vi=h(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.TypeInfo=void 0;cn.visitWithTypeInfo=Zy;var zy=dt(),de=H(),Xc=Yt(),fe=Y(),_r=Ye(),Hc=ht(),ua=class{constructor(t,r,n){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??Wy,r&&((0,fe.isInputType)(r)&&this._inputTypeStack.push(r),(0,fe.isCompositeType)(r)&&this._parentTypeStack.push(r),(0,fe.isOutputType)(r)&&this._typeStack.push(r))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let r=this._schema;switch(t.kind){case de.Kind.SELECTION_SET:{let i=(0,fe.getNamedType)(this.getType());this._parentTypeStack.push((0,fe.isCompositeType)(i)?i:void 0);break}case de.Kind.FIELD:{let i=this.getParentType(),s,a;i&&(s=this._getFieldDef(r,i,t),s&&(a=s.type)),this._fieldDefStack.push(s),this._typeStack.push((0,fe.isOutputType)(a)?a:void 0);break}case de.Kind.DIRECTIVE:this._directive=r.getDirective(t.name.value);break;case de.Kind.OPERATION_DEFINITION:{let i=r.getRootType(t.operation);this._typeStack.push((0,fe.isObjectType)(i)?i:void 0);break}case de.Kind.INLINE_FRAGMENT:case de.Kind.FRAGMENT_DEFINITION:{let i=t.typeCondition,s=i?(0,Hc.typeFromAST)(r,i):(0,fe.getNamedType)(this.getType());this._typeStack.push((0,fe.isOutputType)(s)?s:void 0);break}case de.Kind.VARIABLE_DEFINITION:{let i=(0,Hc.typeFromAST)(r,t.type);this._inputTypeStack.push((0,fe.isInputType)(i)?i:void 0);break}case de.Kind.ARGUMENT:{var n;let i,s,a=(n=this.getDirective())!==null&&n!==void 0?n:this.getFieldDef();a&&(i=a.args.find(o=>o.name===t.name.value),i&&(s=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push((0,fe.isInputType)(s)?s:void 0);break}case de.Kind.LIST:{let i=(0,fe.getNullableType)(this.getInputType()),s=(0,fe.isListType)(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,fe.isInputType)(s)?s:void 0);break}case de.Kind.OBJECT_FIELD:{let i=(0,fe.getNamedType)(this.getInputType()),s,a;(0,fe.isInputObjectType)(i)&&(a=i.getFields()[t.name.value],a&&(s=a.type)),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push((0,fe.isInputType)(s)?s:void 0);break}case de.Kind.ENUM:{let i=(0,fe.getNamedType)(this.getInputType()),s;(0,fe.isEnumType)(i)&&(s=i.getValue(t.value)),this._enumValue=s;break}default:}}leave(t){switch(t.kind){case de.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case de.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case de.Kind.DIRECTIVE:this._directive=null;break;case de.Kind.OPERATION_DEFINITION:case de.Kind.INLINE_FRAGMENT:case de.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case de.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case de.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case de.Kind.LIST:case de.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case de.Kind.ENUM:this._enumValue=null;break;default:}}};cn.TypeInfo=ua;function Wy(e,t,r){let n=r.name.value;if(n===_r.SchemaMetaFieldDef.name&&e.getQueryType()===t)return _r.SchemaMetaFieldDef;if(n===_r.TypeMetaFieldDef.name&&e.getQueryType()===t)return _r.TypeMetaFieldDef;if(n===_r.TypeNameMetaFieldDef.name&&(0,fe.isCompositeType)(t))return _r.TypeNameMetaFieldDef;if((0,fe.isObjectType)(t)||(0,fe.isInterfaceType)(t))return t.getFields()[n]}function Zy(e,t){return{enter(...r){let n=r[0];e.enter(n);let i=(0,Xc.getEnterLeaveForKind)(t,n.kind).enter;if(i){let s=i.apply(t,r);return s!==void 0&&(e.leave(n),(0,zy.isNode)(s)&&e.enter(s)),s}},leave(...r){let n=r[0],i=(0,Xc.getEnterLeaveForKind)(t,n.kind).leave,s;return i&&(s=i.apply(t,r)),e.leave(n),s}}}});var tr=h(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.isConstValueNode=ca;Je.isDefinitionNode=eh;Je.isExecutableDefinitionNode=zc;Je.isSelectionNode=th;Je.isTypeDefinitionNode=el;Je.isTypeExtensionNode=rl;Je.isTypeNode=rh;Je.isTypeSystemDefinitionNode=Zc;Je.isTypeSystemExtensionNode=tl;Je.isValueNode=Wc;var J=H();function eh(e){return zc(e)||Zc(e)||tl(e)}function zc(e){return e.kind===J.Kind.OPERATION_DEFINITION||e.kind===J.Kind.FRAGMENT_DEFINITION}function th(e){return e.kind===J.Kind.FIELD||e.kind===J.Kind.FRAGMENT_SPREAD||e.kind===J.Kind.INLINE_FRAGMENT}function Wc(e){return e.kind===J.Kind.VARIABLE||e.kind===J.Kind.INT||e.kind===J.Kind.FLOAT||e.kind===J.Kind.STRING||e.kind===J.Kind.BOOLEAN||e.kind===J.Kind.NULL||e.kind===J.Kind.ENUM||e.kind===J.Kind.LIST||e.kind===J.Kind.OBJECT}function ca(e){return Wc(e)&&(e.kind===J.Kind.LIST?e.values.some(ca):e.kind===J.Kind.OBJECT?e.fields.some(t=>ca(t.value)):e.kind!==J.Kind.VARIABLE)}function rh(e){return e.kind===J.Kind.NAMED_TYPE||e.kind===J.Kind.LIST_TYPE||e.kind===J.Kind.NON_NULL_TYPE}function Zc(e){return e.kind===J.Kind.SCHEMA_DEFINITION||el(e)||e.kind===J.Kind.DIRECTIVE_DEFINITION}function el(e){return e.kind===J.Kind.SCALAR_TYPE_DEFINITION||e.kind===J.Kind.OBJECT_TYPE_DEFINITION||e.kind===J.Kind.INTERFACE_TYPE_DEFINITION||e.kind===J.Kind.UNION_TYPE_DEFINITION||e.kind===J.Kind.ENUM_TYPE_DEFINITION||e.kind===J.Kind.INPUT_OBJECT_TYPE_DEFINITION}function tl(e){return e.kind===J.Kind.SCHEMA_EXTENSION||rl(e)}function rl(e){return e.kind===J.Kind.SCALAR_TYPE_EXTENSION||e.kind===J.Kind.OBJECT_TYPE_EXTENSION||e.kind===J.Kind.INTERFACE_TYPE_EXTENSION||e.kind===J.Kind.UNION_TYPE_EXTENSION||e.kind===J.Kind.ENUM_TYPE_EXTENSION||e.kind===J.Kind.INPUT_OBJECT_TYPE_EXTENSION}});var pa=h(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.ExecutableDefinitionsRule=sh;var nh=q(),nl=H(),ih=tr();function sh(e){return{Document(t){for(let r of t.definitions)if(!(0,ih.isExecutableDefinitionNode)(r)){let n=r.kind===nl.Kind.SCHEMA_DEFINITION||r.kind===nl.Kind.SCHEMA_EXTENSION?"schema":'"'+r.name.value+'"';e.reportError(new nh.GraphQLError(`The ${n} definition is not executable.`,{nodes:r}))}return!1}}}});var fa=h(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.FieldsOnCorrectTypeRule=ch;var il=wt(),ah=$r(),oh=kt(),uh=q(),ln=Y();function ch(e){return{Field(t){let r=e.getParentType();if(r&&!e.getFieldDef()){let i=e.getSchema(),s=t.name.value,a=(0,il.didYouMean)("to use an inline fragment on",lh(i,r,s));a===""&&(a=(0,il.didYouMean)(ph(r,s))),e.reportError(new uh.GraphQLError(`Cannot query field "${s}" on type "${r.name}".`+a,{nodes:t}))}}}}function lh(e,t,r){if(!(0,ln.isAbstractType)(t))return[];let n=new Set,i=Object.create(null);for(let a of e.getPossibleTypes(t))if(a.getFields()[r]){n.add(a),i[a.name]=1;for(let o of a.getInterfaces()){var s;o.getFields()[r]&&(n.add(o),i[o.name]=((s=i[o.name])!==null&&s!==void 0?s:0)+1)}}return[...n].sort((a,o)=>{let u=i[o.name]-i[a.name];return u!==0?u:(0,ln.isInterfaceType)(a)&&e.isSubType(a,o)?-1:(0,ln.isInterfaceType)(o)&&e.isSubType(o,a)?1:(0,ah.naturalCompare)(a.name,o.name)}).map(a=>a.name)}function ph(e,t){if((0,ln.isObjectType)(e)||(0,ln.isInterfaceType)(e)){let r=Object.keys(e.getFields());return(0,oh.suggestionList)(t,r)}return[]}});var ya=h(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.FragmentsOnCompositeTypesRule=dh;var sl=q(),al=Ce(),ol=Y(),ul=ht();function dh(e){return{InlineFragment(t){let r=t.typeCondition;if(r){let n=(0,ul.typeFromAST)(e.getSchema(),r);if(n&&!(0,ol.isCompositeType)(n)){let i=(0,al.print)(r);e.reportError(new sl.GraphQLError(`Fragment cannot condition on non composite type "${i}".`,{nodes:r}))}}},FragmentDefinition(t){let r=(0,ul.typeFromAST)(e.getSchema(),t.typeCondition);if(r&&!(0,ol.isCompositeType)(r)){let n=(0,al.print)(t.typeCondition);e.reportError(new sl.GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}}});var ha=h(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.KnownArgumentNamesOnDirectivesRule=dl;Ti.KnownArgumentNamesRule=yh;var cl=wt(),ll=kt(),pl=q(),fh=H(),mh=Ve();function yh(e){return{...dl(e),Argument(t){let r=e.getArgument(),n=e.getFieldDef(),i=e.getParentType();if(!r&&n&&i){let s=t.name.value,a=n.args.map(u=>u.name),o=(0,ll.suggestionList)(s,a);e.reportError(new pl.GraphQLError(`Unknown argument "${s}" on field "${i.name}.${n.name}".`+(0,cl.didYouMean)(o),{nodes:t}))}}}}function dl(e){let t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():mh.specifiedDirectives;for(let a of n)t[a.name]=a.args.map(o=>o.name);let i=e.getDocument().definitions;for(let a of i)if(a.kind===fh.Kind.DIRECTIVE_DEFINITION){var s;let o=(s=a.arguments)!==null&&s!==void 0?s:[];t[a.name.value]=o.map(u=>u.name.value)}return{Directive(a){let o=a.name.value,u=t[o];if(a.arguments&&u)for(let c of a.arguments){let l=c.name.value;if(!u.includes(l)){let f=(0,ll.suggestionList)(l,u);e.reportError(new pl.GraphQLError(`Unknown argument "${l}" on directive "@${o}".`+(0,cl.didYouMean)(f),{nodes:c}))}}return!1}}}});var ga=h(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.KnownDirectivesRule=Th;var hh=re(),va=je(),fl=q(),Ta=dt(),Oe=yr(),ue=H(),vh=Ve();function Th(e){let t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():vh.specifiedDirectives;for(let s of n)t[s.name]=s.locations;let i=e.getDocument().definitions;for(let s of i)s.kind===ue.Kind.DIRECTIVE_DEFINITION&&(t[s.name.value]=s.locations.map(a=>a.value));return{Directive(s,a,o,u,c){let l=s.name.value,f=t[l];if(!f){e.reportError(new fl.GraphQLError(`Unknown directive "@${l}".`,{nodes:s}));return}let d=bh(c);d&&!f.includes(d)&&e.reportError(new fl.GraphQLError(`Directive "@${l}" may not be used on ${d}.`,{nodes:s}))}}}function bh(e){let t=e[e.length-1];switch("kind"in t||(0,va.invariant)(!1),t.kind){case ue.Kind.OPERATION_DEFINITION:return gh(t.operation);case ue.Kind.FIELD:return Oe.DirectiveLocation.FIELD;case ue.Kind.FRAGMENT_SPREAD:return Oe.DirectiveLocation.FRAGMENT_SPREAD;case ue.Kind.INLINE_FRAGMENT:return Oe.DirectiveLocation.INLINE_FRAGMENT;case ue.Kind.FRAGMENT_DEFINITION:return Oe.DirectiveLocation.FRAGMENT_DEFINITION;case ue.Kind.VARIABLE_DEFINITION:return Oe.DirectiveLocation.VARIABLE_DEFINITION;case ue.Kind.SCHEMA_DEFINITION:case ue.Kind.SCHEMA_EXTENSION:return Oe.DirectiveLocation.SCHEMA;case ue.Kind.SCALAR_TYPE_DEFINITION:case ue.Kind.SCALAR_TYPE_EXTENSION:return Oe.DirectiveLocation.SCALAR;case ue.Kind.OBJECT_TYPE_DEFINITION:case ue.Kind.OBJECT_TYPE_EXTENSION:return Oe.DirectiveLocation.OBJECT;case ue.Kind.FIELD_DEFINITION:return Oe.DirectiveLocation.FIELD_DEFINITION;case ue.Kind.INTERFACE_TYPE_DEFINITION:case ue.Kind.INTERFACE_TYPE_EXTENSION:return Oe.DirectiveLocation.INTERFACE;case ue.Kind.UNION_TYPE_DEFINITION:case ue.Kind.UNION_TYPE_EXTENSION:return Oe.DirectiveLocation.UNION;case ue.Kind.ENUM_TYPE_DEFINITION:case ue.Kind.ENUM_TYPE_EXTENSION:return Oe.DirectiveLocation.ENUM;case ue.Kind.ENUM_VALUE_DEFINITION:return Oe.DirectiveLocation.ENUM_VALUE;case ue.Kind.INPUT_OBJECT_TYPE_DEFINITION:case ue.Kind.INPUT_OBJECT_TYPE_EXTENSION:return Oe.DirectiveLocation.INPUT_OBJECT;case ue.Kind.INPUT_VALUE_DEFINITION:{let r=e[e.length-3];return"kind"in r||(0,va.invariant)(!1),r.kind===ue.Kind.INPUT_OBJECT_TYPE_DEFINITION?Oe.DirectiveLocation.INPUT_FIELD_DEFINITION:Oe.DirectiveLocation.ARGUMENT_DEFINITION}default:(0,va.invariant)(!1,"Unexpected kind: "+(0,hh.inspect)(t.kind))}}function gh(e){switch(e){case Ta.OperationTypeNode.QUERY:return Oe.DirectiveLocation.QUERY;case Ta.OperationTypeNode.MUTATION:return Oe.DirectiveLocation.MUTATION;case Ta.OperationTypeNode.SUBSCRIPTION:return Oe.DirectiveLocation.SUBSCRIPTION}}});var _a=h(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.KnownFragmentNamesRule=_h;var Eh=q();function _h(e){return{FragmentSpread(t){let r=t.name.value;e.getFragment(r)||e.reportError(new Eh.GraphQLError(`Unknown fragment "${r}".`,{nodes:t.name}))}}}});var Ia=h(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.KnownTypeNamesRule=Dh;var Nh=wt(),Oh=kt(),Ih=q(),Na=tr(),Lh=Ye(),Sh=yt();function Dh(e){let t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);for(let s of e.getDocument().definitions)(0,Na.isTypeDefinitionNode)(s)&&(n[s.name.value]=!0);let i=[...Object.keys(r),...Object.keys(n)];return{NamedType(s,a,o,u,c){let l=s.name.value;if(!r[l]&&!n[l]){var f;let d=(f=c[2])!==null&&f!==void 0?f:o,y=d!=null&&Ah(d);if(y&&ml.includes(l))return;let T=(0,Oh.suggestionList)(l,y?ml.concat(i):i);e.reportError(new Ih.GraphQLError(`Unknown type "${l}".`+(0,Nh.didYouMean)(T),{nodes:s}))}}}}var ml=[...Sh.specifiedScalarTypes,...Lh.introspectionTypes].map(e=>e.name);function Ah(e){return"kind"in e&&((0,Na.isTypeSystemDefinitionNode)(e)||(0,Na.isTypeSystemExtensionNode)(e))}});var Sa=h(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.LoneAnonymousOperationRule=Ph;var Rh=q(),jh=H();function Ph(e){let t=0;return{Document(r){t=r.definitions.filter(n=>n.kind===jh.Kind.OPERATION_DEFINITION).length},OperationDefinition(r){!r.name&&t>1&&e.reportError(new Rh.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:r}))}}}});var Aa=h(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.LoneSchemaDefinitionRule=wh;var yl=q();function wh(e){var t,r,n;let i=e.getSchema(),s=(t=(r=(n=i?.astNode)!==null&&n!==void 0?n:i?.getQueryType())!==null&&r!==void 0?r:i?.getMutationType())!==null&&t!==void 0?t:i?.getSubscriptionType(),a=0;return{SchemaDefinition(o){if(s){e.reportError(new yl.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:o}));return}a>0&&e.reportError(new yl.GraphQLError("Must provide only one schema definition.",{nodes:o})),++a}}}});var ja=h(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.NoFragmentCyclesRule=kh;var Fh=q();function kh(e){let t=Object.create(null),r=[],n=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(t[s.name.value])return;let a=s.name.value;t[a]=!0;let o=e.getFragmentSpreads(s.selectionSet);if(o.length!==0){n[a]=r.length;for(let u of o){let c=u.name.value,l=n[c];if(r.push(u),l===void 0){let f=e.getFragment(c);f&&i(f)}else{let f=r.slice(l),d=f.slice(0,-1).map(y=>'"'+y.name.value+'"').join(", ");e.reportError(new Fh.GraphQLError(`Cannot spread fragment "${c}" within itself`+(d!==""?` via ${d}.`:"."),{nodes:f}))}r.pop()}n[a]=void 0}}}});var wa=h(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.NoUndefinedVariablesRule=xh;var qh=q();function xh(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(r){let n=e.getRecursiveVariableUsages(r);for(let{node:i}of n){let s=i.name.value;t[s]!==!0&&e.reportError(new qh.GraphQLError(r.name?`Variable "$${s}" is not defined by operation "${r.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,r]}))}}},VariableDefinition(r){t[r.variable.name.value]=!0}}}});var ka=h(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.NoUnusedFragmentsRule=Mh;var Vh=q();function Mh(e){let t=[],r=[];return{OperationDefinition(n){return t.push(n),!1},FragmentDefinition(n){return r.push(n),!1},Document:{leave(){let n=Object.create(null);for(let i of t)for(let s of e.getRecursivelyReferencedFragments(i))n[s.name.value]=!0;for(let i of r){let s=i.name.value;n[s]!==!0&&e.reportError(new Vh.GraphQLError(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}});var xa=h(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.NoUnusedVariablesRule=Ch;var Gh=q();function Ch(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(r){let n=Object.create(null),i=e.getRecursiveVariableUsages(r);for(let{node:s}of i)n[s.name.value]=!0;for(let s of t){let a=s.variable.name.value;n[a]!==!0&&e.reportError(new Gh.GraphQLError(r.name?`Variable "$${a}" is never used in operation "${r.name.value}".`:`Variable "$${a}" is never used.`,{nodes:s}))}}},VariableDefinition(r){t.push(r)}}}});var Ga=h(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.sortValueNode=Va;var Qh=$r(),It=H();function Va(e){switch(e.kind){case It.Kind.OBJECT:return{...e,fields:Uh(e.fields)};case It.Kind.LIST:return{...e,values:e.values.map(Va)};case It.Kind.INT:case It.Kind.FLOAT:case It.Kind.STRING:case It.Kind.BOOLEAN:case It.Kind.NULL:case It.Kind.ENUM:case It.Kind.VARIABLE:return e}}function Uh(e){return e.map(t=>({...t,value:Va(t.value)})).sort((t,r)=>(0,Qh.naturalCompare)(t.name.value,r.name.value))}});var Ya=h(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.OverlappingFieldsCanBeMergedRule=Yh;var hl=re(),Kh=q(),Ca=H(),$h=Ce(),Me=Y(),Bh=Ga(),Tl=ht();function bl(e){return Array.isArray(e)?e.map(([t,r])=>`subfields "${t}" conflict because `+bl(r)).join(" and "):e}function Yh(e){let t=new Ka,r=new Map;return{SelectionSet(n){let i=Jh(e,r,t,e.getParentType(),n);for(let[[s,a],o,u]of i){let c=bl(a);e.reportError(new Kh.GraphQLError(`Fields "${s}" conflict because ${c}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:o.concat(u)}))}}}}function Jh(e,t,r,n,i){let s=[],[a,o]=Ei(e,t,n,i);if(Hh(e,s,t,r,a),o.length!==0)for(let u=0;u1)for(let o=0;o[s.value,a]));return r.every(s=>{let a=s.value,o=i.get(s.name.value);return o===void 0?!1:vl(a)===vl(o)})}function vl(e){return(0,$h.print)((0,Bh.sortValueNode)(e))}function Qa(e,t){return(0,Me.isListType)(e)?(0,Me.isListType)(t)?Qa(e.ofType,t.ofType):!0:(0,Me.isListType)(t)?!0:(0,Me.isNonNullType)(e)?(0,Me.isNonNullType)(t)?Qa(e.ofType,t.ofType):!0:(0,Me.isNonNullType)(t)?!0:(0,Me.isLeafType)(e)||(0,Me.isLeafType)(t)?e!==t:!1}function Ei(e,t,r,n){let i=t.get(n);if(i)return i;let s=Object.create(null),a=Object.create(null);El(e,r,n,s,a);let o=[s,Object.keys(a)];return t.set(n,o),o}function Ua(e,t,r){let n=t.get(r.selectionSet);if(n)return n;let i=(0,Tl.typeFromAST)(e.getSchema(),r.typeCondition);return Ei(e,t,i,r.selectionSet)}function El(e,t,r,n,i){for(let s of r.selections)switch(s.kind){case Ca.Kind.FIELD:{let a=s.name.value,o;((0,Me.isObjectType)(t)||(0,Me.isInterfaceType)(t))&&(o=t.getFields()[a]);let u=s.alias?s.alias.value:a;n[u]||(n[u]=[]),n[u].push([t,s,o]);break}case Ca.Kind.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case Ca.Kind.INLINE_FRAGMENT:{let a=s.typeCondition,o=a?(0,Tl.typeFromAST)(e.getSchema(),a):t;El(e,o,s.selectionSet,n,i);break}}}function Wh(e,t,r,n){if(e.length>0)return[[t,e.map(([i])=>i)],[r,...e.map(([,i])=>i).flat()],[n,...e.map(([,,i])=>i).flat()]]}var Ka=class{constructor(){this._data=new Map}has(t,r,n){var i;let[s,a]=t{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.PossibleFragmentSpreadsRule=ev;var _i=re(),_l=q(),Ja=Y(),Nl=zr(),Zh=ht();function ev(e){return{InlineFragment(t){let r=e.getType(),n=e.getParentType();if((0,Ja.isCompositeType)(r)&&(0,Ja.isCompositeType)(n)&&!(0,Nl.doTypesOverlap)(e.getSchema(),r,n)){let i=(0,_i.inspect)(n),s=(0,_i.inspect)(r);e.reportError(new _l.GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:t}))}},FragmentSpread(t){let r=t.name.value,n=tv(e,r),i=e.getParentType();if(n&&i&&!(0,Nl.doTypesOverlap)(e.getSchema(),n,i)){let s=(0,_i.inspect)(i),a=(0,_i.inspect)(n);e.reportError(new _l.GraphQLError(`Fragment "${r}" cannot be spread here as objects of type "${s}" can never be of type "${a}".`,{nodes:t}))}}}}function tv(e,t){let r=e.getFragment(t);if(r){let n=(0,Zh.typeFromAST)(e.getSchema(),r.typeCondition);if((0,Ja.isCompositeType)(n))return n}}});var Wa=h(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.PossibleTypeExtensionsRule=sv;var rv=wt(),Il=re(),Ll=je(),nv=kt(),Ol=q(),le=H(),iv=tr(),Nr=Y();function sv(e){let t=e.getSchema(),r=Object.create(null);for(let i of e.getDocument().definitions)(0,iv.isTypeDefinitionNode)(i)&&(r[i.name.value]=i);return{ScalarTypeExtension:n,ObjectTypeExtension:n,InterfaceTypeExtension:n,UnionTypeExtension:n,EnumTypeExtension:n,InputObjectTypeExtension:n};function n(i){let s=i.name.value,a=r[s],o=t?.getType(s),u;if(a?u=av[a.kind]:o&&(u=ov(o)),u){if(u!==i.kind){let c=uv(i.kind);e.reportError(new Ol.GraphQLError(`Cannot extend non-${c} type "${s}".`,{nodes:a?[a,i]:i}))}}else{let c=Object.keys({...r,...t?.getTypeMap()}),l=(0,nv.suggestionList)(s,c);e.reportError(new Ol.GraphQLError(`Cannot extend type "${s}" because it is not defined.`+(0,rv.didYouMean)(l),{nodes:i.name}))}}}var av={[le.Kind.SCALAR_TYPE_DEFINITION]:le.Kind.SCALAR_TYPE_EXTENSION,[le.Kind.OBJECT_TYPE_DEFINITION]:le.Kind.OBJECT_TYPE_EXTENSION,[le.Kind.INTERFACE_TYPE_DEFINITION]:le.Kind.INTERFACE_TYPE_EXTENSION,[le.Kind.UNION_TYPE_DEFINITION]:le.Kind.UNION_TYPE_EXTENSION,[le.Kind.ENUM_TYPE_DEFINITION]:le.Kind.ENUM_TYPE_EXTENSION,[le.Kind.INPUT_OBJECT_TYPE_DEFINITION]:le.Kind.INPUT_OBJECT_TYPE_EXTENSION};function ov(e){if((0,Nr.isScalarType)(e))return le.Kind.SCALAR_TYPE_EXTENSION;if((0,Nr.isObjectType)(e))return le.Kind.OBJECT_TYPE_EXTENSION;if((0,Nr.isInterfaceType)(e))return le.Kind.INTERFACE_TYPE_EXTENSION;if((0,Nr.isUnionType)(e))return le.Kind.UNION_TYPE_EXTENSION;if((0,Nr.isEnumType)(e))return le.Kind.ENUM_TYPE_EXTENSION;if((0,Nr.isInputObjectType)(e))return le.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,Ll.invariant)(!1,"Unexpected type: "+(0,Il.inspect)(e))}function uv(e){switch(e){case le.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case le.Kind.OBJECT_TYPE_EXTENSION:return"object";case le.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case le.Kind.UNION_TYPE_EXTENSION:return"union";case le.Kind.ENUM_TYPE_EXTENSION:return"enum";case le.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,Ll.invariant)(!1,"Unexpected kind: "+(0,Il.inspect)(e))}}});var eo=h(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.ProvidedRequiredArgumentsOnDirectivesRule=jl;Ni.ProvidedRequiredArgumentsRule=pv;var Dl=re(),Sl=Ft(),Al=q(),Rl=H(),cv=Ce(),Za=Y(),lv=Ve();function pv(e){return{...jl(e),Field:{leave(t){var r;let n=e.getFieldDef();if(!n)return!1;let i=new Set((r=t.arguments)===null||r===void 0?void 0:r.map(s=>s.name.value));for(let s of n.args)if(!i.has(s.name)&&(0,Za.isRequiredArgument)(s)){let a=(0,Dl.inspect)(s.type);e.reportError(new Al.GraphQLError(`Field "${n.name}" argument "${s.name}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function jl(e){var t;let r=Object.create(null),n=e.getSchema(),i=(t=n?.getDirectives())!==null&&t!==void 0?t:lv.specifiedDirectives;for(let o of i)r[o.name]=(0,Sl.keyMap)(o.args.filter(Za.isRequiredArgument),u=>u.name);let s=e.getDocument().definitions;for(let o of s)if(o.kind===Rl.Kind.DIRECTIVE_DEFINITION){var a;let u=(a=o.arguments)!==null&&a!==void 0?a:[];r[o.name.value]=(0,Sl.keyMap)(u.filter(dv),c=>c.name.value)}return{Directive:{leave(o){let u=o.name.value,c=r[u];if(c){var l;let f=(l=o.arguments)!==null&&l!==void 0?l:[],d=new Set(f.map(y=>y.name.value));for(let[y,T]of Object.entries(c))if(!d.has(y)){let I=(0,Za.isType)(T.type)?(0,Dl.inspect)(T.type):(0,cv.print)(T.type);e.reportError(new Al.GraphQLError(`Directive "@${u}" argument "${y}" of type "${I}" is required, but it was not provided.`,{nodes:o}))}}}}}}function dv(e){return e.type.kind===Rl.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var ro=h(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.ScalarLeafsRule=fv;var Pl=re(),wl=q(),Fl=Y();function fv(e){return{Field(t){let r=e.getType(),n=t.selectionSet;if(r){if((0,Fl.isLeafType)((0,Fl.getNamedType)(r))){if(n){let i=t.name.value,s=(0,Pl.inspect)(r);e.reportError(new wl.GraphQLError(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:n}))}}else if(!n){let i=t.name.value,s=(0,Pl.inspect)(r);e.reportError(new wl.GraphQLError(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}}});var io=h(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.printPathArray=mv;function mv(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}});var pn=h(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.addPath=yv;Oi.pathToArray=hv;function yv(e,t,r){return{prev:e,key:t,typename:r}}function hv(e){let t=[],r=e;for(;r;)t.push(r.key),r=r.prev;return t.reverse()}});var ao=h(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.coerceInputValue=Nv;var vv=wt(),Ii=re(),Tv=je(),bv=fi(),gv=pt(),Lt=pn(),Ev=io(),_v=kt(),rr=q(),dn=Y();function Nv(e,t,r=Ov){return fn(e,t,r,void 0)}function Ov(e,t,r){let n="Invalid value "+(0,Ii.inspect)(t);throw e.length>0&&(n+=` at "value${(0,Ev.printPathArray)(e)}"`),r.message=n+": "+r.message,r}function fn(e,t,r,n){if((0,dn.isNonNullType)(t)){if(e!=null)return fn(e,t.ofType,r,n);r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Expected non-nullable type "${(0,Ii.inspect)(t)}" not to be null.`));return}if(e==null)return null;if((0,dn.isListType)(t)){let i=t.ofType;return(0,bv.isIterableObject)(e)?Array.from(e,(s,a)=>{let o=(0,Lt.addPath)(n,a,void 0);return fn(s,i,r,o)}):[fn(e,i,r,n)]}if((0,dn.isInputObjectType)(t)){if(!(0,gv.isObjectLike)(e)){r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Expected type "${t.name}" to be an object.`));return}let i={},s=t.getFields();for(let a of Object.values(s)){let o=e[a.name];if(o===void 0){if(a.defaultValue!==void 0)i[a.name]=a.defaultValue;else if((0,dn.isNonNullType)(a.type)){let u=(0,Ii.inspect)(a.type);r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Field "${a.name}" of required type "${u}" was not provided.`))}continue}i[a.name]=fn(o,a.type,r,(0,Lt.addPath)(n,a.name,t.name))}for(let a of Object.keys(e))if(!s[a]){let o=(0,_v.suggestionList)(a,Object.keys(t.getFields()));r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Field "${a}" is not defined by type "${t.name}".`+(0,vv.didYouMean)(o)))}return i}if((0,dn.isLeafType)(t)){let i;try{i=t.parseValue(e)}catch(s){s instanceof rr.GraphQLError?r((0,Lt.pathToArray)(n),e,s):r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Expected type "${t.name}". `+s.message,{originalError:s}));return}return i===void 0&&r((0,Lt.pathToArray)(n),e,new rr.GraphQLError(`Expected type "${t.name}".`)),i}(0,Tv.invariant)(!1,"Unexpected input type: "+(0,Ii.inspect)(t))}});var yn=h(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.valueFromAST=mn;var Iv=re(),Lv=je(),Sv=Ft(),Or=H(),nr=Y();function mn(e,t,r){if(e){if(e.kind===Or.Kind.VARIABLE){let n=e.name.value;if(r==null||r[n]===void 0)return;let i=r[n];return i===null&&(0,nr.isNonNullType)(t)?void 0:i}if((0,nr.isNonNullType)(t))return e.kind===Or.Kind.NULL?void 0:mn(e,t.ofType,r);if(e.kind===Or.Kind.NULL)return null;if((0,nr.isListType)(t)){let n=t.ofType;if(e.kind===Or.Kind.LIST){let s=[];for(let a of e.values)if(kl(a,r)){if((0,nr.isNonNullType)(n))return;s.push(null)}else{let o=mn(a,n,r);if(o===void 0)return;s.push(o)}return s}let i=mn(e,n,r);return i===void 0?void 0:[i]}if((0,nr.isInputObjectType)(t)){if(e.kind!==Or.Kind.OBJECT)return;let n=Object.create(null),i=(0,Sv.keyMap)(e.fields,s=>s.name.value);for(let s of Object.values(t.getFields())){let a=i[s.name];if(!a||kl(a.value,r)){if(s.defaultValue!==void 0)n[s.name]=s.defaultValue;else if((0,nr.isNonNullType)(s.type))return;continue}let o=mn(a.value,s.type,r);if(o===void 0)return;n[s.name]=o}return n}if((0,nr.isLeafType)(t)){let n;try{n=t.parseLiteral(e,r)}catch{return}return n===void 0?void 0:n}(0,Lv.invariant)(!1,"Unexpected input type: "+(0,Iv.inspect)(t))}}function kl(e,t){return e.kind===Or.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var Sr=h(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.getArgumentValues=Ml;hn.getDirectiveValues=Fv;hn.getVariableValues=Pv;var Ir=re(),Dv=Ft(),Av=io(),St=q(),ql=H(),xl=Ce(),Lr=Y(),Rv=ao(),jv=ht(),Vl=yn();function Pv(e,t,r,n){let i=[],s=n?.maxErrors;try{let a=wv(e,t,r,o=>{if(s!=null&&i.length>=s)throw new St.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(o)});if(i.length===0)return{coerced:a}}catch(a){i.push(a)}return{errors:i}}function wv(e,t,r,n){let i={};for(let s of t){let a=s.variable.name.value,o=(0,jv.typeFromAST)(e,s.type);if(!(0,Lr.isInputType)(o)){let c=(0,xl.print)(s.type);n(new St.GraphQLError(`Variable "$${a}" expected value of type "${c}" which cannot be used as an input type.`,{nodes:s.type}));continue}if(!Gl(r,a)){if(s.defaultValue)i[a]=(0,Vl.valueFromAST)(s.defaultValue,o);else if((0,Lr.isNonNullType)(o)){let c=(0,Ir.inspect)(o);n(new St.GraphQLError(`Variable "$${a}" of required type "${c}" was not provided.`,{nodes:s}))}continue}let u=r[a];if(u===null&&(0,Lr.isNonNullType)(o)){let c=(0,Ir.inspect)(o);n(new St.GraphQLError(`Variable "$${a}" of non-null type "${c}" must not be null.`,{nodes:s}));continue}i[a]=(0,Rv.coerceInputValue)(u,o,(c,l,f)=>{let d=`Variable "$${a}" got invalid value `+(0,Ir.inspect)(l);c.length>0&&(d+=` at "${a}${(0,Av.printPathArray)(c)}"`),n(new St.GraphQLError(d+"; "+f.message,{nodes:s,originalError:f}))})}return i}function Ml(e,t,r){var n;let i={},s=(n=t.arguments)!==null&&n!==void 0?n:[],a=(0,Dv.keyMap)(s,o=>o.name.value);for(let o of e.args){let u=o.name,c=o.type,l=a[u];if(!l){if(o.defaultValue!==void 0)i[u]=o.defaultValue;else if((0,Lr.isNonNullType)(c))throw new St.GraphQLError(`Argument "${u}" of required type "${(0,Ir.inspect)(c)}" was not provided.`,{nodes:t});continue}let f=l.value,d=f.kind===ql.Kind.NULL;if(f.kind===ql.Kind.VARIABLE){let T=f.name.value;if(r==null||!Gl(r,T)){if(o.defaultValue!==void 0)i[u]=o.defaultValue;else if((0,Lr.isNonNullType)(c))throw new St.GraphQLError(`Argument "${u}" of required type "${(0,Ir.inspect)(c)}" was provided the variable "$${T}" which was not provided a runtime value.`,{nodes:f});continue}d=r[T]==null}if(d&&(0,Lr.isNonNullType)(c))throw new St.GraphQLError(`Argument "${u}" of non-null type "${(0,Ir.inspect)(c)}" must not be null.`,{nodes:f});let y=(0,Vl.valueFromAST)(f,c,r);if(y===void 0)throw new St.GraphQLError(`Argument "${u}" has invalid value ${(0,xl.print)(f)}.`,{nodes:f});i[u]=y}return i}function Fv(e,t,r){var n;let i=(n=t.directives)===null||n===void 0?void 0:n.find(s=>s.name.value===e.name);if(i)return Ml(e,i,r)}function Gl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var Di=h(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.collectFields=xv;Si.collectSubfields=Vv;var uo=H(),kv=Y(),Cl=Ve(),qv=ht(),Ql=Sr();function xv(e,t,r,n,i){let s=new Map;return Li(e,t,r,n,i,s,new Set),s}function Vv(e,t,r,n,i){let s=new Map,a=new Set;for(let o of i)o.selectionSet&&Li(e,t,r,n,o.selectionSet,s,a);return s}function Li(e,t,r,n,i,s,a){for(let o of i.selections)switch(o.kind){case uo.Kind.FIELD:{if(!co(r,o))continue;let u=Mv(o),c=s.get(u);c!==void 0?c.push(o):s.set(u,[o]);break}case uo.Kind.INLINE_FRAGMENT:{if(!co(r,o)||!Ul(e,o,n))continue;Li(e,t,r,n,o.selectionSet,s,a);break}case uo.Kind.FRAGMENT_SPREAD:{let u=o.name.value;if(a.has(u)||!co(r,o))continue;a.add(u);let c=t[u];if(!c||!Ul(e,c,n))continue;Li(e,t,r,n,c.selectionSet,s,a);break}}}function co(e,t){let r=(0,Ql.getDirectiveValues)(Cl.GraphQLSkipDirective,t,e);if(r?.if===!0)return!1;let n=(0,Ql.getDirectiveValues)(Cl.GraphQLIncludeDirective,t,e);return n?.if!==!1}function Ul(e,t,r){let n=t.typeCondition;if(!n)return!0;let i=(0,qv.typeFromAST)(e,n);return i===r?!0:(0,kv.isAbstractType)(i)?e.isSubType(i,r):!1}function Mv(e){return e.alias?e.alias.value:e.name.value}});var po=h(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.SingleFieldSubscriptionsRule=Qv;var Kl=q(),Gv=H(),Cv=Di();function Qv(e){return{OperationDefinition(t){if(t.operation==="subscription"){let r=e.getSchema(),n=r.getSubscriptionType();if(n){let i=t.name?t.name.value:null,s=Object.create(null),a=e.getDocument(),o=Object.create(null);for(let c of a.definitions)c.kind===Gv.Kind.FRAGMENT_DEFINITION&&(o[c.name.value]=c);let u=(0,Cv.collectFields)(r,o,s,n,t.selectionSet);if(u.size>1){let f=[...u.values()].slice(1).flat();e.reportError(new Kl.GraphQLError(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:f}))}for(let c of u.values())c[0].name.value.startsWith("__")&&e.reportError(new Kl.GraphQLError(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:c}))}}}}}});var Ai=h(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.groupBy=Uv;function Uv(e,t){let r=new Map;for(let n of e){let i=t(n),s=r.get(i);s===void 0?r.set(i,[n]):s.push(n)}return r}});var yo=h(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.UniqueArgumentDefinitionNamesRule=Bv;var Kv=Ai(),$v=q();function Bv(e){return{DirectiveDefinition(n){var i;let s=(i=n.arguments)!==null&&i!==void 0?i:[];return r(`@${n.name.value}`,s)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(n){var i;let s=n.name.value,a=(i=n.fields)!==null&&i!==void 0?i:[];for(let u of a){var o;let c=u.name.value,l=(o=u.arguments)!==null&&o!==void 0?o:[];r(`${s}.${c}`,l)}return!1}function r(n,i){let s=(0,Kv.groupBy)(i,a=>a.name.value);for(let[a,o]of s)o.length>1&&e.reportError(new $v.GraphQLError(`Argument "${n}(${a}:)" can only be defined once.`,{nodes:o.map(u=>u.name)}));return!1}}});var vo=h(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.UniqueArgumentNamesRule=Xv;var Yv=Ai(),Jv=q();function Xv(e){return{Field:t,Directive:t};function t(r){var n;let i=(n=r.arguments)!==null&&n!==void 0?n:[],s=(0,Yv.groupBy)(i,a=>a.name.value);for(let[a,o]of s)o.length>1&&e.reportError(new Jv.GraphQLError(`There can be only one argument named "${a}".`,{nodes:o.map(u=>u.name)}))}}});var bo=h(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.UniqueDirectiveNamesRule=Hv;var $l=q();function Hv(e){let t=Object.create(null),r=e.getSchema();return{DirectiveDefinition(n){let i=n.name.value;if(r!=null&&r.getDirective(i)){e.reportError(new $l.GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:n.name}));return}return t[i]?e.reportError(new $l.GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[t[i],n.name]})):t[i]=n.name,!1}}}});var _o=h(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.UniqueDirectivesPerLocationRule=Zv;var zv=q(),go=H(),Bl=tr(),Wv=Ve();function Zv(e){let t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():Wv.specifiedDirectives;for(let o of n)t[o.name]=!o.isRepeatable;let i=e.getDocument().definitions;for(let o of i)o.kind===go.Kind.DIRECTIVE_DEFINITION&&(t[o.name.value]=!o.repeatable);let s=Object.create(null),a=Object.create(null);return{enter(o){if(!("directives"in o)||!o.directives)return;let u;if(o.kind===go.Kind.SCHEMA_DEFINITION||o.kind===go.Kind.SCHEMA_EXTENSION)u=s;else if((0,Bl.isTypeDefinitionNode)(o)||(0,Bl.isTypeExtensionNode)(o)){let c=o.name.value;u=a[c],u===void 0&&(a[c]=u=Object.create(null))}else u=Object.create(null);for(let c of o.directives){let l=c.name.value;t[l]&&(u[l]?e.reportError(new zv.GraphQLError(`The directive "@${l}" can only be used once at this location.`,{nodes:[u[l],c]})):u[l]=c)}}}}});var Oo=h(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.UniqueEnumValueNamesRule=tT;var Yl=q(),eT=Y();function tT(e){let t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var a;let o=s.name.value;n[o]||(n[o]=Object.create(null));let u=(a=s.values)!==null&&a!==void 0?a:[],c=n[o];for(let l of u){let f=l.name.value,d=r[o];(0,eT.isEnumType)(d)&&d.getValue(f)?e.reportError(new Yl.GraphQLError(`Enum value "${o}.${f}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):c[f]?e.reportError(new Yl.GraphQLError(`Enum value "${o}.${f}" can only be defined once.`,{nodes:[c[f],l.name]})):c[f]=l.name}return!1}}});var So=h(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.UniqueFieldDefinitionNamesRule=rT;var Jl=q(),Io=Y();function rT(e){let t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var a;let o=s.name.value;n[o]||(n[o]=Object.create(null));let u=(a=s.fields)!==null&&a!==void 0?a:[],c=n[o];for(let l of u){let f=l.name.value;nT(r[o],f)?e.reportError(new Jl.GraphQLError(`Field "${o}.${f}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name})):c[f]?e.reportError(new Jl.GraphQLError(`Field "${o}.${f}" can only be defined once.`,{nodes:[c[f],l.name]})):c[f]=l.name}return!1}}function nT(e,t){return(0,Io.isObjectType)(e)||(0,Io.isInterfaceType)(e)||(0,Io.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var Ao=h(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.UniqueFragmentNamesRule=sT;var iT=q();function sT(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(r){let n=r.name.value;return t[n]?e.reportError(new iT.GraphQLError(`There can be only one fragment named "${n}".`,{nodes:[t[n],r.name]})):t[n]=r.name,!1}}}});var jo=h(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.UniqueInputFieldNamesRule=uT;var aT=je(),oT=q();function uT(e){let t=[],r=Object.create(null);return{ObjectValue:{enter(){t.push(r),r=Object.create(null)},leave(){let n=t.pop();n||(0,aT.invariant)(!1),r=n}},ObjectField(n){let i=n.name.value;r[i]?e.reportError(new oT.GraphQLError(`There can be only one input field named "${i}".`,{nodes:[r[i],n.name]})):r[i]=n.name}}}});var wo=h(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.UniqueOperationNamesRule=lT;var cT=q();function lT(e){let t=Object.create(null);return{OperationDefinition(r){let n=r.name;return n&&(t[n.value]?e.reportError(new cT.GraphQLError(`There can be only one operation named "${n.value}".`,{nodes:[t[n.value],n]})):t[n.value]=n),!1},FragmentDefinition:()=>!1}}});var ko=h(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.UniqueOperationTypesRule=pT;var Xl=q();function pT(e){let t=e.getSchema(),r=Object.create(null),n=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var a;let o=(a=s.operationTypes)!==null&&a!==void 0?a:[];for(let u of o){let c=u.operation,l=r[c];n[c]?e.reportError(new Xl.GraphQLError(`Type for ${c} already defined in the schema. It cannot be redefined.`,{nodes:u})):l?e.reportError(new Xl.GraphQLError(`There can be only one ${c} type in schema.`,{nodes:[l,u]})):r[c]=u}return!1}}});var xo=h(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.UniqueTypeNamesRule=dT;var Hl=q();function dT(e){let t=Object.create(null),r=e.getSchema();return{ScalarTypeDefinition:n,ObjectTypeDefinition:n,InterfaceTypeDefinition:n,UnionTypeDefinition:n,EnumTypeDefinition:n,InputObjectTypeDefinition:n};function n(i){let s=i.name.value;if(r!=null&&r.getType(s)){e.reportError(new Hl.GraphQLError(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return t[s]?e.reportError(new Hl.GraphQLError(`There can be only one type named "${s}".`,{nodes:[t[s],i.name]})):t[s]=i.name,!1}}});var Mo=h(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.UniqueVariableNamesRule=yT;var fT=Ai(),mT=q();function yT(e){return{OperationDefinition(t){var r;let n=(r=t.variableDefinitions)!==null&&r!==void 0?r:[],i=(0,fT.groupBy)(n,s=>s.variable.name.value);for(let[s,a]of i)a.length>1&&e.reportError(new mT.GraphQLError(`There can be only one variable named "$${s}".`,{nodes:a.map(o=>o.variable.name)}))}}}});var Co=h(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.ValuesOfCorrectTypeRule=bT;var hT=wt(),vn=re(),vT=Ft(),TT=kt(),sr=q(),Ri=Ce(),vt=Y();function bT(e){return{ListValue(t){let r=(0,vt.getNullableType)(e.getParentInputType());if(!(0,vt.isListType)(r))return ir(e,t),!1},ObjectValue(t){let r=(0,vt.getNamedType)(e.getInputType());if(!(0,vt.isInputObjectType)(r))return ir(e,t),!1;let n=(0,vT.keyMap)(t.fields,i=>i.name.value);for(let i of Object.values(r.getFields()))if(!n[i.name]&&(0,vt.isRequiredInputField)(i)){let a=(0,vn.inspect)(i.type);e.reportError(new sr.GraphQLError(`Field "${r.name}.${i.name}" of required type "${a}" was not provided.`,{nodes:t}))}},ObjectField(t){let r=(0,vt.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,vt.isInputObjectType)(r)){let i=(0,TT.suggestionList)(t.name.value,Object.keys(r.getFields()));e.reportError(new sr.GraphQLError(`Field "${t.name.value}" is not defined by type "${r.name}".`+(0,hT.didYouMean)(i),{nodes:t}))}},NullValue(t){let r=e.getInputType();(0,vt.isNonNullType)(r)&&e.reportError(new sr.GraphQLError(`Expected value of type "${(0,vn.inspect)(r)}", found ${(0,Ri.print)(t)}.`,{nodes:t}))},EnumValue:t=>ir(e,t),IntValue:t=>ir(e,t),FloatValue:t=>ir(e,t),StringValue:t=>ir(e,t),BooleanValue:t=>ir(e,t)}}function ir(e,t){let r=e.getInputType();if(!r)return;let n=(0,vt.getNamedType)(r);if(!(0,vt.isLeafType)(n)){let i=(0,vn.inspect)(r);e.reportError(new sr.GraphQLError(`Expected value of type "${i}", found ${(0,Ri.print)(t)}.`,{nodes:t}));return}try{if(n.parseLiteral(t,void 0)===void 0){let s=(0,vn.inspect)(r);e.reportError(new sr.GraphQLError(`Expected value of type "${s}", found ${(0,Ri.print)(t)}.`,{nodes:t}))}}catch(i){let s=(0,vn.inspect)(r);i instanceof sr.GraphQLError?e.reportError(i):e.reportError(new sr.GraphQLError(`Expected value of type "${s}", found ${(0,Ri.print)(t)}; `+i.message,{nodes:t,originalError:i}))}}});var Uo=h(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.VariablesAreInputTypesRule=OT;var gT=q(),ET=Ce(),_T=Y(),NT=ht();function OT(e){return{VariableDefinition(t){let r=(0,NT.typeFromAST)(e.getSchema(),t.type);if(r!==void 0&&!(0,_T.isInputType)(r)){let n=t.variable.name.value,i=(0,ET.print)(t.type);e.reportError(new gT.GraphQLError(`Variable "$${n}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}});var $o=h(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.VariablesInAllowedPositionRule=DT;var zl=re(),IT=q(),LT=H(),Wl=Y(),Zl=zr(),ST=ht();function DT(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(r){let n=e.getRecursiveVariableUsages(r);for(let{node:i,type:s,defaultValue:a}of n){let o=i.name.value,u=t[o];if(u&&s){let c=e.getSchema(),l=(0,ST.typeFromAST)(c,u.type);if(l&&!AT(c,l,u.defaultValue,s,a)){let f=(0,zl.inspect)(l),d=(0,zl.inspect)(s);e.reportError(new IT.GraphQLError(`Variable "$${o}" of type "${f}" used in position expecting type "${d}".`,{nodes:[u,i]}))}}}}},VariableDefinition(r){t[r.variable.name.value]=r}}}function AT(e,t,r,n,i){if((0,Wl.isNonNullType)(n)&&!(0,Wl.isNonNullType)(t)){if(!(r!=null&&r.kind!==LT.Kind.NULL)&&!(i!==void 0))return!1;let o=n.ofType;return(0,Zl.isTypeSubTypeOf)(e,t,o)}return(0,Zl.isTypeSubTypeOf)(e,t,n)}});var Bo=h(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.specifiedSDLRules=Dr.specifiedRules=void 0;var RT=pa(),jT=fa(),PT=ya(),ep=ha(),tp=ga(),wT=_a(),rp=Ia(),FT=Sa(),kT=Aa(),qT=ja(),xT=wa(),VT=ka(),MT=xa(),GT=Ya(),CT=Ha(),QT=Wa(),np=eo(),UT=ro(),KT=po(),$T=yo(),ip=vo(),BT=bo(),sp=_o(),YT=Oo(),JT=So(),XT=Ao(),ap=jo(),HT=wo(),zT=ko(),WT=xo(),ZT=Mo(),eb=Co(),tb=Uo(),rb=$o(),nb=Object.freeze([RT.ExecutableDefinitionsRule,HT.UniqueOperationNamesRule,FT.LoneAnonymousOperationRule,KT.SingleFieldSubscriptionsRule,rp.KnownTypeNamesRule,PT.FragmentsOnCompositeTypesRule,tb.VariablesAreInputTypesRule,UT.ScalarLeafsRule,jT.FieldsOnCorrectTypeRule,XT.UniqueFragmentNamesRule,wT.KnownFragmentNamesRule,VT.NoUnusedFragmentsRule,CT.PossibleFragmentSpreadsRule,qT.NoFragmentCyclesRule,ZT.UniqueVariableNamesRule,xT.NoUndefinedVariablesRule,MT.NoUnusedVariablesRule,tp.KnownDirectivesRule,sp.UniqueDirectivesPerLocationRule,ep.KnownArgumentNamesRule,ip.UniqueArgumentNamesRule,eb.ValuesOfCorrectTypeRule,np.ProvidedRequiredArgumentsRule,rb.VariablesInAllowedPositionRule,GT.OverlappingFieldsCanBeMergedRule,ap.UniqueInputFieldNamesRule]);Dr.specifiedRules=nb;var ib=Object.freeze([kT.LoneSchemaDefinitionRule,zT.UniqueOperationTypesRule,WT.UniqueTypeNamesRule,YT.UniqueEnumValueNamesRule,JT.UniqueFieldDefinitionNamesRule,$T.UniqueArgumentDefinitionNamesRule,BT.UniqueDirectiveNamesRule,rp.KnownTypeNamesRule,tp.KnownDirectivesRule,sp.UniqueDirectivesPerLocationRule,QT.PossibleTypeExtensionsRule,ep.KnownArgumentNamesOnDirectivesRule,ip.UniqueArgumentNamesRule,ap.UniqueInputFieldNamesRule,np.ProvidedRequiredArgumentsOnDirectivesRule]);Dr.specifiedSDLRules=ib});var Xo=h(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.ValidationContext=Gt.SDLValidationContext=Gt.ASTValidationContext=void 0;var op=H(),sb=Yt(),up=vi(),Tn=class{constructor(t,r){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=r}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let r;if(this._fragments)r=this._fragments;else{r=Object.create(null);for(let n of this.getDocument().definitions)n.kind===op.Kind.FRAGMENT_DEFINITION&&(r[n.name.value]=n);this._fragments=r}return r[t]}getFragmentSpreads(t){let r=this._fragmentSpreads.get(t);if(!r){r=[];let n=[t],i;for(;i=n.pop();)for(let s of i.selections)s.kind===op.Kind.FRAGMENT_SPREAD?r.push(s):s.selectionSet&&n.push(s.selectionSet);this._fragmentSpreads.set(t,r)}return r}getRecursivelyReferencedFragments(t){let r=this._recursivelyReferencedFragments.get(t);if(!r){r=[];let n=Object.create(null),i=[t.selectionSet],s;for(;s=i.pop();)for(let a of this.getFragmentSpreads(s)){let o=a.name.value;if(n[o]!==!0){n[o]=!0;let u=this.getFragment(o);u&&(r.push(u),i.push(u.selectionSet))}}this._recursivelyReferencedFragments.set(t,r)}return r}};Gt.ASTValidationContext=Tn;var Yo=class extends Tn{constructor(t,r,n){super(t,n),this._schema=r}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};Gt.SDLValidationContext=Yo;var Jo=class extends Tn{constructor(t,r,n,i){super(r,i),this._schema=t,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let r=this._variableUsages.get(t);if(!r){let n=[],i=new up.TypeInfo(this._schema);(0,sb.visit)(t,(0,up.visitWithTypeInfo)(i,{VariableDefinition:()=>!1,Variable(s){n.push({node:s,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),r=n,this._variableUsages.set(t,r)}return r}getRecursiveVariableUsages(t){let r=this._recursiveVariableUsages.get(t);if(!r){r=this.getVariableUsages(t);for(let n of this.getRecursivelyReferencedFragments(t))r=r.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(t,r)}return r}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};Gt.ValidationContext=Jo});var bn=h(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.assertValidSDL=lb;Ar.assertValidSDLExtension=pb;Ar.validate=cb;Ar.validateSDL=Ho;var ab=Fe(),ob=q(),ji=Yt(),ub=un(),cp=vi(),lp=Bo(),pp=Xo();function cb(e,t,r=lp.specifiedRules,n,i=new cp.TypeInfo(e)){var s;let a=(s=n?.maxErrors)!==null&&s!==void 0?s:100;t||(0,ab.devAssert)(!1,"Must provide document."),(0,ub.assertValidSchema)(e);let o=Object.freeze({}),u=[],c=new pp.ValidationContext(e,t,i,f=>{if(u.length>=a)throw u.push(new ob.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),o;u.push(f)}),l=(0,ji.visitInParallel)(r.map(f=>f(c)));try{(0,ji.visit)(t,(0,cp.visitWithTypeInfo)(i,l))}catch(f){if(f!==o)throw f}return u}function Ho(e,t,r=lp.specifiedSDLRules){let n=[],i=new pp.SDLValidationContext(e,t,a=>{n.push(a)}),s=r.map(a=>a(i));return(0,ji.visit)(e,(0,ji.visitInParallel)(s)),n}function lb(e){let t=Ho(e);if(t.length!==0)throw new Error(t.map(r=>r.message).join(` + +`))}function pb(e,t){let r=Ho(e,t);if(r.length!==0)throw new Error(r.map(n=>n.message).join(` + +`))}});var dp=h(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.memoize3=db;function db(e){let t;return function(n,i,s){t===void 0&&(t=new WeakMap);let a=t.get(n);a===void 0&&(a=new WeakMap,t.set(n,a));let o=a.get(i);o===void 0&&(o=new WeakMap,a.set(i,o));let u=o.get(s);return u===void 0&&(u=e(n,i,s),o.set(s,u)),u}}});var fp=h(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.promiseForObject=fb;function fb(e){return Promise.all(Object.values(e)).then(t=>{let r=Object.create(null);for(let[n,i]of Object.keys(e).entries())r[i]=t[n];return r})}});var mp=h(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.promiseReduce=yb;var mb=wn();function yb(e,t,r){let n=r;for(let i of e)n=(0,mb.isPromise)(n)?n.then(s=>t(s,i)):t(n,i);return n}});var yp=h(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.toError=vb;var hb=re();function vb(e){return e instanceof Error?e:new eu(e)}var eu=class extends Error{constructor(t){super("Unexpected error value: "+(0,hb.inspect)(t)),this.name="NonErrorThrown",this.thrownValue=t}}});var Pi=h(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.locatedError=gb;var Tb=yp(),bb=q();function gb(e,t,r){var n;let i=(0,Tb.toError)(e);return Eb(i)?i:new bb.GraphQLError(i.message,{nodes:(n=i.nodes)!==null&&n!==void 0?n:t,source:i.source,positions:i.positions,path:r,originalError:i})}function Eb(e){return Array.isArray(e.path)}});var En=h(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.assertValidExecutionArguments=Np;He.buildExecutionContext=Op;He.buildResolveInfo=Lp;He.defaultTypeResolver=He.defaultFieldResolver=void 0;He.execute=_p;He.executeSync=Db;He.getFieldDef=Dp;var iu=Fe(),ar=re(),_b=je(),Nb=fi(),ou=pt(),ut=wn(),Ob=dp(),or=pn(),hp=fp(),Ib=mp(),Xe=q(),Fi=Pi(),nu=dt(),vp=H(),Ct=Y(),Rr=Ye(),Lb=un(),gp=Di(),Ep=Sr(),Sb=(0,Ob.memoize3)((e,t,r)=>(0,gp.collectSubfields)(e.schema,e.fragments,e.variableValues,t,r));function _p(e){arguments.length<2||(0,iu.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,document:r,variableValues:n,rootValue:i}=e;Np(t,r,n);let s=Op(e);if(!("schema"in s))return{errors:s};try{let{operation:a}=s,o=Ab(s,a,i);return(0,ut.isPromise)(o)?o.then(u=>wi(u,s.errors),u=>(s.errors.push(u),wi(null,s.errors))):wi(o,s.errors)}catch(a){return s.errors.push(a),wi(null,s.errors)}}function Db(e){let t=_p(e);if((0,ut.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function wi(e,t){return t.length===0?{data:e}:{errors:t,data:e}}function Np(e,t,r){t||(0,iu.devAssert)(!1,"Must provide document."),(0,Lb.assertValidSchema)(e),r==null||(0,ou.isObjectLike)(r)||(0,iu.devAssert)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function Op(e){var t,r;let{schema:n,document:i,rootValue:s,contextValue:a,variableValues:o,operationName:u,fieldResolver:c,typeResolver:l,subscribeFieldResolver:f}=e,d,y=Object.create(null);for(let E of i.definitions)switch(E.kind){case vp.Kind.OPERATION_DEFINITION:if(u==null){if(d!==void 0)return[new Xe.GraphQLError("Must provide operation name if query contains multiple operations.")];d=E}else((t=E.name)===null||t===void 0?void 0:t.value)===u&&(d=E);break;case vp.Kind.FRAGMENT_DEFINITION:y[E.name.value]=E;break;default:}if(!d)return u!=null?[new Xe.GraphQLError(`Unknown operation named "${u}".`)]:[new Xe.GraphQLError("Must provide an operation.")];let T=(r=d.variableDefinitions)!==null&&r!==void 0?r:[],I=(0,Ep.getVariableValues)(n,T,o??{},{maxErrors:50});return I.errors?I.errors:{schema:n,fragments:y,rootValue:s,contextValue:a,operation:d,variableValues:I.coerced,fieldResolver:c??au,typeResolver:l??Sp,subscribeFieldResolver:f??au,errors:[]}}function Ab(e,t,r){let n=e.schema.getRootType(t.operation);if(n==null)throw new Xe.GraphQLError(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=(0,gp.collectFields)(e.schema,e.fragments,e.variableValues,n,t.selectionSet),s=void 0;switch(t.operation){case nu.OperationTypeNode.QUERY:return ki(e,n,r,s,i);case nu.OperationTypeNode.MUTATION:return Rb(e,n,r,s,i);case nu.OperationTypeNode.SUBSCRIPTION:return ki(e,n,r,s,i)}}function Rb(e,t,r,n,i){return(0,Ib.promiseReduce)(i.entries(),(s,[a,o])=>{let u=(0,or.addPath)(n,a,t.name),c=Ip(e,t,r,o,u);return c===void 0?s:(0,ut.isPromise)(c)?c.then(l=>(s[a]=l,s)):(s[a]=c,s)},Object.create(null))}function ki(e,t,r,n,i){let s=Object.create(null),a=!1;try{for(let[o,u]of i.entries()){let c=(0,or.addPath)(n,o,t.name),l=Ip(e,t,r,u,c);l!==void 0&&(s[o]=l,(0,ut.isPromise)(l)&&(a=!0))}}catch(o){if(a)return(0,hp.promiseForObject)(s).finally(()=>{throw o});throw o}return a?(0,hp.promiseForObject)(s):s}function Ip(e,t,r,n,i){var s;let a=Dp(e.schema,t,n[0]);if(!a)return;let o=a.type,u=(s=a.resolve)!==null&&s!==void 0?s:e.fieldResolver,c=Lp(e,a,n,t,i);try{let l=(0,Ep.getArgumentValues)(a,n[0],e.variableValues),f=e.contextValue,d=u(r,l,f,c),y;return(0,ut.isPromise)(d)?y=d.then(T=>gn(e,o,n,c,i,T)):y=gn(e,o,n,c,i,d),(0,ut.isPromise)(y)?y.then(void 0,T=>{let I=(0,Fi.locatedError)(T,n,(0,or.pathToArray)(i));return qi(I,o,e)}):y}catch(l){let f=(0,Fi.locatedError)(l,n,(0,or.pathToArray)(i));return qi(f,o,e)}}function Lp(e,t,r,n,i){return{fieldName:t.name,fieldNodes:r,returnType:t.type,parentType:n,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function qi(e,t,r){if((0,Ct.isNonNullType)(t))throw e;return r.errors.push(e),null}function gn(e,t,r,n,i,s){if(s instanceof Error)throw s;if((0,Ct.isNonNullType)(t)){let a=gn(e,t.ofType,r,n,i,s);if(a===null)throw new Error(`Cannot return null for non-nullable field ${n.parentType.name}.${n.fieldName}.`);return a}if(s==null)return null;if((0,Ct.isListType)(t))return jb(e,t,r,n,i,s);if((0,Ct.isLeafType)(t))return Pb(t,s);if((0,Ct.isAbstractType)(t))return wb(e,t,r,n,i,s);if((0,Ct.isObjectType)(t))return su(e,t,r,n,i,s);(0,_b.invariant)(!1,"Cannot complete value of unexpected output type: "+(0,ar.inspect)(t))}function jb(e,t,r,n,i,s){if(!(0,Nb.isIterableObject)(s))throw new Xe.GraphQLError(`Expected Iterable, but did not find one for field "${n.parentType.name}.${n.fieldName}".`);let a=t.ofType,o=!1,u=Array.from(s,(c,l)=>{let f=(0,or.addPath)(i,l,void 0);try{let d;return(0,ut.isPromise)(c)?d=c.then(y=>gn(e,a,r,n,f,y)):d=gn(e,a,r,n,f,c),(0,ut.isPromise)(d)?(o=!0,d.then(void 0,y=>{let T=(0,Fi.locatedError)(y,r,(0,or.pathToArray)(f));return qi(T,a,e)})):d}catch(d){let y=(0,Fi.locatedError)(d,r,(0,or.pathToArray)(f));return qi(y,a,e)}});return o?Promise.all(u):u}function Pb(e,t){let r=e.serialize(t);if(r==null)throw new Error(`Expected \`${(0,ar.inspect)(e)}.serialize(${(0,ar.inspect)(t)})\` to return non-nullable value, returned: ${(0,ar.inspect)(r)}`);return r}function wb(e,t,r,n,i,s){var a;let o=(a=t.resolveType)!==null&&a!==void 0?a:e.typeResolver,u=e.contextValue,c=o(s,u,n,t);return(0,ut.isPromise)(c)?c.then(l=>su(e,Tp(l,e,t,r,n,s),r,n,i,s)):su(e,Tp(c,e,t,r,n,s),r,n,i,s)}function Tp(e,t,r,n,i,s){if(e==null)throw new Xe.GraphQLError(`Abstract type "${r.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${r.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,n);if((0,Ct.isObjectType)(e))throw new Xe.GraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof e!="string")throw new Xe.GraphQLError(`Abstract type "${r.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${(0,ar.inspect)(s)}, received "${(0,ar.inspect)(e)}".`);let a=t.schema.getType(e);if(a==null)throw new Xe.GraphQLError(`Abstract type "${r.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:n});if(!(0,Ct.isObjectType)(a))throw new Xe.GraphQLError(`Abstract type "${r.name}" was resolved to a non-object type "${e}".`,{nodes:n});if(!t.schema.isSubType(r,a))throw new Xe.GraphQLError(`Runtime Object type "${a.name}" is not a possible type for "${r.name}".`,{nodes:n});return a}function su(e,t,r,n,i,s){let a=Sb(e,t,r);if(t.isTypeOf){let o=t.isTypeOf(s,e.contextValue,n);if((0,ut.isPromise)(o))return o.then(u=>{if(!u)throw bp(t,s,r);return ki(e,t,s,i,a)});if(!o)throw bp(t,s,r)}return ki(e,t,s,i,a)}function bp(e,t,r){return new Xe.GraphQLError(`Expected value of type "${e.name}" but got: ${(0,ar.inspect)(t)}.`,{nodes:r})}var Sp=function(e,t,r,n){if((0,ou.isObjectLike)(e)&&typeof e.__typename=="string")return e.__typename;let i=r.schema.getPossibleTypes(n),s=[];for(let a=0;a{for(let o=0;o{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.graphql=Gb;xi.graphqlSync=Cb;var Fb=Fe(),kb=wn(),qb=vr(),xb=un(),Vb=bn(),Mb=En();function Gb(e){return new Promise(t=>t(Ap(e)))}function Cb(e){let t=Ap(e);if((0,kb.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function Ap(e){arguments.length<2||(0,Fb.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let{schema:t,source:r,rootValue:n,contextValue:i,variableValues:s,operationName:a,fieldResolver:o,typeResolver:u}=e,c=(0,xb.validateSchema)(t);if(c.length>0)return{errors:c};let l;try{l=(0,qb.parse)(r)}catch(d){return{errors:[d]}}let f=(0,Vb.validate)(t,l);return f.length>0?{errors:f}:(0,Mb.execute)({schema:t,document:l,rootValue:n,contextValue:i,variableValues:s,operationName:a,fieldResolver:o,typeResolver:u})}});var wp=h(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});Object.defineProperty(b,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return Tt.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(b,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return Dt.GRAPHQL_MAX_INT}});Object.defineProperty(b,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return Dt.GRAPHQL_MIN_INT}});Object.defineProperty(b,"GraphQLBoolean",{enumerable:!0,get:function(){return Dt.GraphQLBoolean}});Object.defineProperty(b,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return Tt.GraphQLDeprecatedDirective}});Object.defineProperty(b,"GraphQLDirective",{enumerable:!0,get:function(){return Tt.GraphQLDirective}});Object.defineProperty(b,"GraphQLEnumType",{enumerable:!0,get:function(){return x.GraphQLEnumType}});Object.defineProperty(b,"GraphQLFloat",{enumerable:!0,get:function(){return Dt.GraphQLFloat}});Object.defineProperty(b,"GraphQLID",{enumerable:!0,get:function(){return Dt.GraphQLID}});Object.defineProperty(b,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return Tt.GraphQLIncludeDirective}});Object.defineProperty(b,"GraphQLInputObjectType",{enumerable:!0,get:function(){return x.GraphQLInputObjectType}});Object.defineProperty(b,"GraphQLInt",{enumerable:!0,get:function(){return Dt.GraphQLInt}});Object.defineProperty(b,"GraphQLInterfaceType",{enumerable:!0,get:function(){return x.GraphQLInterfaceType}});Object.defineProperty(b,"GraphQLList",{enumerable:!0,get:function(){return x.GraphQLList}});Object.defineProperty(b,"GraphQLNonNull",{enumerable:!0,get:function(){return x.GraphQLNonNull}});Object.defineProperty(b,"GraphQLObjectType",{enumerable:!0,get:function(){return x.GraphQLObjectType}});Object.defineProperty(b,"GraphQLScalarType",{enumerable:!0,get:function(){return x.GraphQLScalarType}});Object.defineProperty(b,"GraphQLSchema",{enumerable:!0,get:function(){return uu.GraphQLSchema}});Object.defineProperty(b,"GraphQLSkipDirective",{enumerable:!0,get:function(){return Tt.GraphQLSkipDirective}});Object.defineProperty(b,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return Tt.GraphQLSpecifiedByDirective}});Object.defineProperty(b,"GraphQLString",{enumerable:!0,get:function(){return Dt.GraphQLString}});Object.defineProperty(b,"GraphQLUnionType",{enumerable:!0,get:function(){return x.GraphQLUnionType}});Object.defineProperty(b,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return Ge.SchemaMetaFieldDef}});Object.defineProperty(b,"TypeKind",{enumerable:!0,get:function(){return Ge.TypeKind}});Object.defineProperty(b,"TypeMetaFieldDef",{enumerable:!0,get:function(){return Ge.TypeMetaFieldDef}});Object.defineProperty(b,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return Ge.TypeNameMetaFieldDef}});Object.defineProperty(b,"__Directive",{enumerable:!0,get:function(){return Ge.__Directive}});Object.defineProperty(b,"__DirectiveLocation",{enumerable:!0,get:function(){return Ge.__DirectiveLocation}});Object.defineProperty(b,"__EnumValue",{enumerable:!0,get:function(){return Ge.__EnumValue}});Object.defineProperty(b,"__Field",{enumerable:!0,get:function(){return Ge.__Field}});Object.defineProperty(b,"__InputValue",{enumerable:!0,get:function(){return Ge.__InputValue}});Object.defineProperty(b,"__Schema",{enumerable:!0,get:function(){return Ge.__Schema}});Object.defineProperty(b,"__Type",{enumerable:!0,get:function(){return Ge.__Type}});Object.defineProperty(b,"__TypeKind",{enumerable:!0,get:function(){return Ge.__TypeKind}});Object.defineProperty(b,"assertAbstractType",{enumerable:!0,get:function(){return x.assertAbstractType}});Object.defineProperty(b,"assertCompositeType",{enumerable:!0,get:function(){return x.assertCompositeType}});Object.defineProperty(b,"assertDirective",{enumerable:!0,get:function(){return Tt.assertDirective}});Object.defineProperty(b,"assertEnumType",{enumerable:!0,get:function(){return x.assertEnumType}});Object.defineProperty(b,"assertEnumValueName",{enumerable:!0,get:function(){return Pp.assertEnumValueName}});Object.defineProperty(b,"assertInputObjectType",{enumerable:!0,get:function(){return x.assertInputObjectType}});Object.defineProperty(b,"assertInputType",{enumerable:!0,get:function(){return x.assertInputType}});Object.defineProperty(b,"assertInterfaceType",{enumerable:!0,get:function(){return x.assertInterfaceType}});Object.defineProperty(b,"assertLeafType",{enumerable:!0,get:function(){return x.assertLeafType}});Object.defineProperty(b,"assertListType",{enumerable:!0,get:function(){return x.assertListType}});Object.defineProperty(b,"assertName",{enumerable:!0,get:function(){return Pp.assertName}});Object.defineProperty(b,"assertNamedType",{enumerable:!0,get:function(){return x.assertNamedType}});Object.defineProperty(b,"assertNonNullType",{enumerable:!0,get:function(){return x.assertNonNullType}});Object.defineProperty(b,"assertNullableType",{enumerable:!0,get:function(){return x.assertNullableType}});Object.defineProperty(b,"assertObjectType",{enumerable:!0,get:function(){return x.assertObjectType}});Object.defineProperty(b,"assertOutputType",{enumerable:!0,get:function(){return x.assertOutputType}});Object.defineProperty(b,"assertScalarType",{enumerable:!0,get:function(){return x.assertScalarType}});Object.defineProperty(b,"assertSchema",{enumerable:!0,get:function(){return uu.assertSchema}});Object.defineProperty(b,"assertType",{enumerable:!0,get:function(){return x.assertType}});Object.defineProperty(b,"assertUnionType",{enumerable:!0,get:function(){return x.assertUnionType}});Object.defineProperty(b,"assertValidSchema",{enumerable:!0,get:function(){return jp.assertValidSchema}});Object.defineProperty(b,"assertWrappingType",{enumerable:!0,get:function(){return x.assertWrappingType}});Object.defineProperty(b,"getNamedType",{enumerable:!0,get:function(){return x.getNamedType}});Object.defineProperty(b,"getNullableType",{enumerable:!0,get:function(){return x.getNullableType}});Object.defineProperty(b,"introspectionTypes",{enumerable:!0,get:function(){return Ge.introspectionTypes}});Object.defineProperty(b,"isAbstractType",{enumerable:!0,get:function(){return x.isAbstractType}});Object.defineProperty(b,"isCompositeType",{enumerable:!0,get:function(){return x.isCompositeType}});Object.defineProperty(b,"isDirective",{enumerable:!0,get:function(){return Tt.isDirective}});Object.defineProperty(b,"isEnumType",{enumerable:!0,get:function(){return x.isEnumType}});Object.defineProperty(b,"isInputObjectType",{enumerable:!0,get:function(){return x.isInputObjectType}});Object.defineProperty(b,"isInputType",{enumerable:!0,get:function(){return x.isInputType}});Object.defineProperty(b,"isInterfaceType",{enumerable:!0,get:function(){return x.isInterfaceType}});Object.defineProperty(b,"isIntrospectionType",{enumerable:!0,get:function(){return Ge.isIntrospectionType}});Object.defineProperty(b,"isLeafType",{enumerable:!0,get:function(){return x.isLeafType}});Object.defineProperty(b,"isListType",{enumerable:!0,get:function(){return x.isListType}});Object.defineProperty(b,"isNamedType",{enumerable:!0,get:function(){return x.isNamedType}});Object.defineProperty(b,"isNonNullType",{enumerable:!0,get:function(){return x.isNonNullType}});Object.defineProperty(b,"isNullableType",{enumerable:!0,get:function(){return x.isNullableType}});Object.defineProperty(b,"isObjectType",{enumerable:!0,get:function(){return x.isObjectType}});Object.defineProperty(b,"isOutputType",{enumerable:!0,get:function(){return x.isOutputType}});Object.defineProperty(b,"isRequiredArgument",{enumerable:!0,get:function(){return x.isRequiredArgument}});Object.defineProperty(b,"isRequiredInputField",{enumerable:!0,get:function(){return x.isRequiredInputField}});Object.defineProperty(b,"isScalarType",{enumerable:!0,get:function(){return x.isScalarType}});Object.defineProperty(b,"isSchema",{enumerable:!0,get:function(){return uu.isSchema}});Object.defineProperty(b,"isSpecifiedDirective",{enumerable:!0,get:function(){return Tt.isSpecifiedDirective}});Object.defineProperty(b,"isSpecifiedScalarType",{enumerable:!0,get:function(){return Dt.isSpecifiedScalarType}});Object.defineProperty(b,"isType",{enumerable:!0,get:function(){return x.isType}});Object.defineProperty(b,"isUnionType",{enumerable:!0,get:function(){return x.isUnionType}});Object.defineProperty(b,"isWrappingType",{enumerable:!0,get:function(){return x.isWrappingType}});Object.defineProperty(b,"resolveObjMapThunk",{enumerable:!0,get:function(){return x.resolveObjMapThunk}});Object.defineProperty(b,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return x.resolveReadonlyArrayThunk}});Object.defineProperty(b,"specifiedDirectives",{enumerable:!0,get:function(){return Tt.specifiedDirectives}});Object.defineProperty(b,"specifiedScalarTypes",{enumerable:!0,get:function(){return Dt.specifiedScalarTypes}});Object.defineProperty(b,"validateSchema",{enumerable:!0,get:function(){return jp.validateSchema}});var uu=Zt(),x=Y(),Tt=Ve(),Dt=yt(),Ge=Ye(),jp=un(),Pp=Br()});var kp=h(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});Object.defineProperty(z,"BREAK",{enumerable:!0,get:function(){return _n.BREAK}});Object.defineProperty(z,"DirectiveLocation",{enumerable:!0,get:function(){return Jb.DirectiveLocation}});Object.defineProperty(z,"Kind",{enumerable:!0,get:function(){return Kb.Kind}});Object.defineProperty(z,"Lexer",{enumerable:!0,get:function(){return Bb.Lexer}});Object.defineProperty(z,"Location",{enumerable:!0,get:function(){return cu.Location}});Object.defineProperty(z,"OperationTypeNode",{enumerable:!0,get:function(){return cu.OperationTypeNode}});Object.defineProperty(z,"Source",{enumerable:!0,get:function(){return Qb.Source}});Object.defineProperty(z,"Token",{enumerable:!0,get:function(){return cu.Token}});Object.defineProperty(z,"TokenKind",{enumerable:!0,get:function(){return $b.TokenKind}});Object.defineProperty(z,"getEnterLeaveForKind",{enumerable:!0,get:function(){return _n.getEnterLeaveForKind}});Object.defineProperty(z,"getLocation",{enumerable:!0,get:function(){return Ub.getLocation}});Object.defineProperty(z,"getVisitFn",{enumerable:!0,get:function(){return _n.getVisitFn}});Object.defineProperty(z,"isConstValueNode",{enumerable:!0,get:function(){return bt.isConstValueNode}});Object.defineProperty(z,"isDefinitionNode",{enumerable:!0,get:function(){return bt.isDefinitionNode}});Object.defineProperty(z,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return bt.isExecutableDefinitionNode}});Object.defineProperty(z,"isSelectionNode",{enumerable:!0,get:function(){return bt.isSelectionNode}});Object.defineProperty(z,"isTypeDefinitionNode",{enumerable:!0,get:function(){return bt.isTypeDefinitionNode}});Object.defineProperty(z,"isTypeExtensionNode",{enumerable:!0,get:function(){return bt.isTypeExtensionNode}});Object.defineProperty(z,"isTypeNode",{enumerable:!0,get:function(){return bt.isTypeNode}});Object.defineProperty(z,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return bt.isTypeSystemDefinitionNode}});Object.defineProperty(z,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return bt.isTypeSystemExtensionNode}});Object.defineProperty(z,"isValueNode",{enumerable:!0,get:function(){return bt.isValueNode}});Object.defineProperty(z,"parse",{enumerable:!0,get:function(){return Vi.parse}});Object.defineProperty(z,"parseConstValue",{enumerable:!0,get:function(){return Vi.parseConstValue}});Object.defineProperty(z,"parseType",{enumerable:!0,get:function(){return Vi.parseType}});Object.defineProperty(z,"parseValue",{enumerable:!0,get:function(){return Vi.parseValue}});Object.defineProperty(z,"print",{enumerable:!0,get:function(){return Yb.print}});Object.defineProperty(z,"printLocation",{enumerable:!0,get:function(){return Fp.printLocation}});Object.defineProperty(z,"printSourceLocation",{enumerable:!0,get:function(){return Fp.printSourceLocation}});Object.defineProperty(z,"visit",{enumerable:!0,get:function(){return _n.visit}});Object.defineProperty(z,"visitInParallel",{enumerable:!0,get:function(){return _n.visitInParallel}});var Qb=Un(),Ub=Fn(),Fp=os(),Kb=H(),$b=Vr(),Bb=Mn(),Vi=vr(),Yb=Ce(),_n=Yt(),cu=dt(),bt=tr(),Jb=yr()});var qp=h(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.isAsyncIterable=Xb;function Xb(e){return typeof e?.[Symbol.asyncIterator]=="function"}});var xp=h(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.mapAsyncIterator=Hb;function Hb(e,t){let r=e[Symbol.asyncIterator]();async function n(i){if(i.done)return i;try{return{value:await t(i.value),done:!1}}catch(s){if(typeof r.return=="function")try{await r.return()}catch{}throw s}}return{async next(){return n(await r.next())},async return(){return typeof r.return=="function"?n(await r.return()):{value:void 0,done:!0}},async throw(i){if(typeof r.throw=="function")return n(await r.throw(i));throw i},[Symbol.asyncIterator](){return this}}}});var Cp=h(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.createSourceEventStream=Gp;Mi.subscribe=ng;var zb=Fe(),Wb=re(),Mp=qp(),Vp=pn(),du=q(),Zb=Pi(),eg=Di(),Nn=En(),tg=xp(),rg=Sr();async function ng(e){arguments.length<2||(0,zb.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");let t=await Gp(e);if(!(0,Mp.isAsyncIterable)(t))return t;let r=n=>(0,Nn.execute)({...e,rootValue:n});return(0,tg.mapAsyncIterator)(t,r)}function ig(e){let t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}async function Gp(...e){let t=ig(e),{schema:r,document:n,variableValues:i}=t;(0,Nn.assertValidExecutionArguments)(r,n,i);let s=(0,Nn.buildExecutionContext)(t);if(!("schema"in s))return{errors:s};try{let a=await sg(s);if(!(0,Mp.isAsyncIterable)(a))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,Wb.inspect)(a)}.`);return a}catch(a){if(a instanceof du.GraphQLError)return{errors:[a]};throw a}}async function sg(e){let{schema:t,fragments:r,operation:n,variableValues:i,rootValue:s}=e,a=t.getSubscriptionType();if(a==null)throw new du.GraphQLError("Schema is not configured to execute subscription operation.",{nodes:n});let o=(0,eg.collectFields)(t,r,i,a,n.selectionSet),[u,c]=[...o.entries()][0],l=(0,Nn.getFieldDef)(t,a,c[0]);if(!l){let T=c[0].name.value;throw new du.GraphQLError(`The subscription field "${T}" is not defined.`,{nodes:c})}let f=(0,Vp.addPath)(void 0,u,a.name),d=(0,Nn.buildResolveInfo)(e,l,c,a,f);try{var y;let T=(0,rg.getArgumentValues)(l,c[0],i),I=e.contextValue,L=await((y=l.subscribe)!==null&&y!==void 0?y:e.subscribeFieldResolver)(s,T,I,d);if(L instanceof Error)throw L;return L}catch(T){throw(0,Zb.locatedError)(T,c,(0,Vp.pathToArray)(f))}}});var Up=h(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});Object.defineProperty(ze,"createSourceEventStream",{enumerable:!0,get:function(){return Qp.createSourceEventStream}});Object.defineProperty(ze,"defaultFieldResolver",{enumerable:!0,get:function(){return Gi.defaultFieldResolver}});Object.defineProperty(ze,"defaultTypeResolver",{enumerable:!0,get:function(){return Gi.defaultTypeResolver}});Object.defineProperty(ze,"execute",{enumerable:!0,get:function(){return Gi.execute}});Object.defineProperty(ze,"executeSync",{enumerable:!0,get:function(){return Gi.executeSync}});Object.defineProperty(ze,"getArgumentValues",{enumerable:!0,get:function(){return fu.getArgumentValues}});Object.defineProperty(ze,"getDirectiveValues",{enumerable:!0,get:function(){return fu.getDirectiveValues}});Object.defineProperty(ze,"getVariableValues",{enumerable:!0,get:function(){return fu.getVariableValues}});Object.defineProperty(ze,"responsePathAsArray",{enumerable:!0,get:function(){return ag.pathToArray}});Object.defineProperty(ze,"subscribe",{enumerable:!0,get:function(){return Qp.subscribe}});var ag=pn(),Gi=En(),Qp=Cp(),fu=Sr()});var Kp=h(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.NoDeprecatedCustomRule=og;var mu=je(),On=q(),yu=Y();function og(e){return{Field(t){let r=e.getFieldDef(),n=r?.deprecationReason;if(r&&n!=null){let i=e.getParentType();i!=null||(0,mu.invariant)(!1),e.reportError(new On.GraphQLError(`The field ${i.name}.${r.name} is deprecated. ${n}`,{nodes:t}))}},Argument(t){let r=e.getArgument(),n=r?.deprecationReason;if(r&&n!=null){let i=e.getDirective();if(i!=null)e.reportError(new On.GraphQLError(`Directive "@${i.name}" argument "${r.name}" is deprecated. ${n}`,{nodes:t}));else{let s=e.getParentType(),a=e.getFieldDef();s!=null&&a!=null||(0,mu.invariant)(!1),e.reportError(new On.GraphQLError(`Field "${s.name}.${a.name}" argument "${r.name}" is deprecated. ${n}`,{nodes:t}))}}},ObjectField(t){let r=(0,yu.getNamedType)(e.getParentInputType());if((0,yu.isInputObjectType)(r)){let n=r.getFields()[t.name.value],i=n?.deprecationReason;i!=null&&e.reportError(new On.GraphQLError(`The input field ${r.name}.${n.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let r=e.getEnumValue(),n=r?.deprecationReason;if(r&&n!=null){let i=(0,yu.getNamedType)(e.getInputType());i!=null||(0,mu.invariant)(!1),e.reportError(new On.GraphQLError(`The enum value "${i.name}.${r.name}" is deprecated. ${n}`,{nodes:t}))}}}}});var $p=h(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.NoSchemaIntrospectionCustomRule=pg;var ug=q(),cg=Y(),lg=Ye();function pg(e){return{Field(t){let r=(0,cg.getNamedType)(e.getType());r&&(0,lg.isIntrospectionType)(r)&&e.reportError(new ug.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}});var Bp=h(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Object.defineProperty(Q,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return yg.ExecutableDefinitionsRule}});Object.defineProperty(Q,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return hg.FieldsOnCorrectTypeRule}});Object.defineProperty(Q,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return vg.FragmentsOnCompositeTypesRule}});Object.defineProperty(Q,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return Tg.KnownArgumentNamesRule}});Object.defineProperty(Q,"KnownDirectivesRule",{enumerable:!0,get:function(){return bg.KnownDirectivesRule}});Object.defineProperty(Q,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return gg.KnownFragmentNamesRule}});Object.defineProperty(Q,"KnownTypeNamesRule",{enumerable:!0,get:function(){return Eg.KnownTypeNamesRule}});Object.defineProperty(Q,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return _g.LoneAnonymousOperationRule}});Object.defineProperty(Q,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return Cg.LoneSchemaDefinitionRule}});Object.defineProperty(Q,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return Xg.NoDeprecatedCustomRule}});Object.defineProperty(Q,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return Ng.NoFragmentCyclesRule}});Object.defineProperty(Q,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return Hg.NoSchemaIntrospectionCustomRule}});Object.defineProperty(Q,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return Og.NoUndefinedVariablesRule}});Object.defineProperty(Q,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return Ig.NoUnusedFragmentsRule}});Object.defineProperty(Q,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return Lg.NoUnusedVariablesRule}});Object.defineProperty(Q,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return Sg.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(Q,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return Dg.PossibleFragmentSpreadsRule}});Object.defineProperty(Q,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return Jg.PossibleTypeExtensionsRule}});Object.defineProperty(Q,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return Ag.ProvidedRequiredArgumentsRule}});Object.defineProperty(Q,"ScalarLeafsRule",{enumerable:!0,get:function(){return Rg.ScalarLeafsRule}});Object.defineProperty(Q,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return jg.SingleFieldSubscriptionsRule}});Object.defineProperty(Q,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return Bg.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(Q,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return Pg.UniqueArgumentNamesRule}});Object.defineProperty(Q,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return Yg.UniqueDirectiveNamesRule}});Object.defineProperty(Q,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return wg.UniqueDirectivesPerLocationRule}});Object.defineProperty(Q,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return Kg.UniqueEnumValueNamesRule}});Object.defineProperty(Q,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return $g.UniqueFieldDefinitionNamesRule}});Object.defineProperty(Q,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return Fg.UniqueFragmentNamesRule}});Object.defineProperty(Q,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return kg.UniqueInputFieldNamesRule}});Object.defineProperty(Q,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return qg.UniqueOperationNamesRule}});Object.defineProperty(Q,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return Qg.UniqueOperationTypesRule}});Object.defineProperty(Q,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return Ug.UniqueTypeNamesRule}});Object.defineProperty(Q,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return xg.UniqueVariableNamesRule}});Object.defineProperty(Q,"ValidationContext",{enumerable:!0,get:function(){return fg.ValidationContext}});Object.defineProperty(Q,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return Vg.ValuesOfCorrectTypeRule}});Object.defineProperty(Q,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return Mg.VariablesAreInputTypesRule}});Object.defineProperty(Q,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return Gg.VariablesInAllowedPositionRule}});Object.defineProperty(Q,"specifiedRules",{enumerable:!0,get:function(){return mg.specifiedRules}});Object.defineProperty(Q,"validate",{enumerable:!0,get:function(){return dg.validate}});var dg=bn(),fg=Xo(),mg=Bo(),yg=pa(),hg=fa(),vg=ya(),Tg=ha(),bg=ga(),gg=_a(),Eg=Ia(),_g=Sa(),Ng=ja(),Og=wa(),Ig=ka(),Lg=xa(),Sg=Ya(),Dg=Ha(),Ag=eo(),Rg=ro(),jg=po(),Pg=vo(),wg=_o(),Fg=Ao(),kg=jo(),qg=wo(),xg=Mo(),Vg=Co(),Mg=Uo(),Gg=$o(),Cg=Aa(),Qg=ko(),Ug=xo(),Kg=Oo(),$g=So(),Bg=yo(),Yg=bo(),Jg=Wa(),Xg=Kp(),Hg=$p()});var Yp=h(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});Object.defineProperty(ur,"GraphQLError",{enumerable:!0,get:function(){return Tu.GraphQLError}});Object.defineProperty(ur,"formatError",{enumerable:!0,get:function(){return Tu.formatError}});Object.defineProperty(ur,"locatedError",{enumerable:!0,get:function(){return Wg.locatedError}});Object.defineProperty(ur,"printError",{enumerable:!0,get:function(){return Tu.printError}});Object.defineProperty(ur,"syntaxError",{enumerable:!0,get:function(){return zg.syntaxError}});var Tu=q(),zg=qn(),Wg=Pi()});var gu=h(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.getIntrospectionQuery=Zg;function Zg(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...e},r=t.descriptions?"description":"",n=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",s=t.schemaDescription?r:"";function a(o){return t.inputValueDeprecation?o:""}return` + query IntrospectionQuery { + __schema { + ${s} + queryType { name } + mutationType { name } + subscriptionType { name } + types { + ...FullType + } + directives { + name + ${r} + ${i} + locations + args${a("(includeDeprecated: true)")} { + ...InputValue + } + } + } + } + + fragment FullType on __Type { + kind + name + ${r} + ${n} + fields(includeDeprecated: true) { + name + ${r} + args${a("(includeDeprecated: true)")} { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields${a("(includeDeprecated: true)")} { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: true) { + name + ${r} + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } + } + + fragment InputValue on __InputValue { + name + ${r} + type { ...TypeRef } + defaultValue + ${a("isDeprecated")} + ${a("deprecationReason")} + } + + fragment TypeRef on __Type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + } + } + } + } + } + } + `}});var Jp=h(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.getOperationAST=tE;var eE=H();function tE(e,t){let r=null;for(let i of e.definitions)if(i.kind===eE.Kind.OPERATION_DEFINITION){var n;if(t==null){if(r)return null;r=i}else if(((n=i.name)===null||n===void 0?void 0:n.value)===t)return i}return r}});var Xp=h(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.getOperationRootType=rE;var Ci=q();function rE(e,t){if(t.operation==="query"){let r=e.getQueryType();if(!r)throw new Ci.GraphQLError("Schema does not define the required query root type.",{nodes:t});return r}if(t.operation==="mutation"){let r=e.getMutationType();if(!r)throw new Ci.GraphQLError("Schema is not configured for mutations.",{nodes:t});return r}if(t.operation==="subscription"){let r=e.getSubscriptionType();if(!r)throw new Ci.GraphQLError("Schema is not configured for subscriptions.",{nodes:t});return r}throw new Ci.GraphQLError("Can only have query, mutation and subscription operations.",{nodes:t})}});var Hp=h(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.introspectionFromSchema=oE;var nE=je(),iE=vr(),sE=En(),aE=gu();function oE(e,t){let r={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,...t},n=(0,iE.parse)((0,aE.getIntrospectionQuery)(r)),i=(0,sE.executeSync)({schema:e,document:n});return!i.errors&&i.data||(0,nE.invariant)(!1),i.data}});var Wp=h(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.buildClientSchema=mE;var uE=Fe(),Qe=re(),zp=pt(),Qi=Kr(),cE=vr(),Ue=Y(),lE=Ve(),gt=Ye(),pE=yt(),dE=Zt(),fE=yn();function mE(e,t){(0,zp.isObjectLike)(e)&&(0,zp.isObjectLike)(e.__schema)||(0,uE.devAssert)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,Qe.inspect)(e)}.`);let r=e.__schema,n=(0,Qi.keyValMap)(r.types,m=>m.name,m=>d(m));for(let m of[...pE.specifiedScalarTypes,...gt.introspectionTypes])n[m.name]&&(n[m.name]=m);let i=r.queryType?l(r.queryType):null,s=r.mutationType?l(r.mutationType):null,a=r.subscriptionType?l(r.subscriptionType):null,o=r.directives?r.directives.map(V):[];return new dE.GraphQLSchema({description:r.description,query:i,mutation:s,subscription:a,types:Object.values(n),directives:o,assumeValid:t?.assumeValid});function u(m){if(m.kind===gt.TypeKind.LIST){let _=m.ofType;if(!_)throw new Error("Decorated type deeper than introspection query.");return new Ue.GraphQLList(u(_))}if(m.kind===gt.TypeKind.NON_NULL){let _=m.ofType;if(!_)throw new Error("Decorated type deeper than introspection query.");let oe=u(_);return new Ue.GraphQLNonNull((0,Ue.assertNullableType)(oe))}return c(m)}function c(m){let _=m.name;if(!_)throw new Error(`Unknown type reference: ${(0,Qe.inspect)(m)}.`);let oe=n[_];if(!oe)throw new Error(`Invalid or incomplete schema, unknown type: ${_}. Ensure that a full introspection query is used in order to build a client schema.`);return oe}function l(m){return(0,Ue.assertObjectType)(c(m))}function f(m){return(0,Ue.assertInterfaceType)(c(m))}function d(m){if(m!=null&&m.name!=null&&m.kind!=null)switch(m.kind){case gt.TypeKind.SCALAR:return y(m);case gt.TypeKind.OBJECT:return I(m);case gt.TypeKind.INTERFACE:return E(m);case gt.TypeKind.UNION:return L(m);case gt.TypeKind.ENUM:return F(m);case gt.TypeKind.INPUT_OBJECT:return k(m)}let _=(0,Qe.inspect)(m);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${_}.`)}function y(m){return new Ue.GraphQLScalarType({name:m.name,description:m.description,specifiedByURL:m.specifiedByURL})}function T(m){if(m.interfaces===null&&m.kind===gt.TypeKind.INTERFACE)return[];if(!m.interfaces){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing interfaces: ${_}.`)}return m.interfaces.map(f)}function I(m){return new Ue.GraphQLObjectType({name:m.name,description:m.description,interfaces:()=>T(m),fields:()=>P(m)})}function E(m){return new Ue.GraphQLInterfaceType({name:m.name,description:m.description,interfaces:()=>T(m),fields:()=>P(m)})}function L(m){if(!m.possibleTypes){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing possibleTypes: ${_}.`)}return new Ue.GraphQLUnionType({name:m.name,description:m.description,types:()=>m.possibleTypes.map(l)})}function F(m){if(!m.enumValues){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing enumValues: ${_}.`)}return new Ue.GraphQLEnumType({name:m.name,description:m.description,values:(0,Qi.keyValMap)(m.enumValues,_=>_.name,_=>({description:_.description,deprecationReason:_.deprecationReason}))})}function k(m){if(!m.inputFields){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing inputFields: ${_}.`)}return new Ue.GraphQLInputObjectType({name:m.name,description:m.description,fields:()=>C(m.inputFields)})}function P(m){if(!m.fields)throw new Error(`Introspection result missing fields: ${(0,Qe.inspect)(m)}.`);return(0,Qi.keyValMap)(m.fields,_=>_.name,G)}function G(m){let _=u(m.type);if(!(0,Ue.isOutputType)(_)){let oe=(0,Qe.inspect)(_);throw new Error(`Introspection must provide output type for fields, but received: ${oe}.`)}if(!m.args){let oe=(0,Qe.inspect)(m);throw new Error(`Introspection result missing field args: ${oe}.`)}return{description:m.description,deprecationReason:m.deprecationReason,type:_,args:C(m.args)}}function C(m){return(0,Qi.keyValMap)(m,_=>_.name,w)}function w(m){let _=u(m.type);if(!(0,Ue.isInputType)(_)){let $=(0,Qe.inspect)(_);throw new Error(`Introspection must provide input type for arguments, but received: ${$}.`)}let oe=m.defaultValue!=null?(0,fE.valueFromAST)((0,cE.parseValue)(m.defaultValue),_):void 0;return{description:m.description,type:_,defaultValue:oe,deprecationReason:m.deprecationReason}}function V(m){if(!m.args){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing directive args: ${_}.`)}if(!m.locations){let _=(0,Qe.inspect)(m);throw new Error(`Introspection result missing directive locations: ${_}.`)}return new lE.GraphQLDirective({name:m.name,description:m.description,isRepeatable:m.isRepeatable,locations:m.locations.slice(),args:C(m.args)})}}});var Iu=h($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.extendSchema=gE;$i.extendSchemaImpl=od;var yE=Fe(),hE=re(),vE=je(),TE=Ft(),In=Ss(),We=H(),Zp=tr(),pe=Y(),Ki=Ve(),id=Ye(),sd=yt(),ed=Zt(),bE=bn(),ad=Sr(),td=yn();function gE(e,t,r){(0,ed.assertSchema)(e),t!=null&&t.kind===We.Kind.DOCUMENT||(0,yE.devAssert)(!1,"Must provide valid Document AST."),r?.assumeValid!==!0&&r?.assumeValidSDL!==!0&&(0,bE.assertValidSDLExtension)(t,e);let n=e.toConfig(),i=od(n,t,r);return n===i?e:new ed.GraphQLSchema(i)}function od(e,t,r){var n,i,s,a;let o=[],u=Object.create(null),c=[],l,f=[];for(let v of t.definitions)if(v.kind===We.Kind.SCHEMA_DEFINITION)l=v;else if(v.kind===We.Kind.SCHEMA_EXTENSION)f.push(v);else if((0,Zp.isTypeDefinitionNode)(v))o.push(v);else if((0,Zp.isTypeExtensionNode)(v)){let S=v.name.value,N=u[S];u[S]=N?N.concat([v]):[v]}else v.kind===We.Kind.DIRECTIVE_DEFINITION&&c.push(v);if(Object.keys(u).length===0&&o.length===0&&c.length===0&&f.length===0&&l==null)return e;let d=Object.create(null);for(let v of e.types)d[v.name]=F(v);for(let v of o){var y;let S=v.name.value;d[S]=(y=rd[S])!==null&&y!==void 0?y:jt(v)}let T={query:e.query&&E(e.query),mutation:e.mutation&&E(e.mutation),subscription:e.subscription&&E(e.subscription),...l&&oe([l]),...oe(f)};return{description:(n=l)===null||n===void 0||(i=n.description)===null||i===void 0?void 0:i.value,...T,types:Object.values(d),directives:[...e.directives.map(L),...c.map(ye)],extensions:Object.create(null),astNode:(s=l)!==null&&s!==void 0?s:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:(a=r?.assumeValid)!==null&&a!==void 0?a:!1};function I(v){return(0,pe.isListType)(v)?new pe.GraphQLList(I(v.ofType)):(0,pe.isNonNullType)(v)?new pe.GraphQLNonNull(I(v.ofType)):E(v)}function E(v){return d[v.name]}function L(v){let S=v.toConfig();return new Ki.GraphQLDirective({...S,args:(0,In.mapValue)(S.args,_)})}function F(v){if((0,id.isIntrospectionType)(v)||(0,sd.isSpecifiedScalarType)(v))return v;if((0,pe.isScalarType)(v))return G(v);if((0,pe.isObjectType)(v))return C(v);if((0,pe.isInterfaceType)(v))return w(v);if((0,pe.isUnionType)(v))return V(v);if((0,pe.isEnumType)(v))return P(v);if((0,pe.isInputObjectType)(v))return k(v);(0,vE.invariant)(!1,"Unexpected type: "+(0,hE.inspect)(v))}function k(v){var S;let N=v.toConfig(),D=(S=u[N.name])!==null&&S!==void 0?S:[];return new pe.GraphQLInputObjectType({...N,fields:()=>({...(0,In.mapValue)(N.fields,ie=>({...ie,type:I(ie.type)})),...Le(D)}),extensionASTNodes:N.extensionASTNodes.concat(D)})}function P(v){var S;let N=v.toConfig(),D=(S=u[v.name])!==null&&S!==void 0?S:[];return new pe.GraphQLEnumType({...N,values:{...N.values,...xe(D)},extensionASTNodes:N.extensionASTNodes.concat(D)})}function G(v){var S;let N=v.toConfig(),D=(S=u[N.name])!==null&&S!==void 0?S:[],ie=N.specifiedByURL;for(let ce of D){var be;ie=(be=nd(ce))!==null&&be!==void 0?be:ie}return new pe.GraphQLScalarType({...N,specifiedByURL:ie,extensionASTNodes:N.extensionASTNodes.concat(D)})}function C(v){var S;let N=v.toConfig(),D=(S=u[N.name])!==null&&S!==void 0?S:[];return new pe.GraphQLObjectType({...N,interfaces:()=>[...v.getInterfaces().map(E),...Ae(D)],fields:()=>({...(0,In.mapValue)(N.fields,m),...Te(D)}),extensionASTNodes:N.extensionASTNodes.concat(D)})}function w(v){var S;let N=v.toConfig(),D=(S=u[N.name])!==null&&S!==void 0?S:[];return new pe.GraphQLInterfaceType({...N,interfaces:()=>[...v.getInterfaces().map(E),...Ae(D)],fields:()=>({...(0,In.mapValue)(N.fields,m),...Te(D)}),extensionASTNodes:N.extensionASTNodes.concat(D)})}function V(v){var S;let N=v.toConfig(),D=(S=u[N.name])!==null&&S!==void 0?S:[];return new pe.GraphQLUnionType({...N,types:()=>[...v.getTypes().map(E),...Nt(D)],extensionASTNodes:N.extensionASTNodes.concat(D)})}function m(v){return{...v,type:I(v.type),args:v.args&&(0,In.mapValue)(v.args,_)}}function _(v){return{...v,type:I(v.type)}}function oe(v){let S={};for(let D of v){var N;let ie=(N=D.operationTypes)!==null&&N!==void 0?N:[];for(let be of ie)S[be.operation]=$(be.type)}return S}function $(v){var S;let N=v.name.value,D=(S=rd[N])!==null&&S!==void 0?S:d[N];if(D===void 0)throw new Error(`Unknown type: "${N}".`);return D}function X(v){return v.kind===We.Kind.LIST_TYPE?new pe.GraphQLList(X(v.type)):v.kind===We.Kind.NON_NULL_TYPE?new pe.GraphQLNonNull(X(v.type)):$(v)}function ye(v){var S;return new Ki.GraphQLDirective({name:v.name.value,description:(S=v.description)===null||S===void 0?void 0:S.value,locations:v.locations.map(({value:N})=>N),isRepeatable:v.repeatable,args:Ie(v.arguments),astNode:v})}function Te(v){let S=Object.create(null);for(let ie of v){var N;let be=(N=ie.fields)!==null&&N!==void 0?N:[];for(let ce of be){var D;S[ce.name.value]={type:X(ce.type),description:(D=ce.description)===null||D===void 0?void 0:D.value,args:Ie(ce.arguments),deprecationReason:Ui(ce),astNode:ce}}}return S}function Ie(v){let S=v??[],N=Object.create(null);for(let ie of S){var D;let be=X(ie.type);N[ie.name.value]={type:be,description:(D=ie.description)===null||D===void 0?void 0:D.value,defaultValue:(0,td.valueFromAST)(ie.defaultValue,be),deprecationReason:Ui(ie),astNode:ie}}return N}function Le(v){let S=Object.create(null);for(let ie of v){var N;let be=(N=ie.fields)!==null&&N!==void 0?N:[];for(let ce of be){var D;let pr=X(ce.type);S[ce.name.value]={type:pr,description:(D=ce.description)===null||D===void 0?void 0:D.value,defaultValue:(0,td.valueFromAST)(ce.defaultValue,pr),deprecationReason:Ui(ce),astNode:ce}}}return S}function xe(v){let S=Object.create(null);for(let ie of v){var N;let be=(N=ie.values)!==null&&N!==void 0?N:[];for(let ce of be){var D;S[ce.name.value]={description:(D=ce.description)===null||D===void 0?void 0:D.value,deprecationReason:Ui(ce),astNode:ce}}}return S}function Ae(v){return v.flatMap(S=>{var N,D;return(N=(D=S.interfaces)===null||D===void 0?void 0:D.map($))!==null&&N!==void 0?N:[]})}function Nt(v){return v.flatMap(S=>{var N,D;return(N=(D=S.types)===null||D===void 0?void 0:D.map($))!==null&&N!==void 0?N:[]})}function jt(v){var S;let N=v.name.value,D=(S=u[N])!==null&&S!==void 0?S:[];switch(v.kind){case We.Kind.OBJECT_TYPE_DEFINITION:{var ie;let tt=[v,...D];return new pe.GraphQLObjectType({name:N,description:(ie=v.description)===null||ie===void 0?void 0:ie.value,interfaces:()=>Ae(tt),fields:()=>Te(tt),astNode:v,extensionASTNodes:D})}case We.Kind.INTERFACE_TYPE_DEFINITION:{var be;let tt=[v,...D];return new pe.GraphQLInterfaceType({name:N,description:(be=v.description)===null||be===void 0?void 0:be.value,interfaces:()=>Ae(tt),fields:()=>Te(tt),astNode:v,extensionASTNodes:D})}case We.Kind.ENUM_TYPE_DEFINITION:{var ce;let tt=[v,...D];return new pe.GraphQLEnumType({name:N,description:(ce=v.description)===null||ce===void 0?void 0:ce.value,values:xe(tt),astNode:v,extensionASTNodes:D})}case We.Kind.UNION_TYPE_DEFINITION:{var pr;let tt=[v,...D];return new pe.GraphQLUnionType({name:N,description:(pr=v.description)===null||pr===void 0?void 0:pr.value,types:()=>Nt(tt),astNode:v,extensionASTNodes:D})}case We.Kind.SCALAR_TYPE_DEFINITION:{var es;return new pe.GraphQLScalarType({name:N,description:(es=v.description)===null||es===void 0?void 0:es.value,specifiedByURL:nd(v),astNode:v,extensionASTNodes:D})}case We.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var ts;let tt=[v,...D];return new pe.GraphQLInputObjectType({name:N,description:(ts=v.description)===null||ts===void 0?void 0:ts.value,fields:()=>Le(tt),astNode:v,extensionASTNodes:D})}}}}var rd=(0,TE.keyMap)([...sd.specifiedScalarTypes,...id.introspectionTypes],e=>e.name);function Ui(e){let t=(0,ad.getDirectiveValues)(Ki.GraphQLDeprecatedDirective,e);return t?.reason}function nd(e){let t=(0,ad.getDirectiveValues)(Ki.GraphQLSpecifiedByDirective,e);return t?.url}});var cd=h(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.buildASTSchema=ud;Bi.buildSchema=DE;var EE=Fe(),_E=H(),NE=vr(),OE=Ve(),IE=Zt(),LE=bn(),SE=Iu();function ud(e,t){e!=null&&e.kind===_E.Kind.DOCUMENT||(0,EE.devAssert)(!1,"Must provide valid Document AST."),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&(0,LE.assertValidSDL)(e);let r={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},n=(0,SE.extendSchemaImpl)(r,e,t);if(n.astNode==null)for(let s of n.types)switch(s.name){case"Query":n.query=s;break;case"Mutation":n.mutation=s;break;case"Subscription":n.subscription=s;break}let i=[...n.directives,...OE.specifiedDirectives.filter(s=>n.directives.every(a=>a.name!==s.name))];return new IE.GraphQLSchema({...n,directives:i})}function DE(e,t){let r=(0,NE.parse)(e,{noLocation:t?.noLocation,allowLegacyFragmentVariables:t?.allowLegacyFragmentVariables});return ud(r,{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}});var dd=h(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.lexicographicSortSchema=kE;var AE=re(),RE=je(),jE=Kr(),ld=$r(),ke=Y(),PE=Ve(),wE=Ye(),FE=Zt();function kE(e){let t=e.toConfig(),r=(0,jE.keyValMap)(Lu(t.types),d=>d.name,f);return new FE.GraphQLSchema({...t,types:Object.values(r),directives:Lu(t.directives).map(a),query:s(t.query),mutation:s(t.mutation),subscription:s(t.subscription)});function n(d){return(0,ke.isListType)(d)?new ke.GraphQLList(n(d.ofType)):(0,ke.isNonNullType)(d)?new ke.GraphQLNonNull(n(d.ofType)):i(d)}function i(d){return r[d.name]}function s(d){return d&&i(d)}function a(d){let y=d.toConfig();return new PE.GraphQLDirective({...y,locations:pd(y.locations,T=>T),args:o(y.args)})}function o(d){return Yi(d,y=>({...y,type:n(y.type)}))}function u(d){return Yi(d,y=>({...y,type:n(y.type),args:y.args&&o(y.args)}))}function c(d){return Yi(d,y=>({...y,type:n(y.type)}))}function l(d){return Lu(d).map(i)}function f(d){if((0,ke.isScalarType)(d)||(0,wE.isIntrospectionType)(d))return d;if((0,ke.isObjectType)(d)){let y=d.toConfig();return new ke.GraphQLObjectType({...y,interfaces:()=>l(y.interfaces),fields:()=>u(y.fields)})}if((0,ke.isInterfaceType)(d)){let y=d.toConfig();return new ke.GraphQLInterfaceType({...y,interfaces:()=>l(y.interfaces),fields:()=>u(y.fields)})}if((0,ke.isUnionType)(d)){let y=d.toConfig();return new ke.GraphQLUnionType({...y,types:()=>l(y.types)})}if((0,ke.isEnumType)(d)){let y=d.toConfig();return new ke.GraphQLEnumType({...y,values:Yi(y.values,T=>T)})}if((0,ke.isInputObjectType)(d)){let y=d.toConfig();return new ke.GraphQLInputObjectType({...y,fields:()=>c(y.fields)})}(0,RE.invariant)(!1,"Unexpected type: "+(0,AE.inspect)(d))}}function Yi(e,t){let r=Object.create(null);for(let n of Object.keys(e).sort(ld.naturalCompare))r[n]=t(e[n]);return r}function Lu(e){return pd(e,t=>t.name)}function pd(e,t){return e.slice().sort((r,n)=>{let i=t(r),s=t(n);return(0,ld.naturalCompare)(i,s)})}});var bd=h(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.printIntrospectionSchema=QE;Ln.printSchema=CE;Ln.printType=yd;var qE=re(),xE=je(),VE=qr(),Au=H(),Ji=Ce(),jr=Y(),Ru=Ve(),fd=Ye(),ME=yt(),GE=sn();function CE(e){return md(e,t=>!(0,Ru.isSpecifiedDirective)(t),UE)}function QE(e){return md(e,Ru.isSpecifiedDirective,fd.isIntrospectionType)}function UE(e){return!(0,ME.isSpecifiedScalarType)(e)&&!(0,fd.isIntrospectionType)(e)}function md(e,t,r){let n=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(r);return[KE(e),...n.map(s=>WE(s)),...i.map(s=>yd(s))].filter(Boolean).join(` + +`)}function KE(e){if(e.description==null&&$E(e))return;let t=[],r=e.getQueryType();r&&t.push(` query: ${r.name}`);let n=e.getMutationType();n&&t.push(` mutation: ${n.name}`);let i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),Ze(e)+`schema { +${t.join(` +`)} +}`}function $E(e){let t=e.getQueryType();if(t&&t.name!=="Query")return!1;let r=e.getMutationType();if(r&&r.name!=="Mutation")return!1;let n=e.getSubscriptionType();return!(n&&n.name!=="Subscription")}function yd(e){if((0,jr.isScalarType)(e))return BE(e);if((0,jr.isObjectType)(e))return YE(e);if((0,jr.isInterfaceType)(e))return JE(e);if((0,jr.isUnionType)(e))return XE(e);if((0,jr.isEnumType)(e))return HE(e);if((0,jr.isInputObjectType)(e))return zE(e);(0,xE.invariant)(!1,"Unexpected type: "+(0,qE.inspect)(e))}function BE(e){return Ze(e)+`scalar ${e.name}`+ZE(e)}function hd(e){let t=e.getInterfaces();return t.length?" implements "+t.map(r=>r.name).join(" & "):""}function YE(e){return Ze(e)+`type ${e.name}`+hd(e)+vd(e)}function JE(e){return Ze(e)+`interface ${e.name}`+hd(e)+vd(e)}function XE(e){let t=e.getTypes(),r=t.length?" = "+t.join(" | "):"";return Ze(e)+"union "+e.name+r}function HE(e){let t=e.getValues().map((r,n)=>Ze(r," ",!n)+" "+r.name+Pu(r.deprecationReason));return Ze(e)+`enum ${e.name}`+ju(t)}function zE(e){let t=Object.values(e.getFields()).map((r,n)=>Ze(r," ",!n)+" "+Du(r));return Ze(e)+`input ${e.name}`+ju(t)}function vd(e){let t=Object.values(e.getFields()).map((r,n)=>Ze(r," ",!n)+" "+r.name+Td(r.args," ")+": "+String(r.type)+Pu(r.deprecationReason));return ju(t)}function ju(e){return e.length!==0?` { +`+e.join(` +`)+` +}`:""}function Td(e,t=""){return e.length===0?"":e.every(r=>!r.description)?"("+e.map(Du).join(", ")+")":`( +`+e.map((r,n)=>Ze(r," "+t,!n)+" "+t+Du(r)).join(` +`)+` +`+t+")"}function Du(e){let t=(0,GE.astFromValue)(e.defaultValue,e.type),r=e.name+": "+String(e.type);return t&&(r+=` = ${(0,Ji.print)(t)}`),r+Pu(e.deprecationReason)}function WE(e){return Ze(e)+"directive @"+e.name+Td(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function Pu(e){return e==null?"":e!==Ru.DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${(0,Ji.print)({kind:Au.Kind.STRING,value:e})})`:" @deprecated"}function ZE(e){return e.specifiedByURL==null?"":` @specifiedBy(url: ${(0,Ji.print)({kind:Au.Kind.STRING,value:e.specifiedByURL})})`}function Ze(e,t="",r=!0){let{description:n}=e;if(n==null)return"";let i=(0,Ji.print)({kind:Au.Kind.STRING,value:n,block:(0,VE.isPrintableAsBlockString)(n)});return(t&&!r?` +`+t:t)+i.replace(/\n/g,` +`+t)+` +`}});var gd=h(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.concatAST=t_;var e_=H();function t_(e){let t=[];for(let r of e)t.push(...r.definitions);return{kind:e_.Kind.DOCUMENT,definitions:t}}});var Nd=h(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.separateOperations=n_;var Xi=H(),r_=Yt();function n_(e){let t=[],r=Object.create(null);for(let i of e.definitions)switch(i.kind){case Xi.Kind.OPERATION_DEFINITION:t.push(i);break;case Xi.Kind.FRAGMENT_DEFINITION:r[i.name.value]=Ed(i.selectionSet);break;default:}let n=Object.create(null);for(let i of t){let s=new Set;for(let o of Ed(i.selectionSet))_d(s,r,o);let a=i.name?i.name.value:"";n[a]={kind:Xi.Kind.DOCUMENT,definitions:e.definitions.filter(o=>o===i||o.kind===Xi.Kind.FRAGMENT_DEFINITION&&s.has(o.name.value))}}return n}function _d(e,t,r){if(!e.has(r)){e.add(r);let n=t[r];if(n!==void 0)for(let i of n)_d(e,t,i)}}function Ed(e){let t=[];return(0,r_.visit)(e,{FragmentSpread(r){t.push(r.name.value)}}),t}});var Ld=h(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.stripIgnoredCharacters=s_;var i_=qr(),Od=Mn(),Id=Un(),ku=Vr();function s_(e){let t=(0,Id.isSource)(e)?e:new Id.Source(e),r=t.body,n=new Od.Lexer(t),i="",s=!1;for(;n.advance().kind!==ku.TokenKind.EOF;){let a=n.token,o=a.kind,u=!(0,Od.isPunctuatorTokenKind)(a.kind);s&&(u||a.kind===ku.TokenKind.SPREAD)&&(i+=" ");let c=r.slice(a.start,a.end);o===ku.TokenKind.BLOCK_STRING?i+=(0,i_.printBlockString)(a.value,{minimize:!0}):i+=c,s=u}return i}});var Dd=h(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.assertValidName=c_;Hi.isValidNameError=Sd;var a_=Fe(),o_=q(),u_=Br();function c_(e){let t=Sd(e);if(t)throw t;return e}function Sd(e){if(typeof e=="string"||(0,a_.devAssert)(!1,"Expected name to be a string."),e.startsWith("__"))return new o_.GraphQLError(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,u_.assertName)(e)}catch(t){return t}}});var qd=h(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.DangerousChangeType=Et.BreakingChangeType=void 0;Et.findBreakingChanges=y_;Et.findDangerousChanges=h_;var l_=re(),Fd=je(),Ad=Ft(),p_=Ce(),Z=Y(),d_=yt(),f_=sn(),m_=Ga(),me;Et.BreakingChangeType=me;(function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(me||(Et.BreakingChangeType=me={}));var ct;Et.DangerousChangeType=ct;(function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(ct||(Et.DangerousChangeType=ct={}));function y_(e,t){return kd(e,t).filter(r=>r.type in me)}function h_(e,t){return kd(e,t).filter(r=>r.type in ct)}function kd(e,t){return[...T_(e,t),...v_(e,t)]}function v_(e,t){let r=[],n=At(e.getDirectives(),t.getDirectives());for(let i of n.removed)r.push({type:me.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(let[i,s]of n.persisted){let a=At(i.args,s.args);for(let o of a.added)(0,Z.isRequiredArgument)(o)&&r.push({type:me.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${o.name} on directive ${i.name} was added.`});for(let o of a.removed)r.push({type:me.DIRECTIVE_ARG_REMOVED,description:`${o.name} was removed from ${i.name}.`});i.isRepeatable&&!s.isRepeatable&&r.push({type:me.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(let o of i.locations)s.locations.includes(o)||r.push({type:me.DIRECTIVE_LOCATION_REMOVED,description:`${o} was removed from ${i.name}.`})}return r}function T_(e,t){let r=[],n=At(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let i of n.removed)r.push({type:me.TYPE_REMOVED,description:(0,d_.isSpecifiedScalarType)(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(let[i,s]of n.persisted)(0,Z.isEnumType)(i)&&(0,Z.isEnumType)(s)?r.push(...E_(i,s)):(0,Z.isUnionType)(i)&&(0,Z.isUnionType)(s)?r.push(...g_(i,s)):(0,Z.isInputObjectType)(i)&&(0,Z.isInputObjectType)(s)?r.push(...b_(i,s)):(0,Z.isObjectType)(i)&&(0,Z.isObjectType)(s)?r.push(...jd(i,s),...Rd(i,s)):(0,Z.isInterfaceType)(i)&&(0,Z.isInterfaceType)(s)?r.push(...jd(i,s),...Rd(i,s)):i.constructor!==s.constructor&&r.push({type:me.TYPE_CHANGED_KIND,description:`${i.name} changed from ${Pd(i)} to ${Pd(s)}.`});return r}function b_(e,t){let r=[],n=At(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of n.added)(0,Z.isRequiredInputField)(i)?r.push({type:me.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${e.name} was added.`}):r.push({type:ct.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${e.name} was added.`});for(let i of n.removed)r.push({type:me.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,s]of n.persisted)Dn(i.type,s.type)||r.push({type:me.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return r}function g_(e,t){let r=[],n=At(e.getTypes(),t.getTypes());for(let i of n.added)r.push({type:ct.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${e.name}.`});for(let i of n.removed)r.push({type:me.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${e.name}.`});return r}function E_(e,t){let r=[],n=At(e.getValues(),t.getValues());for(let i of n.added)r.push({type:ct.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${e.name}.`});for(let i of n.removed)r.push({type:me.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${e.name}.`});return r}function Rd(e,t){let r=[],n=At(e.getInterfaces(),t.getInterfaces());for(let i of n.added)r.push({type:ct.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${e.name}.`});for(let i of n.removed)r.push({type:me.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${i.name}.`});return r}function jd(e,t){let r=[],n=At(Object.values(e.getFields()),Object.values(t.getFields()));for(let i of n.removed)r.push({type:me.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(let[i,s]of n.persisted)r.push(...__(e,i,s)),Sn(i.type,s.type)||r.push({type:me.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return r}function __(e,t,r){let n=[],i=At(t.args,r.args);for(let s of i.removed)n.push({type:me.ARG_REMOVED,description:`${e.name}.${t.name} arg ${s.name} was removed.`});for(let[s,a]of i.persisted)if(!Dn(s.type,a.type))n.push({type:me.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${s.name} has changed type from ${String(s.type)} to ${String(a.type)}.`});else if(s.defaultValue!==void 0)if(a.defaultValue===void 0)n.push({type:ct.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${s.name} defaultValue was removed.`});else{let u=wd(s.defaultValue,s.type),c=wd(a.defaultValue,a.type);u!==c&&n.push({type:ct.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${s.name} has changed defaultValue from ${u} to ${c}.`})}for(let s of i.added)(0,Z.isRequiredArgument)(s)?n.push({type:me.REQUIRED_ARG_ADDED,description:`A required arg ${s.name} on ${e.name}.${t.name} was added.`}):n.push({type:ct.OPTIONAL_ARG_ADDED,description:`An optional arg ${s.name} on ${e.name}.${t.name} was added.`});return n}function Sn(e,t){return(0,Z.isListType)(e)?(0,Z.isListType)(t)&&Sn(e.ofType,t.ofType)||(0,Z.isNonNullType)(t)&&Sn(e,t.ofType):(0,Z.isNonNullType)(e)?(0,Z.isNonNullType)(t)&&Sn(e.ofType,t.ofType):(0,Z.isNamedType)(t)&&e.name===t.name||(0,Z.isNonNullType)(t)&&Sn(e,t.ofType)}function Dn(e,t){return(0,Z.isListType)(e)?(0,Z.isListType)(t)&&Dn(e.ofType,t.ofType):(0,Z.isNonNullType)(e)?(0,Z.isNonNullType)(t)&&Dn(e.ofType,t.ofType)||!(0,Z.isNonNullType)(t)&&Dn(e.ofType,t):(0,Z.isNamedType)(t)&&e.name===t.name}function Pd(e){if((0,Z.isScalarType)(e))return"a Scalar type";if((0,Z.isObjectType)(e))return"an Object type";if((0,Z.isInterfaceType)(e))return"an Interface type";if((0,Z.isUnionType)(e))return"a Union type";if((0,Z.isEnumType)(e))return"an Enum type";if((0,Z.isInputObjectType)(e))return"an Input type";(0,Fd.invariant)(!1,"Unexpected type: "+(0,l_.inspect)(e))}function wd(e,t){let r=(0,f_.astFromValue)(e,t);return r!=null||(0,Fd.invariant)(!1),(0,p_.print)((0,m_.sortValueNode)(r))}function At(e,t){let r=[],n=[],i=[],s=(0,Ad.keyMap)(e,({name:o})=>o),a=(0,Ad.keyMap)(t,({name:o})=>o);for(let o of e){let u=a[o.name];u===void 0?n.push(o):i.push([o,u])}for(let o of t)s[o.name]===void 0&&r.push(o);return{added:r,persisted:i,removed:n}}});var Gd=h(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});Object.defineProperty(W,"BreakingChangeType",{enumerable:!0,get:function(){return zi.BreakingChangeType}});Object.defineProperty(W,"DangerousChangeType",{enumerable:!0,get:function(){return zi.DangerousChangeType}});Object.defineProperty(W,"TypeInfo",{enumerable:!0,get:function(){return Vd.TypeInfo}});Object.defineProperty(W,"assertValidName",{enumerable:!0,get:function(){return Md.assertValidName}});Object.defineProperty(W,"astFromValue",{enumerable:!0,get:function(){return w_.astFromValue}});Object.defineProperty(W,"buildASTSchema",{enumerable:!0,get:function(){return xd.buildASTSchema}});Object.defineProperty(W,"buildClientSchema",{enumerable:!0,get:function(){return S_.buildClientSchema}});Object.defineProperty(W,"buildSchema",{enumerable:!0,get:function(){return xd.buildSchema}});Object.defineProperty(W,"coerceInputValue",{enumerable:!0,get:function(){return F_.coerceInputValue}});Object.defineProperty(W,"concatAST",{enumerable:!0,get:function(){return k_.concatAST}});Object.defineProperty(W,"doTypesOverlap",{enumerable:!0,get:function(){return Vu.doTypesOverlap}});Object.defineProperty(W,"extendSchema",{enumerable:!0,get:function(){return D_.extendSchema}});Object.defineProperty(W,"findBreakingChanges",{enumerable:!0,get:function(){return zi.findBreakingChanges}});Object.defineProperty(W,"findDangerousChanges",{enumerable:!0,get:function(){return zi.findDangerousChanges}});Object.defineProperty(W,"getIntrospectionQuery",{enumerable:!0,get:function(){return N_.getIntrospectionQuery}});Object.defineProperty(W,"getOperationAST",{enumerable:!0,get:function(){return O_.getOperationAST}});Object.defineProperty(W,"getOperationRootType",{enumerable:!0,get:function(){return I_.getOperationRootType}});Object.defineProperty(W,"introspectionFromSchema",{enumerable:!0,get:function(){return L_.introspectionFromSchema}});Object.defineProperty(W,"isEqualType",{enumerable:!0,get:function(){return Vu.isEqualType}});Object.defineProperty(W,"isTypeSubTypeOf",{enumerable:!0,get:function(){return Vu.isTypeSubTypeOf}});Object.defineProperty(W,"isValidNameError",{enumerable:!0,get:function(){return Md.isValidNameError}});Object.defineProperty(W,"lexicographicSortSchema",{enumerable:!0,get:function(){return A_.lexicographicSortSchema}});Object.defineProperty(W,"printIntrospectionSchema",{enumerable:!0,get:function(){return xu.printIntrospectionSchema}});Object.defineProperty(W,"printSchema",{enumerable:!0,get:function(){return xu.printSchema}});Object.defineProperty(W,"printType",{enumerable:!0,get:function(){return xu.printType}});Object.defineProperty(W,"separateOperations",{enumerable:!0,get:function(){return q_.separateOperations}});Object.defineProperty(W,"stripIgnoredCharacters",{enumerable:!0,get:function(){return x_.stripIgnoredCharacters}});Object.defineProperty(W,"typeFromAST",{enumerable:!0,get:function(){return R_.typeFromAST}});Object.defineProperty(W,"valueFromAST",{enumerable:!0,get:function(){return j_.valueFromAST}});Object.defineProperty(W,"valueFromASTUntyped",{enumerable:!0,get:function(){return P_.valueFromASTUntyped}});Object.defineProperty(W,"visitWithTypeInfo",{enumerable:!0,get:function(){return Vd.visitWithTypeInfo}});var N_=gu(),O_=Jp(),I_=Xp(),L_=Hp(),S_=Wp(),xd=cd(),D_=Iu(),A_=dd(),xu=bd(),R_=ht(),j_=yn(),P_=Vs(),w_=sn(),Vd=vi(),F_=ao(),k_=gd(),q_=Nd(),x_=Ld(),Vu=zr(),Md=Dd(),zi=qd()});var Ud=h(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});Object.defineProperty(p,"BREAK",{enumerable:!0,get:function(){return ee.BREAK}});Object.defineProperty(p,"BreakingChangeType",{enumerable:!0,get:function(){return te.BreakingChangeType}});Object.defineProperty(p,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return g.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(p,"DangerousChangeType",{enumerable:!0,get:function(){return te.DangerousChangeType}});Object.defineProperty(p,"DirectiveLocation",{enumerable:!0,get:function(){return ee.DirectiveLocation}});Object.defineProperty(p,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return K.ExecutableDefinitionsRule}});Object.defineProperty(p,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return K.FieldsOnCorrectTypeRule}});Object.defineProperty(p,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return K.FragmentsOnCompositeTypesRule}});Object.defineProperty(p,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return g.GRAPHQL_MAX_INT}});Object.defineProperty(p,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return g.GRAPHQL_MIN_INT}});Object.defineProperty(p,"GraphQLBoolean",{enumerable:!0,get:function(){return g.GraphQLBoolean}});Object.defineProperty(p,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return g.GraphQLDeprecatedDirective}});Object.defineProperty(p,"GraphQLDirective",{enumerable:!0,get:function(){return g.GraphQLDirective}});Object.defineProperty(p,"GraphQLEnumType",{enumerable:!0,get:function(){return g.GraphQLEnumType}});Object.defineProperty(p,"GraphQLError",{enumerable:!0,get:function(){return An.GraphQLError}});Object.defineProperty(p,"GraphQLFloat",{enumerable:!0,get:function(){return g.GraphQLFloat}});Object.defineProperty(p,"GraphQLID",{enumerable:!0,get:function(){return g.GraphQLID}});Object.defineProperty(p,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return g.GraphQLIncludeDirective}});Object.defineProperty(p,"GraphQLInputObjectType",{enumerable:!0,get:function(){return g.GraphQLInputObjectType}});Object.defineProperty(p,"GraphQLInt",{enumerable:!0,get:function(){return g.GraphQLInt}});Object.defineProperty(p,"GraphQLInterfaceType",{enumerable:!0,get:function(){return g.GraphQLInterfaceType}});Object.defineProperty(p,"GraphQLList",{enumerable:!0,get:function(){return g.GraphQLList}});Object.defineProperty(p,"GraphQLNonNull",{enumerable:!0,get:function(){return g.GraphQLNonNull}});Object.defineProperty(p,"GraphQLObjectType",{enumerable:!0,get:function(){return g.GraphQLObjectType}});Object.defineProperty(p,"GraphQLScalarType",{enumerable:!0,get:function(){return g.GraphQLScalarType}});Object.defineProperty(p,"GraphQLSchema",{enumerable:!0,get:function(){return g.GraphQLSchema}});Object.defineProperty(p,"GraphQLSkipDirective",{enumerable:!0,get:function(){return g.GraphQLSkipDirective}});Object.defineProperty(p,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return g.GraphQLSpecifiedByDirective}});Object.defineProperty(p,"GraphQLString",{enumerable:!0,get:function(){return g.GraphQLString}});Object.defineProperty(p,"GraphQLUnionType",{enumerable:!0,get:function(){return g.GraphQLUnionType}});Object.defineProperty(p,"Kind",{enumerable:!0,get:function(){return ee.Kind}});Object.defineProperty(p,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return K.KnownArgumentNamesRule}});Object.defineProperty(p,"KnownDirectivesRule",{enumerable:!0,get:function(){return K.KnownDirectivesRule}});Object.defineProperty(p,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return K.KnownFragmentNamesRule}});Object.defineProperty(p,"KnownTypeNamesRule",{enumerable:!0,get:function(){return K.KnownTypeNamesRule}});Object.defineProperty(p,"Lexer",{enumerable:!0,get:function(){return ee.Lexer}});Object.defineProperty(p,"Location",{enumerable:!0,get:function(){return ee.Location}});Object.defineProperty(p,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return K.LoneAnonymousOperationRule}});Object.defineProperty(p,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return K.LoneSchemaDefinitionRule}});Object.defineProperty(p,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return K.NoDeprecatedCustomRule}});Object.defineProperty(p,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return K.NoFragmentCyclesRule}});Object.defineProperty(p,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return K.NoSchemaIntrospectionCustomRule}});Object.defineProperty(p,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return K.NoUndefinedVariablesRule}});Object.defineProperty(p,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return K.NoUnusedFragmentsRule}});Object.defineProperty(p,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return K.NoUnusedVariablesRule}});Object.defineProperty(p,"OperationTypeNode",{enumerable:!0,get:function(){return ee.OperationTypeNode}});Object.defineProperty(p,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return K.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(p,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return K.PossibleFragmentSpreadsRule}});Object.defineProperty(p,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return K.PossibleTypeExtensionsRule}});Object.defineProperty(p,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return K.ProvidedRequiredArgumentsRule}});Object.defineProperty(p,"ScalarLeafsRule",{enumerable:!0,get:function(){return K.ScalarLeafsRule}});Object.defineProperty(p,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return g.SchemaMetaFieldDef}});Object.defineProperty(p,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return K.SingleFieldSubscriptionsRule}});Object.defineProperty(p,"Source",{enumerable:!0,get:function(){return ee.Source}});Object.defineProperty(p,"Token",{enumerable:!0,get:function(){return ee.Token}});Object.defineProperty(p,"TokenKind",{enumerable:!0,get:function(){return ee.TokenKind}});Object.defineProperty(p,"TypeInfo",{enumerable:!0,get:function(){return te.TypeInfo}});Object.defineProperty(p,"TypeKind",{enumerable:!0,get:function(){return g.TypeKind}});Object.defineProperty(p,"TypeMetaFieldDef",{enumerable:!0,get:function(){return g.TypeMetaFieldDef}});Object.defineProperty(p,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return g.TypeNameMetaFieldDef}});Object.defineProperty(p,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return K.UniqueArgumentDefinitionNamesRule}});Object.defineProperty(p,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return K.UniqueArgumentNamesRule}});Object.defineProperty(p,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return K.UniqueDirectiveNamesRule}});Object.defineProperty(p,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return K.UniqueDirectivesPerLocationRule}});Object.defineProperty(p,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return K.UniqueEnumValueNamesRule}});Object.defineProperty(p,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return K.UniqueFieldDefinitionNamesRule}});Object.defineProperty(p,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return K.UniqueFragmentNamesRule}});Object.defineProperty(p,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return K.UniqueInputFieldNamesRule}});Object.defineProperty(p,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return K.UniqueOperationNamesRule}});Object.defineProperty(p,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return K.UniqueOperationTypesRule}});Object.defineProperty(p,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return K.UniqueTypeNamesRule}});Object.defineProperty(p,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return K.UniqueVariableNamesRule}});Object.defineProperty(p,"ValidationContext",{enumerable:!0,get:function(){return K.ValidationContext}});Object.defineProperty(p,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return K.ValuesOfCorrectTypeRule}});Object.defineProperty(p,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return K.VariablesAreInputTypesRule}});Object.defineProperty(p,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return K.VariablesInAllowedPositionRule}});Object.defineProperty(p,"__Directive",{enumerable:!0,get:function(){return g.__Directive}});Object.defineProperty(p,"__DirectiveLocation",{enumerable:!0,get:function(){return g.__DirectiveLocation}});Object.defineProperty(p,"__EnumValue",{enumerable:!0,get:function(){return g.__EnumValue}});Object.defineProperty(p,"__Field",{enumerable:!0,get:function(){return g.__Field}});Object.defineProperty(p,"__InputValue",{enumerable:!0,get:function(){return g.__InputValue}});Object.defineProperty(p,"__Schema",{enumerable:!0,get:function(){return g.__Schema}});Object.defineProperty(p,"__Type",{enumerable:!0,get:function(){return g.__Type}});Object.defineProperty(p,"__TypeKind",{enumerable:!0,get:function(){return g.__TypeKind}});Object.defineProperty(p,"assertAbstractType",{enumerable:!0,get:function(){return g.assertAbstractType}});Object.defineProperty(p,"assertCompositeType",{enumerable:!0,get:function(){return g.assertCompositeType}});Object.defineProperty(p,"assertDirective",{enumerable:!0,get:function(){return g.assertDirective}});Object.defineProperty(p,"assertEnumType",{enumerable:!0,get:function(){return g.assertEnumType}});Object.defineProperty(p,"assertEnumValueName",{enumerable:!0,get:function(){return g.assertEnumValueName}});Object.defineProperty(p,"assertInputObjectType",{enumerable:!0,get:function(){return g.assertInputObjectType}});Object.defineProperty(p,"assertInputType",{enumerable:!0,get:function(){return g.assertInputType}});Object.defineProperty(p,"assertInterfaceType",{enumerable:!0,get:function(){return g.assertInterfaceType}});Object.defineProperty(p,"assertLeafType",{enumerable:!0,get:function(){return g.assertLeafType}});Object.defineProperty(p,"assertListType",{enumerable:!0,get:function(){return g.assertListType}});Object.defineProperty(p,"assertName",{enumerable:!0,get:function(){return g.assertName}});Object.defineProperty(p,"assertNamedType",{enumerable:!0,get:function(){return g.assertNamedType}});Object.defineProperty(p,"assertNonNullType",{enumerable:!0,get:function(){return g.assertNonNullType}});Object.defineProperty(p,"assertNullableType",{enumerable:!0,get:function(){return g.assertNullableType}});Object.defineProperty(p,"assertObjectType",{enumerable:!0,get:function(){return g.assertObjectType}});Object.defineProperty(p,"assertOutputType",{enumerable:!0,get:function(){return g.assertOutputType}});Object.defineProperty(p,"assertScalarType",{enumerable:!0,get:function(){return g.assertScalarType}});Object.defineProperty(p,"assertSchema",{enumerable:!0,get:function(){return g.assertSchema}});Object.defineProperty(p,"assertType",{enumerable:!0,get:function(){return g.assertType}});Object.defineProperty(p,"assertUnionType",{enumerable:!0,get:function(){return g.assertUnionType}});Object.defineProperty(p,"assertValidName",{enumerable:!0,get:function(){return te.assertValidName}});Object.defineProperty(p,"assertValidSchema",{enumerable:!0,get:function(){return g.assertValidSchema}});Object.defineProperty(p,"assertWrappingType",{enumerable:!0,get:function(){return g.assertWrappingType}});Object.defineProperty(p,"astFromValue",{enumerable:!0,get:function(){return te.astFromValue}});Object.defineProperty(p,"buildASTSchema",{enumerable:!0,get:function(){return te.buildASTSchema}});Object.defineProperty(p,"buildClientSchema",{enumerable:!0,get:function(){return te.buildClientSchema}});Object.defineProperty(p,"buildSchema",{enumerable:!0,get:function(){return te.buildSchema}});Object.defineProperty(p,"coerceInputValue",{enumerable:!0,get:function(){return te.coerceInputValue}});Object.defineProperty(p,"concatAST",{enumerable:!0,get:function(){return te.concatAST}});Object.defineProperty(p,"createSourceEventStream",{enumerable:!0,get:function(){return _t.createSourceEventStream}});Object.defineProperty(p,"defaultFieldResolver",{enumerable:!0,get:function(){return _t.defaultFieldResolver}});Object.defineProperty(p,"defaultTypeResolver",{enumerable:!0,get:function(){return _t.defaultTypeResolver}});Object.defineProperty(p,"doTypesOverlap",{enumerable:!0,get:function(){return te.doTypesOverlap}});Object.defineProperty(p,"execute",{enumerable:!0,get:function(){return _t.execute}});Object.defineProperty(p,"executeSync",{enumerable:!0,get:function(){return _t.executeSync}});Object.defineProperty(p,"extendSchema",{enumerable:!0,get:function(){return te.extendSchema}});Object.defineProperty(p,"findBreakingChanges",{enumerable:!0,get:function(){return te.findBreakingChanges}});Object.defineProperty(p,"findDangerousChanges",{enumerable:!0,get:function(){return te.findDangerousChanges}});Object.defineProperty(p,"formatError",{enumerable:!0,get:function(){return An.formatError}});Object.defineProperty(p,"getArgumentValues",{enumerable:!0,get:function(){return _t.getArgumentValues}});Object.defineProperty(p,"getDirectiveValues",{enumerable:!0,get:function(){return _t.getDirectiveValues}});Object.defineProperty(p,"getEnterLeaveForKind",{enumerable:!0,get:function(){return ee.getEnterLeaveForKind}});Object.defineProperty(p,"getIntrospectionQuery",{enumerable:!0,get:function(){return te.getIntrospectionQuery}});Object.defineProperty(p,"getLocation",{enumerable:!0,get:function(){return ee.getLocation}});Object.defineProperty(p,"getNamedType",{enumerable:!0,get:function(){return g.getNamedType}});Object.defineProperty(p,"getNullableType",{enumerable:!0,get:function(){return g.getNullableType}});Object.defineProperty(p,"getOperationAST",{enumerable:!0,get:function(){return te.getOperationAST}});Object.defineProperty(p,"getOperationRootType",{enumerable:!0,get:function(){return te.getOperationRootType}});Object.defineProperty(p,"getVariableValues",{enumerable:!0,get:function(){return _t.getVariableValues}});Object.defineProperty(p,"getVisitFn",{enumerable:!0,get:function(){return ee.getVisitFn}});Object.defineProperty(p,"graphql",{enumerable:!0,get:function(){return Qd.graphql}});Object.defineProperty(p,"graphqlSync",{enumerable:!0,get:function(){return Qd.graphqlSync}});Object.defineProperty(p,"introspectionFromSchema",{enumerable:!0,get:function(){return te.introspectionFromSchema}});Object.defineProperty(p,"introspectionTypes",{enumerable:!0,get:function(){return g.introspectionTypes}});Object.defineProperty(p,"isAbstractType",{enumerable:!0,get:function(){return g.isAbstractType}});Object.defineProperty(p,"isCompositeType",{enumerable:!0,get:function(){return g.isCompositeType}});Object.defineProperty(p,"isConstValueNode",{enumerable:!0,get:function(){return ee.isConstValueNode}});Object.defineProperty(p,"isDefinitionNode",{enumerable:!0,get:function(){return ee.isDefinitionNode}});Object.defineProperty(p,"isDirective",{enumerable:!0,get:function(){return g.isDirective}});Object.defineProperty(p,"isEnumType",{enumerable:!0,get:function(){return g.isEnumType}});Object.defineProperty(p,"isEqualType",{enumerable:!0,get:function(){return te.isEqualType}});Object.defineProperty(p,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return ee.isExecutableDefinitionNode}});Object.defineProperty(p,"isInputObjectType",{enumerable:!0,get:function(){return g.isInputObjectType}});Object.defineProperty(p,"isInputType",{enumerable:!0,get:function(){return g.isInputType}});Object.defineProperty(p,"isInterfaceType",{enumerable:!0,get:function(){return g.isInterfaceType}});Object.defineProperty(p,"isIntrospectionType",{enumerable:!0,get:function(){return g.isIntrospectionType}});Object.defineProperty(p,"isLeafType",{enumerable:!0,get:function(){return g.isLeafType}});Object.defineProperty(p,"isListType",{enumerable:!0,get:function(){return g.isListType}});Object.defineProperty(p,"isNamedType",{enumerable:!0,get:function(){return g.isNamedType}});Object.defineProperty(p,"isNonNullType",{enumerable:!0,get:function(){return g.isNonNullType}});Object.defineProperty(p,"isNullableType",{enumerable:!0,get:function(){return g.isNullableType}});Object.defineProperty(p,"isObjectType",{enumerable:!0,get:function(){return g.isObjectType}});Object.defineProperty(p,"isOutputType",{enumerable:!0,get:function(){return g.isOutputType}});Object.defineProperty(p,"isRequiredArgument",{enumerable:!0,get:function(){return g.isRequiredArgument}});Object.defineProperty(p,"isRequiredInputField",{enumerable:!0,get:function(){return g.isRequiredInputField}});Object.defineProperty(p,"isScalarType",{enumerable:!0,get:function(){return g.isScalarType}});Object.defineProperty(p,"isSchema",{enumerable:!0,get:function(){return g.isSchema}});Object.defineProperty(p,"isSelectionNode",{enumerable:!0,get:function(){return ee.isSelectionNode}});Object.defineProperty(p,"isSpecifiedDirective",{enumerable:!0,get:function(){return g.isSpecifiedDirective}});Object.defineProperty(p,"isSpecifiedScalarType",{enumerable:!0,get:function(){return g.isSpecifiedScalarType}});Object.defineProperty(p,"isType",{enumerable:!0,get:function(){return g.isType}});Object.defineProperty(p,"isTypeDefinitionNode",{enumerable:!0,get:function(){return ee.isTypeDefinitionNode}});Object.defineProperty(p,"isTypeExtensionNode",{enumerable:!0,get:function(){return ee.isTypeExtensionNode}});Object.defineProperty(p,"isTypeNode",{enumerable:!0,get:function(){return ee.isTypeNode}});Object.defineProperty(p,"isTypeSubTypeOf",{enumerable:!0,get:function(){return te.isTypeSubTypeOf}});Object.defineProperty(p,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return ee.isTypeSystemDefinitionNode}});Object.defineProperty(p,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return ee.isTypeSystemExtensionNode}});Object.defineProperty(p,"isUnionType",{enumerable:!0,get:function(){return g.isUnionType}});Object.defineProperty(p,"isValidNameError",{enumerable:!0,get:function(){return te.isValidNameError}});Object.defineProperty(p,"isValueNode",{enumerable:!0,get:function(){return ee.isValueNode}});Object.defineProperty(p,"isWrappingType",{enumerable:!0,get:function(){return g.isWrappingType}});Object.defineProperty(p,"lexicographicSortSchema",{enumerable:!0,get:function(){return te.lexicographicSortSchema}});Object.defineProperty(p,"locatedError",{enumerable:!0,get:function(){return An.locatedError}});Object.defineProperty(p,"parse",{enumerable:!0,get:function(){return ee.parse}});Object.defineProperty(p,"parseConstValue",{enumerable:!0,get:function(){return ee.parseConstValue}});Object.defineProperty(p,"parseType",{enumerable:!0,get:function(){return ee.parseType}});Object.defineProperty(p,"parseValue",{enumerable:!0,get:function(){return ee.parseValue}});Object.defineProperty(p,"print",{enumerable:!0,get:function(){return ee.print}});Object.defineProperty(p,"printError",{enumerable:!0,get:function(){return An.printError}});Object.defineProperty(p,"printIntrospectionSchema",{enumerable:!0,get:function(){return te.printIntrospectionSchema}});Object.defineProperty(p,"printLocation",{enumerable:!0,get:function(){return ee.printLocation}});Object.defineProperty(p,"printSchema",{enumerable:!0,get:function(){return te.printSchema}});Object.defineProperty(p,"printSourceLocation",{enumerable:!0,get:function(){return ee.printSourceLocation}});Object.defineProperty(p,"printType",{enumerable:!0,get:function(){return te.printType}});Object.defineProperty(p,"resolveObjMapThunk",{enumerable:!0,get:function(){return g.resolveObjMapThunk}});Object.defineProperty(p,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return g.resolveReadonlyArrayThunk}});Object.defineProperty(p,"responsePathAsArray",{enumerable:!0,get:function(){return _t.responsePathAsArray}});Object.defineProperty(p,"separateOperations",{enumerable:!0,get:function(){return te.separateOperations}});Object.defineProperty(p,"specifiedDirectives",{enumerable:!0,get:function(){return g.specifiedDirectives}});Object.defineProperty(p,"specifiedRules",{enumerable:!0,get:function(){return K.specifiedRules}});Object.defineProperty(p,"specifiedScalarTypes",{enumerable:!0,get:function(){return g.specifiedScalarTypes}});Object.defineProperty(p,"stripIgnoredCharacters",{enumerable:!0,get:function(){return te.stripIgnoredCharacters}});Object.defineProperty(p,"subscribe",{enumerable:!0,get:function(){return _t.subscribe}});Object.defineProperty(p,"syntaxError",{enumerable:!0,get:function(){return An.syntaxError}});Object.defineProperty(p,"typeFromAST",{enumerable:!0,get:function(){return te.typeFromAST}});Object.defineProperty(p,"validate",{enumerable:!0,get:function(){return K.validate}});Object.defineProperty(p,"validateSchema",{enumerable:!0,get:function(){return g.validateSchema}});Object.defineProperty(p,"valueFromAST",{enumerable:!0,get:function(){return te.valueFromAST}});Object.defineProperty(p,"valueFromASTUntyped",{enumerable:!0,get:function(){return te.valueFromASTUntyped}});Object.defineProperty(p,"version",{enumerable:!0,get:function(){return Cd.version}});Object.defineProperty(p,"versionInfo",{enumerable:!0,get:function(){return Cd.versionInfo}});Object.defineProperty(p,"visit",{enumerable:!0,get:function(){return ee.visit}});Object.defineProperty(p,"visitInParallel",{enumerable:!0,get:function(){return ee.visitInParallel}});Object.defineProperty(p,"visitWithTypeInfo",{enumerable:!0,get:function(){return te.visitWithTypeInfo}});var Cd=Gu(),Qd=Rp(),g=wp(),ee=kp(),_t=Up(),K=Bp(),An=Yp(),te=Gd()});var Yd=h(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.isExecutionResult=Pr.createHandler=void 0;var Rn=Ud(),$d=Pn(),et=dr();function V_(e){let{validate:t=Rn.validate,execute:r=Rn.execute,subscribe:n=Rn.subscribe,schema:i,authenticate:s=function(E){var L;let F=E.headers.get(et.TOKEN_HEADER_KEY);if(F)return Array.isArray(F)?F.join(""):F;let k=new URL((L=E.url)!==null&&L!==void 0?L:"","http://localhost/").searchParams.get(et.TOKEN_QUERY_KEY);return k||"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,P=>{let G=Math.random()*16|0;return(P=="x"?G:G&3|8).toString(16)})},onConnect:a,context:o,onSubscribe:u,onOperation:c,onNext:l,onComplete:f}=e,d={};function y(I){let E={},L,F=(()=>{let P=[],G={done:!1,error:null,resolve:()=>{}};async function C(){clearInterval(L),typeof I=="string"&&delete d[I];for(let V of Object.values(E))(0,et.isAsyncGenerator)(V)&&await V.return(void 0)}let w=async function*(){for(;;){for(P.length||await new Promise(m=>G.resolve=m);P.length;)yield P.shift();if(G.error)throw G.error;if(G.done)return}}();return w.throw=async V=>(G.done||(G.done=!0,G.error=V,G.resolve(),await C()),{done:!0,value:void 0}),w.return=async()=>(G.done||(G.done=!0,G.resolve(),await C()),{done:!0,value:void 0}),{next(V){P.push(V),G.resolve()},iterator:w}})(),k=!1;return{get open(){return k},ops:E,subscribe(){return k=!0,F.next(`: + +`),L=setInterval(()=>F.next(`: + +`),12e3),F.iterator},from(P,G,C,w){(async()=>{if((0,et.isAsyncIterable)(C))for await(let V of C){let m=await l?.(P,G,V);m&&(V=m),F.next((0,et.print)({event:"next",data:w?{id:w,payload:V}:V}))}else{let V=await l?.(P,G,C);V&&(C=V),F.next((0,et.print)({event:"next",data:w?{id:w,payload:C}:C}))}F.next((0,et.print)({event:"complete",data:w?{id:w}:null})),await f?.(P,G),w?delete E[w]:await F.iterator.return()})().catch(F.iterator.throw)}}}async function T(I,E){let L,F=await u?.(I,E);if(cr(F))return F;if(Bd(F)||(0,et.isAsyncIterable)(F))return{ctx:typeof o=="function"?await o(I,E):o,perform(){return F}};if(F)L=F;else{if(!i)throw new Error("The GraphQL schema is not provided");let{operationName:G,variables:C}=E,w;try{w=(0,Rn.parse)(E.query)}catch(m){return[JSON.stringify({errors:[m instanceof Error?{message:m.message}:m]}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}]}let V={operationName:G,document:w,variableValues:C,contextValue:typeof o=="function"?await o(I,E):o};L={...V,schema:typeof i=="function"?await i(I,V):i}}let k;try{let G=(0,Rn.getOperationAST)(L.document,L.operationName);if(!G)throw null;k=G.operation}catch{return[JSON.stringify({errors:[{message:"Unable to detect operation AST"}]}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}]}if(k==="mutation"&&I.method==="GET")return[JSON.stringify({errors:[{message:"Cannot perform mutations over GET"}]}),{status:405,statusText:"Method Not Allowed",headers:{allow:"POST","content-type":"application/json; charset=utf-8"}}];let P=t(L.schema,L.document);return P.length?I.headers.get("accept")==="text/event-stream"?{ctx:L.contextValue,perform(){return{errors:P}}}:[JSON.stringify({errors:P}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}]:{ctx:L.contextValue,async perform(){let G=await(k==="subscription"?n(L):r(L)),C=await c?.(L.contextValue,I,L,G);return C||G}}}return async function(E){var L,F,k;let P=await s(E);if(cr(P))return P;let G=E.headers.get("accept")||"*/*",C=typeof P=="string"?d[P]:null;if(G==="text/event-stream"){let $=await a?.(E);if(cr($))return $;if(!C){let X=await Kd(E);if(cr(X))return X;let ye=X,Te=y(null);Te.ops[""]=null;let Ie=await T(E,ye);if(cr(Ie))return Ie;let Le=await Ie.perform();return(0,et.isAsyncIterable)(Le)&&(Te.ops[""]=Le),Te.from(Ie.ctx,E,Le,null),[Te.subscribe(),{status:200,statusText:"OK",headers:{connection:"keep-alive","cache-control":"no-cache","content-encoding":"none","content-type":"text/event-stream; charset=utf-8"}}]}return C.open?[JSON.stringify({errors:[{message:"Stream already open"}]}),{status:409,statusText:"Conflict",headers:{"content-type":"application/json; charset=utf-8"}}]:[C.subscribe(),{status:200,statusText:"OK",headers:{connection:"keep-alive","cache-control":"no-cache","content-encoding":"none","content-type":"text/event-stream; charset=utf-8"}}]}if(typeof P!="string")return[null,{status:404,statusText:"Not Found"}];if(E.method==="PUT")return["*/*","text/plain"].includes(G)?C?[JSON.stringify({errors:[{message:"Stream already registered"}]}),{status:409,statusText:"Conflict",headers:{"content-type":"application/json; charset=utf-8"}}]:(d[P]=y(P),[P,{status:201,statusText:"Created",headers:{"content-type":"text/plain; charset=utf-8"}}]):[null,{status:406,statusText:"Not Acceptable"}];if(E.method==="DELETE"){if(!C)return[JSON.stringify({errors:[{message:"Stream not found"}]}),{status:404,statusText:"Not Found",headers:{"content-type":"application/json; charset=utf-8"}}];let $=new URL((L=E.url)!==null&&L!==void 0?L:"","http://localhost/").searchParams.get("operationId");if(!$)return[JSON.stringify({errors:[{message:"Operation ID is missing"}]}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}];let X=C.ops[$];return(0,et.isAsyncGenerator)(X)&&X.return(void 0),delete C.ops[$],[null,{status:200,statusText:"OK"}]}else{if(E.method!=="GET"&&E.method!=="POST")return[null,{status:405,statusText:"Method Not Allowed",headers:{allow:"GET, POST, PUT, DELETE"}}];if(!C)return[JSON.stringify({errors:[{message:"Stream not found"}]}),{status:404,statusText:"Not Found",headers:{"content-type":"application/json; charset=utf-8"}}]}if(!["*/*","application/*","application/json"].includes(G))return[null,{status:406,statusText:"Not Acceptable"}];let w=await Kd(E);if(cr(w))return w;let V=w,m=String((k=(F=V.extensions)===null||F===void 0?void 0:F.operationId)!==null&&k!==void 0?k:"");if(!m)return[JSON.stringify({errors:[{message:"Operation ID is missing"}]}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}];if(m in C.ops)return[JSON.stringify({errors:[{message:"Operation with ID already exists"}]}),{status:409,statusText:"Conflict",headers:{"content-type":"application/json; charset=utf-8"}}];C.ops[m]=null;let _=await T(E,V);if(cr(_))return _;if(!(m in C.ops))return[null,{status:204,statusText:"No Content"}];let oe=await _.perform();return!(m in C.ops)&&((0,et.isAsyncGenerator)(oe)&&oe.return(void 0),!(m in C.ops))?[null,{status:204,statusText:"No Content"}]:((0,et.isAsyncIterable)(oe)&&(C.ops[m]=oe),C.from(_.ctx,E,oe,m),[null,{status:202,statusText:"Accepted"}])}}Pr.createHandler=V_;async function Kd(e){var t,r,n;let i={};try{switch(!0){case e.method==="GET":{try{let[,s]=e.url.split("?"),a=new URLSearchParams(s);i.operationName=(t=a.get("operationName"))!==null&&t!==void 0?t:void 0,i.query=(r=a.get("query"))!==null&&r!==void 0?r:void 0;let o=a.get("variables");o&&(i.variables=JSON.parse(o));let u=a.get("extensions");u&&(i.extensions=JSON.parse(u))}catch{throw new Error("Unparsable URL")}break}case(e.method==="POST"&&((n=e.headers.get("content-type"))===null||n===void 0?void 0:n.includes("application/json"))):{if(!e.body)throw new Error("Missing body");let s=typeof e.body=="function"?await e.body():e.body,a=typeof s=="string"?JSON.parse(s):s;if(!(0,$d.isObject)(a))throw new Error("JSON body must be an object");i.operationName=a.operationName,i.query=a.query,i.variables=a.variables,i.extensions=a.extensions;break}default:return[null,{status:415,statusText:"Unsupported Media Type"}]}if(i.query==null)throw new Error("Missing query");if(typeof i.query!="string")throw new Error("Invalid query");if(i.variables!=null&&(typeof i.variables!="object"||Array.isArray(i.variables)))throw new Error("Invalid variables");if(i.extensions!=null&&(typeof i.extensions!="object"||Array.isArray(i.extensions)))throw new Error("Invalid extensions");return i}catch(s){return[JSON.stringify({errors:[s instanceof Error?{message:s.message}:s]}),{status:400,statusText:"Bad Request",headers:{"content-type":"application/json; charset=utf-8"}}]}}function cr(e){return Array.isArray(e)}function Bd(e){return(0,$d.isObject)(e)&&("data"in e||"data"in e&&e.data==null&&"errors"in e)}Pr.isExecutionResult=Bd});var Xd=h(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.createParser=void 0;var Jd=dr(),lr;(function(e){e[e.NewLine=10]="NewLine",e[e.CchunkiageReturn=13]="CchunkiageReturn",e[e.Space=32]="Space",e[e.Colon=58]="Colon"})(lr||(lr={}));function M_(){let e,t,r,n=!1,i={event:"",data:""},s=[],a=new TextDecoder;return function(u){if(e===void 0)e=u,t=0,r=-1;else{let f=new Uint8Array(e.length+u.length);f.set(e),f.set(u,e.length),e=f}let c=e.length,l=0;for(;t0){let d=e.subarray(l,f),y=a.decode(d.subarray(0,r)),T=r+(d[r+1]===lr.Space?2:1),I=a.decode(d.subarray(T));switch(y){case"event":i.event=I;break;case"data":i.data=i.data?i.data+` +`+I:I;break}}l=t,r=-1}if(l===c){e=void 0;let f=[...s];return s=[],f}else l!==0&&(e=e.subarray(l),t-=l)}}Wi.createParser=M_});var zd=h(lt=>{"use strict";var G_=lt&<.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),C_=lt&<.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&G_(t,e,r)};Object.defineProperty(lt,"__esModule",{value:!0});lt.NetworkError=lt.createClient=void 0;var Q_=Xd(),U_=Pn(),K_=dr();C_(dr(),lt);function $_(e){let{singleConnection:t=!1,lazy:r=!0,lazyCloseTimeout:n=0,onNonLazyError:i=console.error,generateID:s=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,V=>{let m=Math.random()*16|0;return(V=="x"?m:m&3|8).toString(16)})},retryAttempts:a=5,retry:o=async function(V){let m=1e3;for(let _=0;_setTimeout(_,m+Math.floor(Math.random()*2700+300)))},credentials:u="same-origin",referrer:c,referrerPolicy:l,onMessage:f,on:d}=e,y=e.fetchFn||fetch,T=e.abortControllerImpl||AbortController,I=(()=>{let w=!1,V=[];return{get disposed(){return w},onDispose(m){return w?(setTimeout(()=>m(),0),()=>{}):(V.push(m),()=>{V.splice(V.indexOf(m),1)})},dispose(){if(!w){w=!0;for(let m of[...V])m()}}}})(),E,L,F=0,k=null,P=0;async function G(){try{if(I.disposed)throw new Error("Client has been disposed");return await(L??(L=(async()=>{var w,V,m;if(k){if(await o(P),E.signal.aborted)throw new Error("Connection aborted by the client");P++}(w=d?.connecting)===null||w===void 0||w.call(d,!!k),E=new T;let _=I.onDispose(()=>E.abort());E.signal.addEventListener("abort",()=>{_(),L=void 0});let oe=typeof e.url=="function"?await e.url():e.url;if(E.signal.aborted)throw new Error("Connection aborted by the client");let $=typeof e.headers=="function"?await e.headers():(V=e.headers)!==null&&V!==void 0?V:{};if(E.signal.aborted)throw new Error("Connection aborted by the client");let X;try{X=await y(oe,{signal:E.signal,method:"PUT",credentials:u,referrer:c,referrerPolicy:l,headers:$})}catch(Ie){throw new qe(Ie)}if(X.status!==201)throw new qe(X);let ye=await X.text();$[K_.TOKEN_HEADER_KEY]=ye;let Te=await Hd({signal:E.signal,headers:$,credentials:u,referrer:c,referrerPolicy:l,url:oe,fetchFn:y,onMessage:Ie=>{var Le;(Le=d?.message)===null||Le===void 0||Le.call(d,Ie),f?.(Ie)}});return(m=d?.connected)===null||m===void 0||m.call(d,!!k),Te.waitForThrow().catch(()=>L=void 0),Te})()))}catch(w){throw L=void 0,w}}t&&!r&&(async()=>{for(F++;;)try{let{waitForThrow:w}=await G();await w()}catch(w){if(I.disposed)return;if(!(w instanceof qe)||(L=void 0,!a||P>=a))return i?.(w);k=w}})();function C(w,V,m){if(!t){let $=new T,X=I.onDispose(()=>{X(),$.abort()});return(async()=>{var ye,Te,Ie,Le,xe;let Ae=null,Nt=0;for(;;)try{if(Ae){if(await o(Nt),$.signal.aborted)throw new Error("Connection aborted by the client");Nt++}(ye=d?.connecting)===null||ye===void 0||ye.call(d,!!Ae),(Te=m?.connecting)===null||Te===void 0||Te.call(m,!!Ae);let jt=typeof e.url=="function"?await e.url():e.url;if($.signal.aborted)throw new Error("Connection aborted by the client");let v=typeof e.headers=="function"?await e.headers():(Ie=e.headers)!==null&&Ie!==void 0?Ie:{};if($.signal.aborted)throw new Error("Connection aborted by the client");let{getResults:S}=await Hd({signal:$.signal,headers:{...v,"content-type":"application/json; charset=utf-8"},credentials:u,referrer:c,referrerPolicy:l,url:jt,body:JSON.stringify(w),fetchFn:y,onMessage:N=>{var D,ie;(D=d?.message)===null||D===void 0||D.call(d,N),(ie=m?.message)===null||ie===void 0||ie.call(m,N),f?.(N)}});(Le=d?.connected)===null||Le===void 0||Le.call(d,!!Ae),(xe=m?.connected)===null||xe===void 0||xe.call(m,!!Ae);for await(let N of S())Ae=null,Nt=0,V.next(N);return $.abort()}catch(jt){if($.signal.aborted)return;if(!(jt instanceof qe)||!a||Nt>=a)throw jt;Ae=jt}})().then(()=>V.complete()).catch(ye=>V.error(ye)),()=>$.abort()}F++;let _=new T,oe=I.onDispose(()=>{oe(),_.abort()});return(async()=>{let $=s();w={...w,extensions:{...w.extensions,operationId:$}};let X=null;for(;;){X=null;try{let{url:ye,headers:Te,getResults:Ie}=await G(),Le;try{Le=await y(ye,{signal:_.signal,method:"POST",credentials:u,referrer:c,referrerPolicy:l,headers:{...Te,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(w)})}catch(xe){throw new qe(xe)}if(Le.status!==202)throw new qe(Le);X=async()=>{let xe;try{let Ae=new T,Nt=I.onDispose(()=>{Nt(),Ae.abort()});xe=await y(ye+"?operationId="+$,{signal:Ae.signal,method:"DELETE",credentials:u,referrer:c,referrerPolicy:l,headers:Te})}catch(Ae){throw new qe(Ae)}if(xe.status!==200)throw new qe(xe)};for await(let xe of Ie({signal:_.signal,operationId:$}))k=null,P=0,V.next(xe);return X=null,_.abort()}catch(ye){if(_.signal.aborted)return await X?.();if(!(ye instanceof qe)||(r&&(L=void 0),!a||P>=a))throw _.abort(),ye;k=ye}finally{_.signal.aborted&&--F===0&&(isFinite(n)&&n>0?setTimeout(()=>{F||E.abort()},n):E.abort())}}})().then(()=>V.complete()).catch($=>V.error($)),()=>_.abort()}return{subscribe:C,iterate(w,V){let m=[],_={done:!1,error:null,resolve:()=>{}},oe=C(w,{next(X){m.push(X),_.resolve()},error(X){_.done=!0,_.error=X,_.resolve()},complete(){_.done=!0,_.resolve()}},V),$=async function*(){for(;;){for(m.length||await new Promise(ye=>_.resolve=ye);m.length;)yield m.shift();if(_.error)throw _.error;if(_.done)return}}();return $.throw=async X=>(_.done||(_.done=!0,_.error=X,_.resolve()),{done:!0,value:void 0}),$.return=async()=>(oe(),{done:!0,value:void 0}),$},dispose(){I.dispose()}}}lt.createClient=$_;var qe=class extends Error{constructor(t){let r,n;B_(t)?(n=t,r="Server responded with "+t.status+": "+t.statusText):t instanceof Error?r=t.message:r=String(t),super(r),this.name=this.constructor.name,this.response=n}};lt.NetworkError=qe;function B_(e){return(0,U_.isObject)(e)&&typeof e.ok=="boolean"&&typeof e.status=="number"&&typeof e.statusText=="string"}async function Hd(e){let{signal:t,url:r,credentials:n,headers:i,body:s,referrer:a,referrerPolicy:o,fetchFn:u,onMessage:c}=e,l={},f={},d;try{d=await u(r,{signal:t,method:s?"POST":"GET",credentials:n,referrer:a,referrerPolicy:o,headers:{...i,accept:"text/event-stream"},body:s})}catch(I){throw new qe(I)}if(!d.ok)throw new qe(d);if(!d.body)throw new Error("Missing response body");let y=null,T;return(async()=>{var I;try{let E=(0,Q_.createParser)();for await(let L of Y_(d.body)){if(typeof L=="string")throw y=new Error(`Unexpected string chunk "${L}"`);let F;try{F=E(L)}catch(k){throw y=k}if(F)for(let k of F){try{c?.(k)}catch(G){throw y=G}let P=k.data&&"id"in k.data?k.data.id:"";switch(P in f||(f[P]=[]),k.event){case"next":P?f[P].push(k.data.payload):f[P].push(k.data);break;case"complete":f[P].push("complete");break;default:throw y=new Error(`Unexpected message event "${k.event}"`)}(I=l[P])===null||I===void 0||I.proceed()}}if(Object.keys(l).length)throw new Error("Connection closed while having active streams")}catch(E){!y&&Object.keys(l).length?y=new qe(E):y=E,T?.(y)}finally{Object.values(l).forEach(({proceed:E})=>E())}})(),{url:r,headers:i,waitForThrow:()=>new Promise((I,E)=>{if(y)return E(y);T=E}),async*getResults(I){var E;let{signal:L,operationId:F=""}=I??{};try{for(;;){for(;!((E=f[F])===null||E===void 0)&&E.length;){let k=f[F].shift();if(k==="complete")return;yield k}if(y)throw y;if(L?.aborted)throw new Error("Getting results aborted by the client");await new Promise(k=>{let P=()=>{L?.removeEventListener("abort",P),delete l[F],k()};L?.addEventListener("abort",P),l[F]={proceed:P}})}}finally{delete f[F]}}}}function Y_(e){return typeof Object(e)[Symbol.asyncIterator]=="function"?(e=e,e[Symbol.asyncIterator]()):async function*(){let t=e.getReader(),r;do r=await t.read(),r.value!==void 0&&(yield r.value);while(!r.done)}()}});var Wd=h(Rt=>{"use strict";var J_=Rt&&Rt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Mu=Rt&&Rt.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&J_(t,e,r)};Object.defineProperty(Rt,"__esModule",{value:!0});Mu(dr(),Rt);Mu(Yd(),Rt);Mu(zd(),Rt)});var z_=h(Zi=>{Object.defineProperty(Zi,"__esModule",{value:!0});Zi.createAsyncIterable=void 0;var X_=Wd();async function H_(){let e="http://127.0.0.1:4200/graphql/stream";return console.log("using url",e),(0,X_.createClient)({url:e}).iterate({query:"subscription { greetings }"})}Zi.createAsyncIterable=H_});return z_();})(); +return z.createAsyncIterable(); diff --git a/integration_tests/kinesis-s3-source/create_source.sql b/integration_tests/kinesis-s3-source/create_source.sql index 902eccdf1950b..c4650f22d822c 100644 --- a/integration_tests/kinesis-s3-source/create_source.sql +++ b/integration_tests/kinesis-s3-source/create_source.sql @@ -16,7 +16,7 @@ CREATE SOURCE ad_click ( bid_id BIGINT, click_timestamp TIMESTAMPTZ ) WITH ( - connector = 's3', + connector = 's3_v2', s3.region_name = 'us-east-1', s3.bucket_name = 'ad-click', s3.credentials.access = 'test', diff --git a/proto/catalog.proto b/proto/catalog.proto index a3fcd1ab2a638..fd7d77116c1a3 100644 --- a/proto/catalog.proto +++ b/proto/catalog.proto @@ -263,6 +263,10 @@ message Function { // The zstd-compressed binary of the function. optional bytes compressed_binary = 17; bool always_retry_on_network_error = 16; + // The runtime used when javascript is used as the language. Could be "quickjs" or "deno". + optional string runtime = 18; + // The function type, which is used to execute the function. Could be "sync", "async", "generator" or "async_generator" + optional string function_type = 19; oneof kind { ScalarFunction scalar = 11; diff --git a/proto/expr.proto b/proto/expr.proto index 48fe88d1ff49c..c8a9887c1663e 100644 --- a/proto/expr.proto +++ b/proto/expr.proto @@ -543,6 +543,10 @@ message UserDefinedFunction { // - If `language` is `rust` or `wasm`, the zstd-compressed wasm binary. optional bytes compressed_binary = 10; bool always_retry_on_network_error = 9; + // The runtime used when javascript is used as the language. Could be "quickjs" or "deno". + optional string runtime = 11; + // The function type, which is used to execute the function. Could be "sync", "async", "generator" or "async_generator" + optional string function_type = 12; } // Additional information for user defined table functions. @@ -554,4 +558,6 @@ message UserDefinedTableFunction { optional string identifier = 6; optional string body = 7; optional bytes compressed_binary = 10; + optional string runtime = 11; + optional string function_type = 12; } diff --git a/src/batch/src/executor/source.rs b/src/batch/src/executor/source.rs index 9a348b25a4025..cbc69444af7f9 100644 --- a/src/batch/src/executor/source.rs +++ b/src/batch/src/executor/source.rs @@ -171,10 +171,10 @@ impl SourceExecutor { u32::MAX, self.source_id, u32::MAX, + "NA".to_owned(), // source name was not passed in batch plan self.metrics, self.source_ctrl_opts.clone(), ConnectorProperties::default(), - "NA".to_owned(), // source name was not passed in batch plan )); let stream = self .source diff --git a/src/bench/sink_bench/main.rs b/src/bench/sink_bench/main.rs index 577a8d21d613d..91ebe6bd44d0f 100644 --- a/src/bench/sink_bench/main.rs +++ b/src/bench/sink_bench/main.rs @@ -46,7 +46,9 @@ use risingwave_connector::sink::{ use risingwave_connector::source::datagen::{ DatagenProperties, DatagenSplitEnumerator, DatagenSplitReader, }; -use risingwave_connector::source::{Column, DataType, SplitEnumerator, SplitReader}; +use risingwave_connector::source::{ + Column, DataType, SourceContext, SourceEnumeratorContext, SplitEnumerator, SplitReader, +}; use risingwave_pb::connector_service::SinkPayloadFormat; use risingwave_stream::executor::test_utils::prelude::ColumnDesc; use risingwave_stream::executor::{Barrier, Message, MessageStreamItem, StreamExecutorError}; @@ -200,10 +202,12 @@ impl MockDatagenSource { rows_per_second, fields: HashMap::default(), }; - let mut datagen_enumerator = - DatagenSplitEnumerator::new(properties.clone(), Default::default()) - .await - .unwrap(); + let mut datagen_enumerator = DatagenSplitEnumerator::new( + properties.clone(), + SourceEnumeratorContext::dummy().into(), + ) + .await + .unwrap(); let parser_config = ParserConfig { specific: SpecificParserConfig { key_encoding_config: None, @@ -220,7 +224,7 @@ impl MockDatagenSource { properties.clone(), vec![splits], parser_config.clone(), - Default::default(), + SourceContext::dummy().into(), Some(source_schema.clone()), ) .await diff --git a/src/cmd_all/Cargo.toml b/src/cmd_all/Cargo.toml index c2f49c017e369..5ed92b65609cc 100644 --- a/src/cmd_all/Cargo.toml +++ b/src/cmd_all/Cargo.toml @@ -10,6 +10,7 @@ repository = { workspace = true } [features] rw-static-link = ["workspace-config/rw-static-link"] rw-dynamic-link = ["workspace-config/rw-dynamic-link"] +embedded-deno-udf = ["risingwave_expr/embedded-deno-udf"] embedded-python-udf = ["risingwave_expr/embedded-python-udf"] default = ["rw-static-link"] diff --git a/src/compute/tests/integration_tests.rs b/src/compute/tests/integration_tests.rs index e25027b61573a..49f54c18a5ff6 100644 --- a/src/compute/tests/integration_tests.rs +++ b/src/compute/tests/integration_tests.rs @@ -173,7 +173,10 @@ async fn test_table_materialize() -> StreamResult<()> { Arc::new(StreamingMetrics::unused()), barrier_rx, system_params_manager.get_params(), - SourceCtrlOpts::default(), + SourceCtrlOpts { + chunk_size: 1024, + rate_limit: None, + }, ) .boxed(), ); diff --git a/src/connector/benches/json_parser.rs b/src/connector/benches/json_parser.rs index ffbcbb1492444..90c78044d6221 100644 --- a/src/connector/benches/json_parser.rs +++ b/src/connector/benches/json_parser.rs @@ -132,7 +132,7 @@ fn bench_json_parser(c: &mut Criterion) { .build() .unwrap(); let records = generate_json_rows(); - let ctx = Arc::new(SourceContext::default()); + let ctx = Arc::new(SourceContext::dummy()); c.bench_function("json_parser", |b| { b.to_async(&rt).iter_batched( || records.clone(), diff --git a/src/connector/benches/nexmark_integration.rs b/src/connector/benches/nexmark_integration.rs index e6388ed4b0d25..1c05147eeafbb 100644 --- a/src/connector/benches/nexmark_integration.rs +++ b/src/connector/benches/nexmark_integration.rs @@ -26,7 +26,8 @@ use risingwave_connector::parser::{ ByteStreamSourceParser, JsonParser, SourceParserIntoStreamExt, SpecificParserConfig, }; use risingwave_connector::source::{ - BoxChunkSourceStream, BoxSourceStream, SourceColumnDesc, SourceMessage, SourceMeta, + BoxChunkSourceStream, BoxSourceStream, SourceColumnDesc, SourceContext, SourceMessage, + SourceMeta, }; use tracing::Level; use tracing_subscriber::prelude::*; @@ -87,7 +88,7 @@ fn make_parser() -> impl ByteStreamSourceParser { let props = SpecificParserConfig::DEFAULT_PLAIN_JSON; - JsonParser::new(props, columns, Default::default()).unwrap() + JsonParser::new(props, columns, SourceContext::dummy().into()).unwrap() } fn make_stream_iter() -> impl Iterator { diff --git a/src/connector/benches/parser.rs b/src/connector/benches/parser.rs index f0527e119086a..21ce72dd1b2b1 100644 --- a/src/connector/benches/parser.rs +++ b/src/connector/benches/parser.rs @@ -20,7 +20,7 @@ use risingwave_connector::parser::{ EncodingProperties, JsonParser, JsonProperties, ProtocolProperties, SourceStreamChunkBuilder, SpecificParserConfig, }; -use risingwave_connector::source::SourceColumnDesc; +use risingwave_connector::source::{SourceColumnDesc, SourceContext}; use serde_json::json; use tokio::runtime::Runtime; @@ -81,7 +81,7 @@ fn create_parser( }), protocol_config: ProtocolProperties::Plain, }; - let parser = JsonParser::new(props, desc.clone(), Default::default()).unwrap(); + let parser = JsonParser::new(props, desc.clone(), SourceContext::dummy().into()).unwrap(); let input = gen_input(mode, chunk_size, chunk_num); (parser, desc, input) } diff --git a/src/connector/src/lib.rs b/src/connector/src/lib.rs index 1153a133eb1d0..f28f3cdce5e77 100644 --- a/src/connector/src/lib.rs +++ b/src/connector/src/lib.rs @@ -32,6 +32,7 @@ #![feature(iterator_try_collect)] #![feature(try_blocks)] #![feature(error_generic_member_access)] +#![feature(negative_impls)] #![feature(register_tool)] #![register_tool(rw)] #![recursion_limit = "256"] diff --git a/src/connector/src/parser/avro/parser.rs b/src/connector/src/parser/avro/parser.rs index 6125e87d069bf..65601d9c3a3e6 100644 --- a/src/connector/src/parser/avro/parser.rs +++ b/src/connector/src/parser/avro/parser.rs @@ -201,7 +201,7 @@ mod test { use crate::parser::{ AccessBuilderImpl, EncodingType, SourceStreamChunkBuilder, SpecificParserConfig, }; - use crate::source::SourceColumnDesc; + use crate::source::{SourceColumnDesc, SourceContext}; fn test_data_path(file_name: &str) -> String { let curr_dir = env::current_dir().unwrap().into_os_string(); @@ -257,7 +257,7 @@ mod test { } async fn new_avro_conf_from_local(file_name: &str) -> ConnectorResult { - let schema_path = "file://".to_owned() + &test_data_path(file_name); + let schema_path = format!("file://{}", test_data_path(file_name)); let info = StreamSourceInfo { row_schema_location: schema_path.clone(), use_schema_registry: false, @@ -279,7 +279,7 @@ mod test { EncodingType::Value, )?), rw_columns: Vec::default(), - source_ctx: Default::default(), + source_ctx: SourceContext::dummy().into(), transaction_meta_builder: None, }) } diff --git a/src/connector/src/parser/bytes_parser.rs b/src/connector/src/parser/bytes_parser.rs index 4f353ce2c60e6..255c3ef829c79 100644 --- a/src/connector/src/parser/bytes_parser.rs +++ b/src/connector/src/parser/bytes_parser.rs @@ -54,6 +54,7 @@ mod tests { BytesProperties, EncodingProperties, ProtocolProperties, SourceColumnDesc, SourceStreamChunkBuilder, SpecificParserConfig, }; + use crate::source::SourceContext; fn get_payload() -> Vec> { vec![br#"t"#.to_vec(), br#"random"#.to_vec()] @@ -66,7 +67,7 @@ mod tests { encoding_config: EncodingProperties::Bytes(BytesProperties { column_name: None }), protocol_config: ProtocolProperties::Plain, }; - let mut parser = PlainParser::new(props, descs.clone(), Default::default()) + let mut parser = PlainParser::new(props, descs.clone(), SourceContext::dummy().into()) .await .unwrap(); diff --git a/src/connector/src/parser/canal/simd_json_parser.rs b/src/connector/src/parser/canal/simd_json_parser.rs index 75e6656fd7a7a..9bc236392eb48 100644 --- a/src/connector/src/parser/canal/simd_json_parser.rs +++ b/src/connector/src/parser/canal/simd_json_parser.rs @@ -158,7 +158,7 @@ mod tests { ]; let parser = CanalJsonParser::new( descs.clone(), - Default::default(), + SourceContext::dummy().into(), &JsonProperties::default(), ) .unwrap(); @@ -229,7 +229,7 @@ mod tests { let parser = CanalJsonParser::new( descs.clone(), - Default::default(), + SourceContext::dummy().into(), &JsonProperties::default(), ) .unwrap(); @@ -283,7 +283,7 @@ mod tests { let parser = CanalJsonParser::new( descs.clone(), - Default::default(), + SourceContext::dummy().into(), &JsonProperties::default(), ) .unwrap(); diff --git a/src/connector/src/parser/csv_parser.rs b/src/connector/src/parser/csv_parser.rs index 8a8bb211da327..eaf09ab839891 100644 --- a/src/connector/src/parser/csv_parser.rs +++ b/src/connector/src/parser/csv_parser.rs @@ -192,7 +192,7 @@ mod tests { delimiter: b',', has_header: false, }, - Default::default(), + SourceContext::dummy().into(), ) .unwrap(); let mut builder = SourceStreamChunkBuilder::with_capacity(descs, 4); @@ -299,7 +299,7 @@ mod tests { delimiter: b',', has_header: true, }, - Default::default(), + SourceContext::dummy().into(), ) .unwrap(); let mut builder = SourceStreamChunkBuilder::with_capacity(descs, 4); diff --git a/src/connector/src/parser/debezium/avro_parser.rs b/src/connector/src/parser/debezium/avro_parser.rs index ca1574af3d6b2..29d9139d221cf 100644 --- a/src/connector/src/parser/debezium/avro_parser.rs +++ b/src/connector/src/parser/debezium/avro_parser.rs @@ -154,7 +154,7 @@ mod tests { use crate::parser::{ DebeziumAvroParserConfig, DebeziumParser, SourceStreamChunkBuilder, SpecificParserConfig, }; - use crate::source::SourceColumnDesc; + use crate::source::{SourceColumnDesc, SourceContext}; const DEBEZIUM_AVRO_DATA: &[u8] = b"\x00\x00\x00\x00\x06\x00\x02\xd2\x0f\x0a\x53\x61\x6c\x6c\x79\x0c\x54\x68\x6f\x6d\x61\x73\x2a\x73\x61\x6c\x6c\x79\x2e\x74\x68\x6f\x6d\x61\x73\x40\x61\x63\x6d\x65\x2e\x63\x6f\x6d\x16\x32\x2e\x31\x2e\x32\x2e\x46\x69\x6e\x61\x6c\x0a\x6d\x79\x73\x71\x6c\x12\x64\x62\x73\x65\x72\x76\x65\x72\x31\xc0\xb4\xe8\xb7\xc9\x61\x00\x30\x66\x69\x72\x73\x74\x5f\x69\x6e\x5f\x64\x61\x74\x61\x5f\x63\x6f\x6c\x6c\x65\x63\x74\x69\x6f\x6e\x12\x69\x6e\x76\x65\x6e\x74\x6f\x72\x79\x00\x02\x12\x63\x75\x73\x74\x6f\x6d\x65\x72\x73\x00\x00\x20\x6d\x79\x73\x71\x6c\x2d\x62\x69\x6e\x2e\x30\x30\x30\x30\x30\x33\x8c\x06\x00\x00\x00\x02\x72\x02\x92\xc3\xe8\xb7\xc9\x61\x00"; @@ -367,9 +367,12 @@ mod tests { .map(CatColumnDesc::from) .map(|c| SourceColumnDesc::from(&c)) .collect_vec(); - let parser = - DebeziumParser::new(parser_config, columns.clone(), Arc::new(Default::default())) - .await?; + let parser = DebeziumParser::new( + parser_config, + columns.clone(), + SourceContext::dummy().into(), + ) + .await?; let [(op, row)]: [_; 1] = parse_one(parser, columns, DEBEZIUM_AVRO_DATA.to_vec()) .await .try_into() diff --git a/src/connector/src/parser/debezium/debezium_parser.rs b/src/connector/src/parser/debezium/debezium_parser.rs index 7fb497c399c61..52d1e4e4a15a2 100644 --- a/src/connector/src/parser/debezium/debezium_parser.rs +++ b/src/connector/src/parser/debezium/debezium_parser.rs @@ -24,9 +24,8 @@ use crate::parser::unified::debezium::DebeziumChangeEvent; use crate::parser::unified::json::TimestamptzHandling; use crate::parser::unified::util::apply_row_operation_on_stream_chunk_writer; use crate::parser::{ - AccessBuilderImpl, ByteStreamSourceParser, EncodingProperties, EncodingType, JsonProperties, - ParseResult, ParserFormat, ProtocolProperties, SourceStreamChunkRowWriter, - SpecificParserConfig, + AccessBuilderImpl, ByteStreamSourceParser, EncodingProperties, EncodingType, ParseResult, + ParserFormat, ProtocolProperties, SourceStreamChunkRowWriter, SpecificParserConfig, }; use crate::source::{SourceColumnDesc, SourceContext, SourceContextRef}; @@ -112,6 +111,8 @@ impl DebeziumParser { } pub async fn new_for_test(rw_columns: Vec) -> ConnectorResult { + use crate::parser::JsonProperties; + let props = SpecificParserConfig { key_encoding_config: None, encoding_config: EncodingProperties::Json(JsonProperties { @@ -120,7 +121,7 @@ impl DebeziumParser { }), protocol_config: ProtocolProperties::Debezium(DebeziumProps::default()), }; - Self::new(props, rw_columns, Default::default()).await + Self::new(props, rw_columns, SourceContext::dummy().into()).await } pub async fn parse_inner( @@ -199,7 +200,7 @@ mod tests { use risingwave_common::catalog::{ColumnCatalog, ColumnDesc, ColumnId}; use super::*; - use crate::parser::{SourceStreamChunkBuilder, TransactionControl}; + use crate::parser::{JsonProperties, SourceStreamChunkBuilder, TransactionControl}; use crate::source::{ConnectorProperties, DataType}; #[tokio::test] @@ -228,7 +229,7 @@ mod tests { }; let source_ctx = SourceContext { connector_props: ConnectorProperties::PostgresCdc(Box::default()), - ..Default::default() + ..SourceContext::dummy() }; let mut parser = DebeziumParser::new(props, columns.clone(), Arc::new(source_ctx)) .await diff --git a/src/connector/src/parser/debezium/mongo_json_parser.rs b/src/connector/src/parser/debezium/mongo_json_parser.rs index ad0bc9e7f1475..2de46a9aa5460 100644 --- a/src/connector/src/parser/debezium/mongo_json_parser.rs +++ b/src/connector/src/parser/debezium/mongo_json_parser.rs @@ -182,7 +182,8 @@ mod tests { SourceColumnDesc::simple("_id", DataType::Varchar, ColumnId::from(0)), SourceColumnDesc::simple("payload", DataType::Jsonb, ColumnId::from(1)), ]; - let mut parser = DebeziumMongoJsonParser::new(columns.clone(), Default::default()).unwrap(); + let mut parser = + DebeziumMongoJsonParser::new(columns.clone(), SourceContext::dummy().into()).unwrap(); let mut builder = SourceStreamChunkBuilder::with_capacity(columns.clone(), 3); let writer = builder.row_writer(); parser @@ -218,7 +219,8 @@ mod tests { ]; for data in input { let mut parser = - DebeziumMongoJsonParser::new(columns.clone(), Default::default()).unwrap(); + DebeziumMongoJsonParser::new(columns.clone(), SourceContext::dummy().into()) + .unwrap(); let mut builder = SourceStreamChunkBuilder::with_capacity(columns.clone(), 3); diff --git a/src/connector/src/parser/debezium/simd_json_parser.rs b/src/connector/src/parser/debezium/simd_json_parser.rs index 72c1688d95e75..63cb939d81238 100644 --- a/src/connector/src/parser/debezium/simd_json_parser.rs +++ b/src/connector/src/parser/debezium/simd_json_parser.rs @@ -115,7 +115,7 @@ mod tests { DebeziumParser, DebeziumProps, EncodingProperties, JsonProperties, ProtocolProperties, SourceColumnDesc, SourceStreamChunkBuilder, SpecificParserConfig, }; - use crate::source::SourceContextRef; + use crate::source::SourceContext; fn assert_json_eq(parse_result: &Option, json_str: &str) { if let Some(ScalarImpl::Jsonb(json_val)) = parse_result { @@ -130,10 +130,7 @@ mod tests { } } - async fn build_parser( - rw_columns: Vec, - source_ctx: SourceContextRef, - ) -> DebeziumParser { + async fn build_parser(rw_columns: Vec) -> DebeziumParser { let props = SpecificParserConfig { key_encoding_config: None, encoding_config: EncodingProperties::Json(JsonProperties { @@ -142,7 +139,7 @@ mod tests { }), protocol_config: ProtocolProperties::Debezium(DebeziumProps::default()), }; - DebeziumParser::new(props, rw_columns, source_ctx) + DebeziumParser::new(props, rw_columns, SourceContext::dummy().into()) .await .unwrap() } @@ -197,7 +194,7 @@ mod tests { let columns = get_test1_columns(); for data in input { - let parser = build_parser(columns.clone(), Default::default()).await; + let parser = build_parser(columns.clone()).await; let [(_op, row)]: [_; 1] = parse_one(parser, columns.clone(), data) .await .try_into() @@ -228,7 +225,7 @@ mod tests { let columns = get_test1_columns(); for data in input { - let parser = build_parser(columns.clone(), Default::default()).await; + let parser = build_parser(columns.clone()).await; let [(op, row)]: [_; 1] = parse_one(parser, columns.clone(), data) .await .try_into() @@ -259,7 +256,7 @@ mod tests { for data in input { let columns = get_test1_columns(); - let parser = build_parser(columns.clone(), Default::default()).await; + let parser = build_parser(columns.clone()).await; let [(op, row)]: [_; 1] = parse_one(parser, columns.clone(), data) .await .try_into() @@ -297,7 +294,7 @@ mod tests { let columns = get_test1_columns(); for data in input { - let parser = build_parser(columns.clone(), Default::default()).await; + let parser = build_parser(columns.clone()).await; let [(op, row)]: [_; 1] = parse_one(parser, columns.clone(), data) .await .try_into() @@ -356,7 +353,7 @@ mod tests { let columns = get_test2_columns(); - let parser = build_parser(columns.clone(), Default::default()).await; + let parser = build_parser(columns.clone()).await; let [(_op, row)]: [_; 1] = parse_one(parser, columns, data.to_vec()) .await @@ -391,7 +388,7 @@ mod tests { let data = br#"{"payload":{"before":null,"after":{"O_KEY":111,"O_BOOL":1,"O_TINY":-1,"O_INT":-1111,"O_REAL":-11.11,"O_DOUBLE":-111.11111,"O_DECIMAL":-111.11,"O_CHAR":"yes please","O_DATE":"1000-01-01","O_TIME":0,"O_DATETIME":0,"O_TIMESTAMP":"1970-01-01T00:00:01Z","O_JSON":"{\"k1\": \"v1\", \"k2\": 11}"},"source":{"version":"1.9.7.Final","connector":"mysql","name":"RW_CDC_test.orders","ts_ms":1678088861000,"snapshot":"false","db":"test","sequence":null,"table":"orders","server_id":223344,"gtid":null,"file":"mysql-bin.000003","pos":789,"row":0,"thread":4,"query":null},"op":"c","ts_ms":1678088861249,"transaction":null}}"#; let columns = get_test2_columns(); - let parser = build_parser(columns.clone(), Default::default()).await; + let parser = build_parser(columns.clone()).await; let [(op, row)]: [_; 1] = parse_one(parser, columns, data.to_vec()) .await .try_into() @@ -426,7 +423,7 @@ mod tests { let data = br#"{"payload":{"before":{"O_KEY":111,"O_BOOL":0,"O_TINY":3,"O_INT":3333,"O_REAL":33.33,"O_DOUBLE":333.33333,"O_DECIMAL":333.33,"O_CHAR":"no thanks","O_DATE":"9999-12-31","O_TIME":86399000000,"O_DATETIME":99999999999000,"O_TIMESTAMP":"2038-01-09T03:14:07Z","O_JSON":"{\"k1\":\"v1_updated\",\"k2\":33}"},"after":null,"source":{"version":"1.9.7.Final","connector":"mysql","name":"RW_CDC_test.orders","ts_ms":1678090653000,"snapshot":"false","db":"test","sequence":null,"table":"orders","server_id":223344,"gtid":null,"file":"mysql-bin.000003","pos":1643,"row":0,"thread":4,"query":null},"op":"d","ts_ms":1678090653611,"transaction":null}}"#; let columns = get_test2_columns(); - let parser = build_parser(columns.clone(), Default::default()).await; + let parser = build_parser(columns.clone()).await; let [(op, row)]: [_; 1] = parse_one(parser, columns, data.to_vec()) .await .try_into() @@ -463,7 +460,7 @@ mod tests { let columns = get_test2_columns(); - let parser = build_parser(columns.clone(), Default::default()).await; + let parser = build_parser(columns.clone()).await; let [(op, row)]: [_; 1] = parse_one(parser, columns, data.to_vec()) .await .try_into() @@ -506,7 +503,7 @@ mod tests { SourceColumnDesc::simple("O_REAL", DataType::Float32, ColumnId::from(4)), SourceColumnDesc::simple("O_DOUBLE", DataType::Float64, ColumnId::from(5)), ]; - let mut parser = build_parser(columns.clone(), Default::default()).await; + let mut parser = build_parser(columns.clone()).await; let mut builder = SourceStreamChunkBuilder::with_capacity(columns, 2); @@ -647,7 +644,7 @@ mod tests { // this test covers an insert event on the table above let data = br#"{"payload":{"before":null,"after":{"o_key":0,"o_time_0":40271000000,"o_time_6":40271000010,"o_timez_0":"11:11:11Z","o_timez_6":"11:11:11.00001Z","o_timestamp_0":1321009871000,"o_timestamp_6":1321009871123456,"o_timestampz_0":"2011-11-11T03:11:11Z","o_timestampz_6":"2011-11-11T03:11:11.123456Z","o_interval":"P1Y2M3DT4H5M6.78S","o_date":"1999-09-09"},"source":{"version":"1.9.7.Final","connector":"postgresql","name":"RW_CDC_localhost.test.orders","ts_ms":1684733351963,"snapshot":"last","db":"test","sequence":"[null,\"26505352\"]","schema":"public","table":"orders","txId":729,"lsn":26505352,"xmin":null},"op":"r","ts_ms":1684733352110,"transaction":null}}"#; let columns = get_temporal_test_columns(); - let parser = build_parser(columns.clone(), Default::default()).await; + let parser = build_parser(columns.clone()).await; let [(op, row)]: [_; 1] = parse_one(parser, columns, data.to_vec()) .await .try_into() @@ -702,7 +699,7 @@ mod tests { // this test covers an insert event on the table above let data = br#"{"payload":{"before":null,"after":{"o_key":0,"o_smallint":32767,"o_integer":2147483647,"o_bigint":9223372036854775807,"o_real":9.999,"o_double":9.999999,"o_numeric":123456.789,"o_numeric_6_3":123.456,"o_money":123.12},"source":{"version":"1.9.7.Final","connector":"postgresql","name":"RW_CDC_localhost.test.orders","ts_ms":1684404343201,"snapshot":"last","db":"test","sequence":"[null,\"26519216\"]","schema":"public","table":"orders","txId":729,"lsn":26519216,"xmin":null},"op":"r","ts_ms":1684404343349,"transaction":null}}"#; let columns = get_numeric_test_columns(); - let parser = build_parser(columns.clone(), Default::default()).await; + let parser = build_parser(columns.clone()).await; let [(op, row)]: [_; 1] = parse_one(parser, columns, data.to_vec()) .await .try_into() @@ -741,7 +738,7 @@ mod tests { // this test covers an insert event on the table above let data = br#"{"payload":{"before":null,"after":{"o_key":1,"o_boolean":false,"o_bit":true,"o_bytea":"ASNFZ4mrze8=","o_json":"{\"k1\": \"v1\", \"k2\": 11}","o_xml":"","o_uuid":"60f14fe2-f857-404a-b586-3b5375b3259f","o_point":{"x":1.0,"y":2.0,"wkb":"AQEAAAAAAAAAAADwPwAAAAAAAABA","srid":null},"o_enum":"polar","o_char":"h","o_varchar":"ha","o_character":"h","o_character_varying":"hahaha"},"source":{"version":"1.9.7.Final","connector":"postgresql","name":"RW_CDC_localhost.test.orders","ts_ms":1684743927178,"snapshot":"last","db":"test","sequence":"[null,\"26524528\"]","schema":"public","table":"orders","txId":730,"lsn":26524528,"xmin":null},"op":"r","ts_ms":1684743927343,"transaction":null}}"#; let columns = get_other_types_test_columns(); - let parser = build_parser(columns.clone(), Default::default()).await; + let parser = build_parser(columns.clone()).await; let [(op, row)]: [_; 1] = parse_one(parser, columns, data.to_vec()) .await .try_into() diff --git a/src/connector/src/parser/json_parser.rs b/src/connector/src/parser/json_parser.rs index 05e689f07be72..f010b8e6b7df6 100644 --- a/src/connector/src/parser/json_parser.rs +++ b/src/connector/src/parser/json_parser.rs @@ -106,10 +106,11 @@ impl JsonParser { }) } + #[cfg(test)] pub fn new_for_test(rw_columns: Vec) -> ConnectorResult { Ok(Self { rw_columns, - source_ctx: Default::default(), + source_ctx: SourceContext::dummy().into(), payload_start_idx: 0, }) } @@ -218,7 +219,7 @@ mod tests { EncodingProperties, JsonProperties, ProtocolProperties, SourceColumnDesc, SourceStreamChunkBuilder, SpecificParserConfig, }; - use crate::source::SourceColumnType; + use crate::source::{SourceColumnType, SourceContext}; fn get_payload() -> Vec> { vec![ @@ -251,7 +252,7 @@ mod tests { let parser = JsonParser::new( SpecificParserConfig::DEFAULT_PLAIN_JSON, descs.clone(), - Default::default(), + SourceContext::dummy().into(), ) .unwrap(); @@ -361,7 +362,7 @@ mod tests { let parser = JsonParser::new( SpecificParserConfig::DEFAULT_PLAIN_JSON, descs.clone(), - Default::default(), + SourceContext::dummy().into(), ) .unwrap(); let mut builder = SourceStreamChunkBuilder::with_capacity(descs, 3); @@ -432,7 +433,7 @@ mod tests { let parser = JsonParser::new( SpecificParserConfig::DEFAULT_PLAIN_JSON, descs.clone(), - Default::default(), + SourceContext::dummy().into(), ) .unwrap(); let payload = br#" @@ -504,7 +505,7 @@ mod tests { let parser = JsonParser::new( SpecificParserConfig::DEFAULT_PLAIN_JSON, descs.clone(), - Default::default(), + SourceContext::dummy().into(), ) .unwrap(); let payload = br#" @@ -550,7 +551,7 @@ mod tests { let parser = JsonParser::new( SpecificParserConfig::DEFAULT_PLAIN_JSON, descs.clone(), - Default::default(), + SourceContext::dummy().into(), ) .unwrap(); let payload = br#" @@ -614,7 +615,7 @@ mod tests { }), protocol_config: ProtocolProperties::Upsert, }; - let mut parser = UpsertParser::new(props, descs.clone(), Default::default()) + let mut parser = UpsertParser::new(props, descs.clone(), SourceContext::dummy().into()) .await .unwrap(); let mut builder = SourceStreamChunkBuilder::with_capacity(descs, 4); diff --git a/src/connector/src/parser/maxwell/simd_json_parser.rs b/src/connector/src/parser/maxwell/simd_json_parser.rs index d018ef73b0506..5db6cdd52e90c 100644 --- a/src/connector/src/parser/maxwell/simd_json_parser.rs +++ b/src/connector/src/parser/maxwell/simd_json_parser.rs @@ -23,6 +23,8 @@ mod tests { EncodingProperties, JsonProperties, ProtocolProperties, SourceColumnDesc, SourceStreamChunkBuilder, SpecificParserConfig, }; + use crate::source::SourceContext; + #[tokio::test] async fn test_json_parser() { let descs = vec![ @@ -40,7 +42,7 @@ mod tests { }), protocol_config: ProtocolProperties::Maxwell, }; - let mut parser = MaxwellParser::new(props, descs.clone(), Default::default()) + let mut parser = MaxwellParser::new(props, descs.clone(), SourceContext::dummy().into()) .await .unwrap(); diff --git a/src/connector/src/parser/plain_parser.rs b/src/connector/src/parser/plain_parser.rs index b50f0d57645fe..c526366905938 100644 --- a/src/connector/src/parser/plain_parser.rs +++ b/src/connector/src/parser/plain_parser.rs @@ -195,7 +195,7 @@ mod tests { let source_ctx = SourceContext { connector_props: ConnectorProperties::PostgresCdc(Box::default()), - ..Default::default() + ..SourceContext::dummy() }; let source_ctx = Arc::new(source_ctx); // format plain encode json parser @@ -348,7 +348,7 @@ mod tests { // format plain encode json parser let source_ctx = SourceContext { connector_props: ConnectorProperties::MysqlCdc(Box::default()), - ..Default::default() + ..SourceContext::dummy() }; let mut parser = PlainParser::new( SpecificParserConfig::DEFAULT_PLAIN_JSON, diff --git a/src/connector/src/sink/kafka.rs b/src/connector/src/sink/kafka.rs index c6598f163a977..8d56441e53488 100644 --- a/src/connector/src/sink/kafka.rs +++ b/src/connector/src/sink/kafka.rs @@ -363,7 +363,7 @@ impl Sink for KafkaSink { // use enumerator to validate broker reachability and existence of topic let check = KafkaSplitEnumerator::new( KafkaProperties::from(self.config.clone()), - Arc::new(SourceEnumeratorContext::default()), + Arc::new(SourceEnumeratorContext::dummy()), ) .await?; if !check.check_reachability().await { diff --git a/src/connector/src/source/base.rs b/src/connector/src/source/base.rs index 420194fe4a941..6f594c09366d8 100644 --- a/src/connector/src/source/base.rs +++ b/src/connector/src/source/base.rs @@ -138,27 +138,33 @@ pub struct SourceCtrlOpts { pub rate_limit: Option, } -impl Default for SourceCtrlOpts { - fn default() -> Self { - Self { - chunk_size: MAX_CHUNK_SIZE, - rate_limit: None, - } - } -} +// The options in `SourceCtrlOpts` are so important that we don't want to impl `Default` for it, +// so that we can prevent any unintentional use of the default value. +impl !Default for SourceCtrlOpts {} -#[derive(Debug, Default)] +#[derive(Debug)] pub struct SourceEnumeratorContext { pub info: SourceEnumeratorInfo, pub metrics: Arc, } -#[derive(Clone, Debug, Default)] +impl SourceEnumeratorContext { + /// Create a dummy `SourceEnumeratorContext` for testing purpose, or for the situation + /// where the real context doesn't matter. + pub fn dummy() -> SourceEnumeratorContext { + SourceEnumeratorContext { + info: SourceEnumeratorInfo { source_id: 0 }, + metrics: Arc::new(EnumeratorMetrics::default()), + } + } +} + +#[derive(Clone, Debug)] pub struct SourceEnumeratorInfo { pub source_id: u32, } -#[derive(Debug, Default)] +#[derive(Debug)] pub struct SourceContext { pub actor_id: u32, pub source_id: TableId, @@ -175,10 +181,10 @@ impl SourceContext { actor_id: u32, source_id: TableId, fragment_id: u32, + source_name: String, metrics: Arc, source_ctrl_opts: SourceCtrlOpts, connector_props: ConnectorProperties, - source_name: String, ) -> Self { Self { actor_id, @@ -190,6 +196,23 @@ impl SourceContext { connector_props, } } + + /// Create a dummy `SourceContext` for testing purpose, or for the situation + /// where the real context doesn't matter. + pub fn dummy() -> Self { + Self::new( + 0, + TableId::new(0), + 0, + "dummy".to_string(), + Arc::new(SourceMetrics::default()), + SourceCtrlOpts { + chunk_size: MAX_CHUNK_SIZE, + rate_limit: None, + }, + ConnectorProperties::default(), + ) + } } #[derive(Clone, Copy, Debug, PartialEq, Eq, Default)] diff --git a/src/connector/src/source/datagen/source/reader.rs b/src/connector/src/source/datagen/source/reader.rs index 0836fef581a3c..87f798d59f38b 100644 --- a/src/connector/src/source/datagen/source/reader.rs +++ b/src/connector/src/source/datagen/source/reader.rs @@ -337,6 +337,7 @@ mod tests { use super::*; use crate::parser::SpecificParserConfig; + use crate::source::SourceContext; #[tokio::test] async fn test_generator() -> Result<()> { @@ -403,7 +404,7 @@ mod tests { }, ..Default::default() }, - Default::default(), + SourceContext::dummy().into(), Some(mock_datum), ) .await? @@ -465,7 +466,7 @@ mod tests { properties.clone(), state, parser_config.clone(), - Default::default(), + SourceContext::dummy().into(), Some(mock_datum.clone()), ) .await? @@ -482,7 +483,7 @@ mod tests { properties, state, parser_config, - Default::default(), + SourceContext::dummy().into(), Some(mock_datum), ) .await? diff --git a/src/connector/src/source/filesystem/s3/enumerator.rs b/src/connector/src/source/filesystem/s3/enumerator.rs index ae671ad2265f9..7491cac0df7c6 100644 --- a/src/connector/src/source/filesystem/s3/enumerator.rs +++ b/src/connector/src/source/filesystem/s3/enumerator.rs @@ -140,7 +140,7 @@ mod tests { endpoint_url: None, }; let mut enumerator = - S3SplitEnumerator::new(props.into(), SourceEnumeratorContext::default().into()) + S3SplitEnumerator::new(props.into(), SourceEnumeratorContext::dummy().into()) .await .unwrap(); let splits = enumerator.list_splits().await.unwrap(); diff --git a/src/connector/src/source/filesystem/s3/source/reader.rs b/src/connector/src/source/filesystem/s3/source/reader.rs index ff5dc9c9c1482..129b708a61521 100644 --- a/src/connector/src/source/filesystem/s3/source/reader.rs +++ b/src/connector/src/source/filesystem/s3/source/reader.rs @@ -266,7 +266,9 @@ mod tests { }; use crate::source::filesystem::s3::S3PropertiesCommon; use crate::source::filesystem::S3SplitEnumerator; - use crate::source::{SourceColumnDesc, SourceEnumeratorContext, SplitEnumerator}; + use crate::source::{ + SourceColumnDesc, SourceContext, SourceEnumeratorContext, SplitEnumerator, + }; #[tokio::test] #[ignore] @@ -281,7 +283,7 @@ mod tests { } .into(); let mut enumerator = - S3SplitEnumerator::new(props.clone(), SourceEnumeratorContext::default().into()) + S3SplitEnumerator::new(props.clone(), SourceEnumeratorContext::dummy().into()) .await .unwrap(); let splits = enumerator.list_splits().await.unwrap(); @@ -307,7 +309,7 @@ mod tests { }, }; - let reader = S3FileReader::new(props, splits, config, Default::default(), None) + let reader = S3FileReader::new(props, splits, config, SourceContext::dummy().into(), None) .await .unwrap(); diff --git a/src/connector/src/source/kinesis/source/reader.rs b/src/connector/src/source/kinesis/source/reader.rs index 959940bd84415..c9026428d1df0 100644 --- a/src/connector/src/source/kinesis/source/reader.rs +++ b/src/connector/src/source/kinesis/source/reader.rs @@ -307,6 +307,7 @@ mod tests { use super::*; use crate::connector_common::KinesisCommon; use crate::source::kinesis::split::KinesisSplit; + use crate::source::SourceContext; #[tokio::test] async fn test_reject_redundant_seq_props() { @@ -335,7 +336,7 @@ mod tests { end_position: KinesisOffset::None, }], Default::default(), - Default::default(), + SourceContext::dummy().into(), None, ) .await; @@ -371,7 +372,7 @@ mod tests { end_position: KinesisOffset::None, }], Default::default(), - Default::default(), + SourceContext::dummy().into(), None, ) .await? @@ -389,7 +390,7 @@ mod tests { end_position: KinesisOffset::None, }], Default::default(), - Default::default(), + SourceContext::dummy().into(), None, ) .await? diff --git a/src/connector/src/source/nexmark/source/reader.rs b/src/connector/src/source/nexmark/source/reader.rs index 7b402cbc13680..6441baa154ae4 100644 --- a/src/connector/src/source/nexmark/source/reader.rs +++ b/src/connector/src/source/nexmark/source/reader.rs @@ -211,7 +211,7 @@ impl NexmarkSplitReader { mod tests { use super::*; use crate::source::nexmark::{NexmarkProperties, NexmarkSplitEnumerator}; - use crate::source::{SourceEnumeratorContext, SplitEnumerator}; + use crate::source::{SourceContext, SourceEnumeratorContext, SplitEnumerator}; #[tokio::test] async fn test_nexmark_split_reader() -> crate::error::ConnectorResult<()> { @@ -224,7 +224,7 @@ mod tests { }; let mut enumerator = - NexmarkSplitEnumerator::new(props.clone(), SourceEnumeratorContext::default().into()) + NexmarkSplitEnumerator::new(props.clone(), SourceEnumeratorContext::dummy().into()) .await?; let list_splits_resp: Vec<_> = enumerator.list_splits().await?.into_iter().collect(); @@ -236,7 +236,7 @@ mod tests { props.clone(), state, Default::default(), - Default::default(), + SourceContext::dummy().into(), None, ) .await? @@ -261,7 +261,7 @@ mod tests { }; let mut enumerator = - NexmarkSplitEnumerator::new(props.clone(), SourceEnumeratorContext::default().into()) + NexmarkSplitEnumerator::new(props.clone(), SourceEnumeratorContext::dummy().into()) .await?; let list_splits_resp: Vec<_> = enumerator.list_splits().await?.into_iter().collect(); @@ -271,7 +271,7 @@ mod tests { props.clone(), state, Default::default(), - Default::default(), + SourceContext::dummy().into(), None, ) .await? diff --git a/src/connector/src/with_options_test.rs b/src/connector/src/with_options_test.rs index 83504f787004f..155932ce90452 100644 --- a/src/connector/src/with_options_test.rs +++ b/src/connector/src/with_options_test.rs @@ -169,8 +169,10 @@ fn generate_with_options_yaml_inner(path: &Path) -> String { let struct_infos = flatten_nested_options(struct_infos); // Generate the output - "# THIS FILE IS AUTO_GENERATED. DO NOT EDIT\n\n".to_string() - + &serde_yaml::to_string(&struct_infos).unwrap() + format!( + "# THIS FILE IS AUTO_GENERATED. DO NOT EDIT\n\n{}", + serde_yaml::to_string(&struct_infos).unwrap() + ) } #[derive(Debug, Serialize, Clone)] diff --git a/src/expr/core/Cargo.toml b/src/expr/core/Cargo.toml index 30f6419e05e5d..3f5ca590026db 100644 --- a/src/expr/core/Cargo.toml +++ b/src/expr/core/Cargo.toml @@ -16,6 +16,7 @@ ignored = ["workspace-hack", "ctor"] normal = ["workspace-hack", "ctor"] [features] +embedded-deno-udf = ["arrow-udf-js-deno"] embedded-python-udf = ["arrow-udf-python"] [dependencies] @@ -23,6 +24,7 @@ anyhow = "1" arrow-array = { workspace = true } arrow-schema = { workspace = true } arrow-udf-js = { workspace = true } +arrow-udf-js-deno = { workspace = true, optional = true } arrow-udf-python = { workspace = true, optional = true } arrow-udf-wasm = { workspace = true } async-trait = "0.1" @@ -39,6 +41,7 @@ easy-ext = "1" educe = "0.5" either = "1" enum-as-inner = "0.6" +futures = "0.3" futures-async-stream = { workspace = true } futures-util = "0.3" itertools = { workspace = true } diff --git a/src/expr/core/src/expr/expr_udf.rs b/src/expr/core/src/expr/expr_udf.rs index 4e63dc5950bbe..ed7d597cce52a 100644 --- a/src/expr/core/src/expr/expr_udf.rs +++ b/src/expr/core/src/expr/expr_udf.rs @@ -21,6 +21,8 @@ use std::time::Duration; use anyhow::{Context, Error}; use arrow_schema::{Field, Fields, Schema}; use arrow_udf_js::{CallMode as JsCallMode, Runtime as JsRuntime}; +#[cfg(feature = "embedded-deno-udf")] +use arrow_udf_js_deno::{CallMode as DenoCallMode, Runtime as DenoRuntime}; #[cfg(feature = "embedded-python-udf")] use arrow_udf_python::{CallMode as PythonCallMode, Runtime as PythonRuntime}; use arrow_udf_wasm::Runtime as WasmRuntime; @@ -73,6 +75,8 @@ pub enum UdfImpl { JavaScript(JsRuntime), #[cfg(feature = "embedded-python-udf")] Python(PythonRuntime), + #[cfg(feature = "embedded-deno-udf")] + Deno(Arc), } #[async_trait::async_trait] @@ -127,9 +131,11 @@ impl UserDefinedFunction { }; let language = match &self.imp { UdfImpl::Wasm(_) => "wasm", - UdfImpl::JavaScript(_) => "javascript", + UdfImpl::JavaScript(_) => "javascript(quickjs)", #[cfg(feature = "embedded-python-udf")] UdfImpl::Python(_) => "python", + #[cfg(feature = "embedded-deno-udf")] + UdfImpl::Deno(_) => "javascript(deno)", UdfImpl::External(_) => "external", }; let labels: &[&str; 4] = &[addr, language, &self.identifier, fragment_id.as_str()]; @@ -152,6 +158,11 @@ impl UserDefinedFunction { UdfImpl::JavaScript(runtime) => runtime.call(&self.identifier, &arrow_input), #[cfg(feature = "embedded-python-udf")] UdfImpl::Python(runtime) => runtime.call(&self.identifier, &arrow_input), + #[cfg(feature = "embedded-deno-udf")] + UdfImpl::Deno(runtime) => tokio::task::block_in_place(|| { + tokio::runtime::Handle::current() + .block_on(runtime.call(&self.identifier, arrow_input)) + }), UdfImpl::External(client) => { let disable_retry_count = self.disable_retry_count.load(Ordering::Relaxed); let result = if self.always_retry_on_network_error { @@ -240,6 +251,15 @@ impl Build for UserDefinedFunction { let return_type = DataType::from(prost.get_return_type().unwrap()); let udf = prost.get_rex_node().unwrap().as_udf().unwrap(); + #[cfg(not(feature = "embedded-deno-udf"))] + let runtime = "quickjs"; + + #[cfg(feature = "embedded-deno-udf")] + let runtime = match udf.runtime.as_deref() { + Some("deno") => "deno", + _ => "quickjs", + }; + let identifier = udf.get_identifier()?; let imp = match udf.language.as_str() { #[cfg(not(madsim))] @@ -250,7 +270,7 @@ impl Build for UserDefinedFunction { let runtime = get_or_create_wasm_runtime(&wasm_binary)?; UdfImpl::Wasm(runtime) } - "javascript" => { + "javascript" if runtime != "deno" => { let mut rt = JsRuntime::new()?; let body = format!( "export function {}({}) {{ {} }}", @@ -266,6 +286,48 @@ impl Build for UserDefinedFunction { )?; UdfImpl::JavaScript(rt) } + #[cfg(feature = "embedded-deno-udf")] + "javascript" if runtime == "deno" => { + let rt = DenoRuntime::new(); + let body = match udf.get_body() { + Ok(body) => body.clone(), + Err(_) => match udf.get_compressed_binary() { + Ok(compressed_binary) => { + let binary = zstd::stream::decode_all(compressed_binary.as_slice()) + .context("failed to decompress binary")?; + String::from_utf8(binary).context("failed to decode binary")? + } + Err(_) => { + bail!("UDF body or compressed binary is required for deno UDF"); + } + }, + }; + + let body = if matches!(udf.function_type.as_deref(), Some("async")) { + format!( + "export async function {}({}) {{ {} }}", + identifier, + udf.arg_names.join(","), + body + ) + } else { + format!( + "export function {}({}) {{ {} }}", + identifier, + udf.arg_names.join(","), + body + ) + }; + + futures::executor::block_on(rt.add_function( + identifier, + arrow_schema::DataType::try_from(&return_type)?, + DenoCallMode::CalledOnNullInput, + &body, + ))?; + + UdfImpl::Deno(rt) + } #[cfg(feature = "embedded-python-udf")] "python" if udf.body.is_some() => { let mut rt = PythonRuntime::builder().sandboxed(true).build()?; diff --git a/src/expr/core/src/table_function/user_defined.rs b/src/expr/core/src/table_function/user_defined.rs index 0d1d726c394c7..b65ee5e77758b 100644 --- a/src/expr/core/src/table_function/user_defined.rs +++ b/src/expr/core/src/table_function/user_defined.rs @@ -18,6 +18,8 @@ use anyhow::Context; use arrow_array::RecordBatch; use arrow_schema::{Field, Fields, Schema, SchemaRef}; use arrow_udf_js::{CallMode as JsCallMode, Runtime as JsRuntime}; +#[cfg(feature = "embedded-deno-udf")] +use arrow_udf_js_deno::{CallMode as DenoCallMode, Runtime as DenoRuntime}; #[cfg(feature = "embedded-python-udf")] use arrow_udf_python::{CallMode as PythonCallMode, Runtime as PythonRuntime}; use cfg_or_panic::cfg_or_panic; @@ -78,6 +80,13 @@ impl UdfImpl { yield res?; } } + #[cfg(feature = "embedded-deno-udf")] + UdfImpl::Deno(runtime) => { + let mut iter = runtime.call_table_function(identifier, input, 1024).await?; + while let Some(res) = iter.next().await { + yield res?; + } + } UdfImpl::Wasm(runtime) => { for res in runtime.call_table_function(identifier, &input)? { yield res?; @@ -188,6 +197,15 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result "deno", + _ => "quickjs", + }; + let client = match udtf.language.as_str() { "wasm" | "rust" => { let compressed_wasm_binary = udtf.get_compressed_binary()?; @@ -196,7 +214,7 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result { + "javascript" if runtime != "deno" => { let mut rt = JsRuntime::new()?; let body = format!( "export function* {}({}) {{ {} }}", @@ -212,6 +230,44 @@ pub fn new_user_defined(prost: &PbTableFunction, chunk_size: usize) -> Result { + let rt = DenoRuntime::new(); + let body = match udtf.get_body() { + Ok(body) => body.clone(), + Err(_) => match udtf.get_compressed_binary() { + Ok(compressed_binary) => { + let binary = zstd::stream::decode_all(compressed_binary.as_slice()) + .context("failed to decompress binary")?; + String::from_utf8(binary).context("failed to decode binary")? + } + Err(_) => { + bail!("UDF body or compressed binary is required for deno UDF"); + } + }, + }; + + let body = format!( + "export {} {}({}) {{ {} }}", + match udtf.function_type.as_deref() { + Some("async") => "async function", + Some("async_generator") => "async function*", + Some("sync") => "function", + _ => "function*", + }, + identifier, + udtf.arg_names.join(","), + body + ); + + futures::executor::block_on(rt.add_function( + identifier, + arrow_schema::DataType::try_from(&return_type)?, + DenoCallMode::CalledOnNullInput, + &body, + ))?; + UdfImpl::Deno(rt) + } #[cfg(feature = "embedded-python-udf")] "python" if udtf.body.is_some() => { let mut rt = PythonRuntime::builder().sandboxed(true).build()?; diff --git a/src/frontend/planner_test/tests/testdata/output/batch_source.yaml b/src/frontend/planner_test/tests/testdata/output/batch_source.yaml index 8613f28305667..63daa9c43b2db 100644 --- a/src/frontend/planner_test/tests/testdata/output/batch_source.yaml +++ b/src/frontend/planner_test/tests/testdata/output/batch_source.yaml @@ -3,11 +3,11 @@ select * from s logical_plan: |- LogicalProject { exprs: [id, value] } - └─LogicalSource { source: s, columns: [id, value, _rw_kafka_timestamp, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: s, columns: [id, value, _rw_kafka_timestamp, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchProject { exprs: [id, value] } - └─BatchSource { source: s, columns: [id, value, _rw_kafka_timestamp, _row_id], filter: (None, None) } + └─BatchKafkaScan { source: s, columns: [id, value, _rw_kafka_timestamp, _row_id], filter: (None, None) } create_source: format: plain encode: protobuf diff --git a/src/frontend/planner_test/tests/testdata/output/generated_columns.yaml b/src/frontend/planner_test/tests/testdata/output/generated_columns.yaml index e88df797de0c8..3ed95c1ac1463 100644 --- a/src/frontend/planner_test/tests/testdata/output/generated_columns.yaml +++ b/src/frontend/planner_test/tests/testdata/output/generated_columns.yaml @@ -17,7 +17,7 @@ batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchProject { exprs: [(v2 + 1:Int32) as $expr1] } - └─BatchSource { source: s1, columns: [v2, _row_id], filter: (None, None) } + └─BatchSource { source: s1, columns: [v2, _row_id] } - name: select proctime() sql: | select proctime(); diff --git a/src/frontend/planner_test/tests/testdata/output/nexmark_source.yaml b/src/frontend/planner_test/tests/testdata/output/nexmark_source.yaml index 2e9484a4c1edf..823fa85459df7 100644 --- a/src/frontend/planner_test/tests/testdata/output/nexmark_source.yaml +++ b/src/frontend/planner_test/tests/testdata/output/nexmark_source.yaml @@ -51,7 +51,7 @@ batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchProject { exprs: [auction, bidder, price, date_time] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [auction, bidder, price, date_time, _row_id] } @@ -87,7 +87,7 @@ batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchProject { exprs: [auction, bidder, (0.908:Decimal * price::Decimal) as $expr1, date_time] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [auction, bidder, (0.908:Decimal * price::Decimal) as $expr1, date_time, _row_id] } @@ -118,7 +118,7 @@ BatchExchange { order: [], dist: Single } └─BatchFilter { predicate: (((((auction = 1007:Int32) OR (auction = 1020:Int32)) OR (auction = 2001:Int32)) OR (auction = 2019:Int32)) OR (auction = 2087:Int32)) } └─BatchProject { exprs: [auction, price] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, price, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [auction, price, _row_id] } @@ -154,11 +154,11 @@ ├─BatchExchange { order: [], dist: HashShard(seller) } │ └─BatchFilter { predicate: (category = 10:Int32) } │ └─BatchProject { exprs: [id, seller, category] } - │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } └─BatchExchange { order: [], dist: HashShard(id) } └─BatchFilter { predicate: (((state = 'or':Varchar) OR (state = 'id':Varchar)) OR (state = 'ca':Varchar)) } └─BatchProject { exprs: [id, name, city, state] } - └─BatchSource { source: person, columns: [id, name, email_address, credit_card, city, state, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: person, columns: [id, name, email_address, credit_card, city, state, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [name, city, state, id, _row_id(hidden), seller(hidden), _row_id#1(hidden)], stream_key: [_row_id, _row_id#1, seller], pk_columns: [_row_id, _row_id#1, seller], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard(_row_id, seller, _row_id) } @@ -244,9 +244,9 @@ └─BatchHashAgg { group_key: [id, category], aggs: [max(price)] } └─BatchHashJoin { type: Inner, predicate: id = auction AND (date_time >= date_time) AND (date_time <= expires), output: [id, category, price] } ├─BatchExchange { order: [], dist: HashShard(id) } - │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } └─BatchExchange { order: [], dist: HashShard(auction) } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [category, avg], stream_key: [category], pk_columns: [category], pk_conflict: NoCheck } └─StreamProject { exprs: [category, (sum(max(price)) / count(max(price))::Decimal) as $expr1] } @@ -380,7 +380,7 @@ │ └─LogicalProject { exprs: [window_start, auction] } │ └─LogicalHopWindow { time_col: date_time, slide: 00:00:02, size: 00:00:10, output: all } │ └─LogicalFilter { predicate: IsNotNull(date_time) } - │ └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } └─LogicalProject { exprs: [max(count), window_start] } └─LogicalAgg { group_key: [window_start], aggs: [max(count)] } └─LogicalProject { exprs: [window_start, count] } @@ -389,7 +389,7 @@ └─LogicalProject { exprs: [auction, window_start] } └─LogicalHopWindow { time_col: date_time, slide: 00:00:02, size: 00:00:10, output: all } └─LogicalFilter { predicate: IsNotNull(date_time) } - └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchHashJoin { type: Inner, predicate: window_start = window_start AND (count >= max(count)), output: [auction, count] } @@ -399,7 +399,7 @@ │ └─BatchExchange { order: [], dist: HashShard(auction) } │ └─BatchProject { exprs: [auction, date_time] } │ └─BatchFilter { predicate: IsNotNull(date_time) } - │ └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } └─BatchHashAgg { group_key: [window_start], aggs: [max(count)] } └─BatchExchange { order: [], dist: HashShard(window_start) } └─BatchHashAgg { group_key: [auction, window_start], aggs: [count] } @@ -407,7 +407,7 @@ └─BatchExchange { order: [], dist: HashShard(auction) } └─BatchProject { exprs: [auction, date_time] } └─BatchFilter { predicate: IsNotNull(date_time) } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], stream_key: [auction, window_start], pk_columns: [auction, window_start], pk_conflict: NoCheck } └─StreamProject { exprs: [auction, count, window_start, window_start] } @@ -614,13 +614,13 @@ BatchExchange { order: [], dist: Single } └─BatchHashJoin { type: Inner, predicate: price = max(price) AND (date_time >= $expr2) AND (date_time <= $expr1), output: [auction, price, bidder, date_time] } ├─BatchExchange { order: [], dist: HashShard(price) } - │ └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } └─BatchExchange { order: [], dist: HashShard(max(price)) } └─BatchProject { exprs: [max(price), $expr1, ($expr1 - '00:00:10':Interval) as $expr2] } └─BatchHashAgg { group_key: [$expr1], aggs: [max(price)] } └─BatchExchange { order: [], dist: HashShard($expr1) } └─BatchProject { exprs: [(TumbleStart(date_time, '00:00:10':Interval) + '00:00:10':Interval) as $expr1, price] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, price, bidder, date_time, _row_id(hidden), $expr1(hidden)], stream_key: [_row_id, $expr1, price], pk_columns: [_row_id, $expr1, price], pk_conflict: NoCheck } └─StreamProject { exprs: [auction, price, bidder, date_time, _row_id, $expr1] } @@ -731,12 +731,12 @@ │ └─BatchExchange { order: [], dist: HashShard(id, name, $expr1, $expr2) } │ └─BatchProject { exprs: [id, name, $expr1, ($expr1 + '00:00:10':Interval) as $expr2] } │ └─BatchProject { exprs: [id, name, email_address, credit_card, city, state, date_time, extra, _row_id, TumbleStart(date_time, '00:00:10':Interval) as $expr1] } - │ └─BatchSource { source: person, columns: [id, name, email_address, credit_card, city, state, date_time, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: person, columns: [id, name, email_address, credit_card, city, state, date_time, extra, _row_id] } └─BatchHashAgg { group_key: [seller, $expr3, $expr4], aggs: [] } └─BatchExchange { order: [], dist: HashShard(seller, $expr3, $expr4) } └─BatchProject { exprs: [seller, $expr3, ($expr3 + '00:00:10':Interval) as $expr4] } └─BatchProject { exprs: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id, TumbleStart(date_time, '00:00:10':Interval) as $expr3] } - └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [id, name, starttime, $expr2(hidden), seller(hidden), $expr3(hidden), $expr4(hidden)], stream_key: [id, name, starttime, $expr2], pk_columns: [id, name, starttime, $expr2], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard(id, name, $expr1, $expr2) } @@ -827,21 +827,21 @@ └─LogicalProject { exprs: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id, auction, bidder, price, channel, url, date_time, extra, _row_id] } └─LogicalFilter { predicate: (id = auction) AND (date_time >= date_time) AND (date_time <= expires) } └─LogicalJoin { type: Inner, on: true, output: all } - ├─LogicalSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], time_range: (Unbounded, Unbounded) } + ├─LogicalSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } + └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } optimized_logical_plan_for_batch: |- LogicalTopN { order: [price DESC, date_time ASC], limit: 1, offset: 0, group_key: [id] } └─LogicalJoin { type: Inner, on: (id = auction) AND (date_time >= date_time) AND (date_time <= expires), output: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, date_time] } - ├─LogicalSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], time_range: (Unbounded, Unbounded) } + ├─LogicalSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } + └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchGroupTopN { order: [price DESC, date_time ASC], limit: 1, offset: 0, group_key: [id] } └─BatchHashJoin { type: Inner, predicate: id = auction AND (date_time >= date_time) AND (date_time <= expires), output: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, date_time] } ├─BatchExchange { order: [], dist: HashShard(id) } - │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } └─BatchExchange { order: [], dist: HashShard(auction) } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, bid_date_time, _row_id(hidden), _row_id#1(hidden)], stream_key: [id], pk_columns: [id], pk_conflict: NoCheck } └─StreamGroupTopN [append_only] { order: [price DESC, date_time ASC], limit: 1, offset: 0, group_key: [id] } @@ -912,7 +912,7 @@ batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchProject { exprs: [auction, bidder, price, date_time, ToChar(date_time, 'YYYY-MM-DD':Varchar) as $expr1, ToChar(date_time, 'HH:MI':Varchar) as $expr2] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, date_time, date, time, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [auction, bidder, price, date_time, ToChar(date_time, 'YYYY-MM-DD':Varchar) as $expr1, ToChar(date_time, 'HH:MI':Varchar) as $expr2, _row_id] } @@ -1012,7 +1012,7 @@ └─BatchProject { exprs: [auction, bidder, (0.908:Decimal * price::Decimal) as $expr1, Case(((Extract('HOUR':Varchar, date_time) >= 8:Decimal) AND (Extract('HOUR':Varchar, date_time) <= 18:Decimal)), 'dayTime':Varchar, ((Extract('HOUR':Varchar, date_time) <= 6:Decimal) OR (Extract('HOUR':Varchar, date_time) >= 20:Decimal)), 'nightTime':Varchar, 'otherTime':Varchar) as $expr2, date_time, extra] } └─BatchFilter { predicate: ((0.908:Decimal * price::Decimal) > 1000000:Decimal) AND ((0.908:Decimal * price::Decimal) < 50000000:Decimal) } └─BatchProject { exprs: [auction, bidder, price, date_time, extra] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, bidtimetype, date_time, extra, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [auction, bidder, (0.908:Decimal * price::Decimal) as $expr1, Case(((Extract('HOUR':Varchar, date_time) >= 8:Decimal) AND (Extract('HOUR':Varchar, date_time) <= 18:Decimal)), 'dayTime':Varchar, ((Extract('HOUR':Varchar, date_time) <= 6:Decimal) OR (Extract('HOUR':Varchar, date_time) >= 20:Decimal)), 'nightTime':Varchar, 'otherTime':Varchar) as $expr2, date_time, extra, _row_id] } @@ -1059,7 +1059,7 @@ └─BatchExchange { order: [], dist: HashShard($expr1_expanded, bidder_expanded, auction_expanded, flag) } └─BatchExpand { column_subsets: [[$expr1], [$expr1, bidder], [$expr1, auction]] } └─BatchProject { exprs: [ToChar(date_time, 'yyyy-MM-dd':Varchar) as $expr1, price, bidder, auction] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [day, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], stream_key: [day], pk_columns: [day], pk_conflict: NoCheck } └─StreamHashAgg [append_only] { group_key: [$expr1], aggs: [count, count filter((price < 10000:Int32)), count filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count filter((price >= 1000000:Int32)), count(distinct bidder), count(distinct bidder) filter((price < 10000:Int32)), count(distinct bidder) filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count(distinct bidder) filter((price >= 1000000:Int32)), count(distinct auction), count(distinct auction) filter((price < 10000:Int32)), count(distinct auction) filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count(distinct auction) filter((price >= 1000000:Int32))] } @@ -1265,7 +1265,7 @@ └─BatchExchange { order: [], dist: HashShard(channel_expanded, $expr1_expanded, bidder_expanded, auction_expanded, flag) } └─BatchExpand { column_subsets: [[channel, $expr1, $expr2], [channel, $expr1, bidder], [channel, $expr1, auction]] } └─BatchProject { exprs: [channel, ToChar(date_time, 'yyyy-MM-dd':Varchar) as $expr1, ToChar(date_time, 'HH:mm':Varchar) as $expr2, price, bidder, auction] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [channel, day, minute, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], stream_key: [channel, day], pk_columns: [channel, day], pk_conflict: NoCheck } └─StreamHashAgg [append_only] { group_key: [channel, $expr1], aggs: [max($expr2), count, count filter((price < 10000:Int32)), count filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count filter((price >= 1000000:Int32)), count(distinct bidder), count(distinct bidder) filter((price < 10000:Int32)), count(distinct bidder) filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count(distinct bidder) filter((price >= 1000000:Int32)), count(distinct auction), count(distinct auction) filter((price < 10000:Int32)), count(distinct auction) filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count(distinct auction) filter((price >= 1000000:Int32))] } @@ -1391,7 +1391,7 @@ └─BatchHashAgg { group_key: [auction, $expr1], aggs: [count, count filter((price < 10000:Int32)), count filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count filter((price >= 1000000:Int32)), min(price), max(price), sum(price), count(price)] } └─BatchExchange { order: [], dist: HashShard(auction, $expr1) } └─BatchProject { exprs: [auction, ToChar(date_time, 'YYYY-MM-DD':Varchar) as $expr1, price] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, day, total_bids, rank1_bids, rank2_bids, rank3_bids, min_price, max_price, avg_price, sum_price], stream_key: [auction, day], pk_columns: [auction, day], pk_conflict: NoCheck } └─StreamProject { exprs: [auction, $expr1, count, count filter((price < 10000:Int32)), count filter((price >= 10000:Int32) AND (price < 1000000:Int32)), count filter((price >= 1000000:Int32)), min(price), max(price), (sum(price) / count(price)::Decimal) as $expr2, sum(price)] } @@ -1438,13 +1438,13 @@ └─LogicalProject { exprs: [auction, bidder, price, channel, url, date_time, extra, row_number] } └─LogicalOverWindow { window_functions: [row_number() OVER(PARTITION BY bidder, auction ORDER BY date_time DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)] } └─LogicalProject { exprs: [auction, bidder, price, channel, url, date_time, extra, _row_id] } - └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchGroupTopN { order: [date_time DESC], limit: 1, offset: 0, group_key: [bidder, auction] } └─BatchExchange { order: [], dist: HashShard(bidder, auction) } └─BatchProject { exprs: [auction, bidder, price, channel, url, date_time, extra] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, _row_id(hidden)], stream_key: [bidder, auction], pk_columns: [bidder, auction], pk_conflict: NoCheck } └─StreamGroupTopN [append_only] { order: [date_time DESC], limit: 1, offset: 0, group_key: [bidder, auction] } @@ -1494,13 +1494,13 @@ └─LogicalProject { exprs: [auction, bidder, price, channel, url, date_time, extra, rank] } └─LogicalOverWindow { window_functions: [rank() OVER(PARTITION BY bidder, auction ORDER BY date_time DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)] } └─LogicalProject { exprs: [auction, bidder, price, channel, url, date_time, extra, _row_id] } - └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchGroupTopN { order: [date_time DESC], limit: 1, offset: 0, with_ties: true, group_key: [bidder, auction] } └─BatchExchange { order: [], dist: HashShard(bidder, auction) } └─BatchProject { exprs: [auction, bidder, price, channel, url, date_time, extra] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, _row_id(hidden)], stream_key: [bidder, auction, _row_id], pk_columns: [bidder, auction, _row_id], pk_conflict: NoCheck } └─StreamGroupTopN [append_only] { order: [date_time DESC], limit: 1, offset: 0, with_ties: true, group_key: [bidder, auction] } @@ -1549,7 +1549,7 @@ └─LogicalProject { exprs: [auction, bidder, price, channel, url, date_time, extra, row_number] } └─LogicalOverWindow { window_functions: [row_number() OVER(PARTITION BY auction ORDER BY price DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)] } └─LogicalProject { exprs: [auction, bidder, price, channel, url, date_time, extra, _row_id] } - └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchOverWindow { window_functions: [row_number() OVER(PARTITION BY auction ORDER BY price DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)] } @@ -1557,7 +1557,7 @@ └─BatchGroupTopN { order: [price DESC], limit: 10, offset: 0, group_key: [auction] } └─BatchExchange { order: [], dist: HashShard(auction) } └─BatchProject { exprs: [auction, bidder, price, channel, url, date_time, extra] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, _row_id(hidden), rank_number], stream_key: [auction, _row_id], pk_columns: [auction, _row_id], pk_conflict: NoCheck } └─StreamOverWindow { window_functions: [row_number() OVER(PARTITION BY auction ORDER BY price DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)] } @@ -1616,11 +1616,11 @@ BatchExchange { order: [], dist: Single } └─BatchHashJoin { type: Inner, predicate: auction = id, output: [auction, bidder, price, channel, url, date_time, item_name, description, initial_bid, reserve, date_time, expires, seller, category] } ├─BatchExchange { order: [], dist: HashShard(auction) } - │ └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } └─BatchExchange { order: [], dist: HashShard(id) } └─BatchFilter { predicate: (category = 10:Int32) } └─BatchProject { exprs: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category] } - └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, url, date_timeb, item_name, description, initial_bid, reserve, date_timea, expires, seller, category, _row_id(hidden), _row_id#1(hidden)], stream_key: [_row_id, _row_id#1, auction], pk_columns: [_row_id, _row_id#1, auction], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard(auction, _row_id, _row_id) } @@ -1693,7 +1693,7 @@ └─BatchProject { exprs: [auction, bidder, price, channel, Case((Lower(channel) = 'apple':Varchar), '0':Varchar, (Lower(channel) = 'google':Varchar), '1':Varchar, (Lower(channel) = 'facebook':Varchar), '2':Varchar, (Lower(channel) = 'baidu':Varchar), '3':Varchar, ArrayAccess(RegexpMatch(url, '(&|^)channel_id=([^&]*)':Varchar), 2:Int32)) as $expr1] } └─BatchFilter { predicate: (IsNotNull(ArrayAccess(RegexpMatch(url, '(&|^)channel_id=([^&]*)':Varchar), 2:Int32)) OR In(Lower(channel), 'apple':Varchar, 'google':Varchar, 'facebook':Varchar, 'baidu':Varchar)) } └─BatchProject { exprs: [auction, bidder, price, channel, url] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, channel_id, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [auction, bidder, price, channel, Case((Lower(channel) = 'apple':Varchar), '0':Varchar, (Lower(channel) = 'google':Varchar), '1':Varchar, (Lower(channel) = 'facebook':Varchar), '2':Varchar, (Lower(channel) = 'baidu':Varchar), '3':Varchar, ArrayAccess(RegexpMatch(url, '(&|^)channel_id=([^&]*)':Varchar), 2:Int32)) as $expr1, _row_id] } @@ -1724,7 +1724,7 @@ batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchProject { exprs: [auction, bidder, price, channel, SplitPart(url, '/':Varchar, 4:Int32) as $expr1, SplitPart(url, '/':Varchar, 5:Int32) as $expr2, SplitPart(url, '/':Varchar, 6:Int32) as $expr3] } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, dir1, dir2, dir3, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [auction, bidder, price, channel, SplitPart(url, '/':Varchar, 4:Int32) as $expr1, SplitPart(url, '/':Varchar, 5:Int32) as $expr2, SplitPart(url, '/':Varchar, 6:Int32) as $expr3, _row_id] } @@ -1765,10 +1765,10 @@ BatchExchange { order: [], dist: Single } └─BatchHashJoin { type: LeftOuter, predicate: id = auction, output: [id, item_name, max(price)] } ├─BatchExchange { order: [], dist: HashShard(id) } - │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } └─BatchHashAgg { group_key: [auction], aggs: [max(price)] } └─BatchExchange { order: [], dist: HashShard(auction) } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction_id, auction_item_name, current_highest_bid, _row_id(hidden), auction(hidden)], stream_key: [_row_id, auction_id], pk_columns: [_row_id, auction_id], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard(id, _row_id) } @@ -1853,16 +1853,16 @@ │ └─BatchHashAgg { group_key: [id, item_name], aggs: [count(auction)] } │ └─BatchHashJoin { type: Inner, predicate: id = auction, output: [id, item_name, auction] } │ ├─BatchExchange { order: [], dist: HashShard(id) } - │ │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + │ │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } │ └─BatchExchange { order: [], dist: HashShard(auction) } - │ └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } └─BatchProject { exprs: [(sum0(sum0(count)) / sum0(count(auction))) as $expr1] } └─BatchSimpleAgg { aggs: [sum0(sum0(count)), sum0(count(auction))] } └─BatchExchange { order: [], dist: Single } └─BatchSimpleAgg { aggs: [sum0(count), count(auction)] } └─BatchHashAgg { group_key: [auction], aggs: [count] } └─BatchExchange { order: [], dist: HashShard(auction) } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], stream_key: [auction_id, auction_item_name], pk_columns: [auction_id, auction_item_name], pk_conflict: NoCheck } └─StreamDynamicFilter { predicate: (count(auction) >= $expr1), output: [id, item_name, count(auction)] } @@ -1982,12 +1982,12 @@ BatchExchange { order: [], dist: Single } └─BatchHashJoin { type: LeftSemi, predicate: id = auction, output: [id, item_name] } ├─BatchExchange { order: [], dist: HashShard(id) } - │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } └─BatchProject { exprs: [auction] } └─BatchFilter { predicate: (count >= 20:Int32) } └─BatchHashAgg { group_key: [auction], aggs: [count] } └─BatchExchange { order: [], dist: HashShard(auction) } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], stream_key: [_row_id, auction_id], pk_columns: [_row_id, auction_id], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard(id, _row_id) } @@ -2071,12 +2071,12 @@ BatchExchange { order: [], dist: Single } └─BatchHashJoin { type: LeftAnti, predicate: id = auction, output: [id, item_name] } ├─BatchExchange { order: [], dist: HashShard(id) } - │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } └─BatchProject { exprs: [auction] } └─BatchFilter { predicate: (count < 20:Int32) } └─BatchHashAgg { group_key: [auction], aggs: [count] } └─BatchExchange { order: [], dist: HashShard(auction) } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], stream_key: [_row_id, auction_id], pk_columns: [_row_id, auction_id], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard(id, _row_id) } @@ -2163,9 +2163,9 @@ └─BatchHashAgg { group_key: [id, item_name], aggs: [count(auction)] } └─BatchHashJoin { type: Inner, predicate: id = auction, output: [id, item_name, auction] } ├─BatchExchange { order: [], dist: HashShard(id) } - │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } └─BatchExchange { order: [], dist: HashShard(auction) } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], stream_key: [auction_id, auction_item_name], pk_columns: [bid_count, auction_id, auction_item_name], pk_conflict: NoCheck } └─StreamProject { exprs: [id, item_name, count(auction)] } @@ -2272,9 +2272,9 @@ └─BatchHashAgg { group_key: [id], aggs: [max(price)] } └─BatchHashJoin { type: Inner, predicate: id = auction AND (date_time >= date_time) AND (date_time <= expires), output: [id, price] } ├─BatchExchange { order: [], dist: HashShard(id) } - │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } └─BatchExchange { order: [], dist: HashShard(auction) } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [min_final], stream_key: [], pk_columns: [], pk_conflict: NoCheck } └─StreamProject { exprs: [min(min(max(price)))] } diff --git a/src/frontend/planner_test/tests/testdata/output/nexmark_watermark.yaml b/src/frontend/planner_test/tests/testdata/output/nexmark_watermark.yaml index 12593221419d6..6dd731cffffb0 100644 --- a/src/frontend/planner_test/tests/testdata/output/nexmark_watermark.yaml +++ b/src/frontend/planner_test/tests/testdata/output/nexmark_watermark.yaml @@ -11,7 +11,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, Field(bid, 2:Int32) as $expr4, $expr1] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck, watermark_columns: [date_time] } └─StreamProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, Field(bid, 2:Int32) as $expr4, $expr1, _row_id], output_watermarks: [$expr1] } @@ -35,7 +35,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, (0.908:Decimal * Field(bid, 2:Int32)::Decimal) as $expr4, $expr1] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, date_time, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck, watermark_columns: [date_time] } └─StreamProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, (0.908:Decimal * Field(bid, 2:Int32)::Decimal) as $expr4, $expr1, _row_id], output_watermarks: [$expr1] } @@ -79,7 +79,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 2:Int32) as $expr3] } └─BatchFilter { predicate: (((((Field(bid, 0:Int32) = 1007:Int32) OR (Field(bid, 0:Int32) = 1020:Int32)) OR (Field(bid, 0:Int32) = 2001:Int32)) OR (Field(bid, 0:Int32) = 2019:Int32)) OR (Field(bid, 0:Int32) = 2087:Int32)) AND (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, price, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 2:Int32) as $expr3, _row_id] } @@ -124,12 +124,12 @@ │ └─BatchProject { exprs: [Field(auction, 0:Int32) as $expr1, Field(auction, 7:Int32) as $expr2] } │ └─BatchFilter { predicate: (Field(auction, 8:Int32) = 10:Int32) AND (event_type = 1:Int32) } │ └─BatchProject { exprs: [event_type, auction] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchExchange { order: [], dist: HashShard($expr3) } └─BatchProject { exprs: [Field(person, 0:Int32) as $expr3, Field(person, 1:Int32) as $expr4, Field(person, 4:Int32) as $expr5, Field(person, 5:Int32) as $expr6] } └─BatchFilter { predicate: (((Field(person, 5:Int32) = 'or':Varchar) OR (Field(person, 5:Int32) = 'id':Varchar)) OR (Field(person, 5:Int32) = 'ca':Varchar)) AND (event_type = 0:Int32) } └─BatchProject { exprs: [event_type, person] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [name, city, state, id, _row_id(hidden), $expr3(hidden), _row_id#1(hidden)], stream_key: [_row_id, _row_id#1, $expr3], pk_columns: [_row_id, _row_id#1, $expr3], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard(_row_id, $expr3, _row_id) } @@ -226,12 +226,12 @@ │ └─BatchProject { exprs: [Field(auction, 0:Int32) as $expr2, $expr1, Field(auction, 6:Int32) as $expr3, Field(auction, 8:Int32) as $expr4] } │ └─BatchFilter { predicate: (event_type = 1:Int32) } │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchExchange { order: [], dist: HashShard($expr6) } └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr6, Field(bid, 2:Int32) as $expr7, $expr5] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr5, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [category, avg], stream_key: [category], pk_columns: [category], pk_conflict: NoCheck } └─StreamProject { exprs: [$expr4, (sum(max($expr6)) / count(max($expr6))::Decimal) as $expr7] } @@ -359,7 +359,7 @@ │ └─LogicalShare { id: 3 } │ └─LogicalProject { exprs: [Field(bid, 0:Int32) as $expr1, Field(bid, 1:Int32) as $expr2, Field(bid, 2:Int32) as $expr3, Field(bid, 3:Int32) as $expr4, Field(bid, 4:Int32) as $expr5, date_time, Field(bid, 6:Int32) as $expr6] } │ └─LogicalFilter { predicate: (event_type = 2:Int32) } - │ └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id] } └─LogicalProject { exprs: [max(count), window_start] } └─LogicalAgg { group_key: [window_start], aggs: [max(count)] } └─LogicalProject { exprs: [window_start, count] } @@ -371,7 +371,7 @@ └─LogicalShare { id: 3 } └─LogicalProject { exprs: [Field(bid, 0:Int32) as $expr1, Field(bid, 1:Int32) as $expr2, Field(bid, 2:Int32) as $expr3, Field(bid, 3:Int32) as $expr4, Field(bid, 4:Int32) as $expr5, date_time, Field(bid, 6:Int32) as $expr6] } └─LogicalFilter { predicate: (event_type = 2:Int32) } - └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchHashJoin { type: Inner, predicate: window_start = window_start AND (count >= max(count)), output: [$expr2, count] } @@ -382,7 +382,7 @@ │ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, $expr1] } │ └─BatchFilter { predicate: IsNotNull($expr1) AND (event_type = 2:Int32) } │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchHashAgg { group_key: [window_start], aggs: [max(count)] } └─BatchExchange { order: [], dist: HashShard(window_start) } └─BatchHashAgg { group_key: [$expr4, window_start], aggs: [count] } @@ -391,7 +391,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr4, $expr3] } └─BatchFilter { predicate: IsNotNull($expr3) AND (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr3, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], stream_key: [auction, window_start], pk_columns: [auction, window_start], pk_conflict: NoCheck, watermark_columns: [window_start(hidden), window_start#1(hidden)] } └─StreamProject { exprs: [$expr2, count, window_start, window_start], output_watermarks: [window_start, window_start] } @@ -679,7 +679,7 @@ │ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, Field(bid, 2:Int32) as $expr4, $expr1] } │ └─BatchFilter { predicate: (event_type = 2:Int32) } │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchExchange { order: [], dist: HashShard(max($expr7)) } └─BatchProject { exprs: [max($expr7), $expr6, ($expr6 - '00:00:10':Interval) as $expr8] } └─BatchHashAgg { group_key: [$expr6], aggs: [max($expr7)] } @@ -687,7 +687,7 @@ └─BatchProject { exprs: [(TumbleStart($expr5, '00:00:10':Interval) + '00:00:10':Interval) as $expr6, Field(bid, 2:Int32) as $expr7] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr5, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, price, bidder, date_time, _row_id(hidden), $expr5(hidden)], stream_key: [_row_id, $expr5, price], pk_columns: [_row_id, $expr5, price], pk_conflict: NoCheck, watermark_columns: [date_time, $expr5(hidden)] } └─StreamExchange { dist: HashShard($expr4, _row_id, $expr5) } @@ -831,14 +831,14 @@ │ └─BatchProject { exprs: [event_type, person, auction, bid, $expr1, _row_id, TumbleStart($expr1, '00:00:10':Interval) as $expr2] } │ └─BatchFilter { predicate: (event_type = 0:Int32) } │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchHashAgg { group_key: [$expr8, $expr7, $expr9], aggs: [] } └─BatchExchange { order: [], dist: HashShard($expr8, $expr7, $expr9) } └─BatchProject { exprs: [Field(auction, 7:Int32) as $expr8, $expr7, ($expr7 + '00:00:10':Interval) as $expr9] } └─BatchProject { exprs: [event_type, person, auction, bid, $expr6, _row_id, TumbleStart($expr6, '00:00:10':Interval) as $expr7] } └─BatchFilter { predicate: (event_type = 1:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr6, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [id, name, starttime, $expr5(hidden), $expr7(hidden), $expr6(hidden), $expr8(hidden)], stream_key: [id, name, starttime, $expr5], pk_columns: [id, name, starttime, $expr5], pk_conflict: NoCheck, watermark_columns: [starttime, $expr5(hidden), $expr6(hidden), $expr8(hidden)] } └─StreamExchange { dist: HashShard($expr3, $expr4, $expr2, $expr5) } @@ -976,20 +976,20 @@ ├─LogicalShare { id: 3 } │ └─LogicalProject { exprs: [Field(auction, 0:Int32) as $expr1, Field(auction, 1:Int32) as $expr2, Field(auction, 2:Int32) as $expr3, Field(auction, 3:Int32) as $expr4, Field(auction, 4:Int32) as $expr5, date_time, Field(auction, 6:Int32) as $expr6, Field(auction, 7:Int32) as $expr7, Field(auction, 8:Int32) as $expr8, Field(auction, 9:Int32) as $expr9] } │ └─LogicalFilter { predicate: (event_type = 1:Int32) } - │ └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id] } └─LogicalShare { id: 6 } └─LogicalProject { exprs: [Field(bid, 0:Int32) as $expr10, Field(bid, 1:Int32) as $expr11, Field(bid, 2:Int32) as $expr12, Field(bid, 3:Int32) as $expr13, Field(bid, 4:Int32) as $expr14, date_time, Field(bid, 6:Int32) as $expr15] } └─LogicalFilter { predicate: (event_type = 2:Int32) } - └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id] } optimized_logical_plan_for_batch: |- LogicalTopN { order: [$expr11 DESC, date_time ASC], limit: 1, offset: 0, group_key: [$expr1] } └─LogicalJoin { type: Inner, on: ($expr1 = $expr9) AND (date_time >= date_time) AND (date_time <= $expr6), output: all } ├─LogicalProject { exprs: [Field(auction, 0:Int32) as $expr1, Field(auction, 1:Int32) as $expr2, Field(auction, 2:Int32) as $expr3, Field(auction, 3:Int32) as $expr4, Field(auction, 4:Int32) as $expr5, date_time, Field(auction, 6:Int32) as $expr6, Field(auction, 7:Int32) as $expr7, Field(auction, 8:Int32) as $expr8] } │ └─LogicalFilter { predicate: (event_type = 1:Int32) } - │ └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id] } └─LogicalProject { exprs: [Field(bid, 0:Int32) as $expr9, Field(bid, 1:Int32) as $expr10, Field(bid, 2:Int32) as $expr11, date_time] } └─LogicalFilter { predicate: (event_type = 2:Int32) } - └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchGroupTopN { order: [$expr13 DESC, $expr10 ASC], limit: 1, offset: 0, group_key: [$expr2] } @@ -998,12 +998,12 @@ │ └─BatchProject { exprs: [Field(auction, 0:Int32) as $expr2, Field(auction, 1:Int32) as $expr3, Field(auction, 2:Int32) as $expr4, Field(auction, 3:Int32) as $expr5, Field(auction, 4:Int32) as $expr6, $expr1, Field(auction, 6:Int32) as $expr7, Field(auction, 7:Int32) as $expr8, Field(auction, 8:Int32) as $expr9] } │ └─BatchFilter { predicate: (event_type = 1:Int32) } │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchExchange { order: [], dist: HashShard($expr11) } └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr11, Field(bid, 1:Int32) as $expr12, Field(bid, 2:Int32) as $expr13, $expr10] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr10, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, auction, bidder, price, bid_date_time, _row_id(hidden), _row_id#1(hidden)], stream_key: [id], pk_columns: [id], pk_conflict: NoCheck, watermark_columns: [date_time, bid_date_time] } └─StreamGroupTopN [append_only] { order: [$expr12 DESC, $expr1 ASC], limit: 1, offset: 0, group_key: [$expr2], output_watermarks: [$expr1, $expr1] } @@ -1106,7 +1106,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, Field(bid, 2:Int32) as $expr4, $expr1, ToChar($expr1, 'YYYY-MM-DD':Varchar) as $expr5, ToChar($expr1, 'HH:MI':Varchar) as $expr6] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, date_time, date, time, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck, watermark_columns: [date_time] } └─StreamProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, Field(bid, 2:Int32) as $expr4, $expr1, ToChar($expr1, 'YYYY-MM-DD':Varchar) as $expr5, ToChar($expr1, 'HH:MI':Varchar) as $expr6, _row_id], output_watermarks: [$expr1] } @@ -1217,7 +1217,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, (0.908:Decimal * Field(bid, 2:Int32)::Decimal) as $expr4, Case(((Extract('HOUR':Varchar, $expr1) >= 8:Decimal) AND (Extract('HOUR':Varchar, $expr1) <= 18:Decimal)), 'dayTime':Varchar, ((Extract('HOUR':Varchar, $expr1) <= 6:Decimal) OR (Extract('HOUR':Varchar, $expr1) >= 20:Decimal)), 'nightTime':Varchar, 'otherTime':Varchar) as $expr5, $expr1, Field(bid, 6:Int32) as $expr6] } └─BatchFilter { predicate: ((0.908:Decimal * Field(bid, 2:Int32)::Decimal) > 1000000:Decimal) AND ((0.908:Decimal * Field(bid, 2:Int32)::Decimal) < 50000000:Decimal) AND (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, bidtimetype, date_time, extra, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck, watermark_columns: [date_time] } └─StreamProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, (0.908:Decimal * Field(bid, 2:Int32)::Decimal) as $expr4, Case(((Extract('HOUR':Varchar, $expr1) >= 8:Decimal) AND (Extract('HOUR':Varchar, $expr1) <= 18:Decimal)), 'dayTime':Varchar, ((Extract('HOUR':Varchar, $expr1) <= 6:Decimal) OR (Extract('HOUR':Varchar, $expr1) >= 20:Decimal)), 'nightTime':Varchar, 'otherTime':Varchar) as $expr5, $expr1, Field(bid, 6:Int32) as $expr6, _row_id], output_watermarks: [$expr1] } @@ -1281,7 +1281,7 @@ └─BatchProject { exprs: [ToChar($expr1, 'yyyy-MM-dd':Varchar) as $expr2, Field(bid, 2:Int32) as $expr3, Field(bid, 1:Int32) as $expr4, Field(bid, 0:Int32) as $expr5] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [day, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], stream_key: [day], pk_columns: [day], pk_conflict: NoCheck } └─StreamHashAgg [append_only] { group_key: [$expr2], aggs: [count, count filter(($expr3 < 10000:Int32)), count filter(($expr3 >= 10000:Int32) AND ($expr3 < 1000000:Int32)), count filter(($expr3 >= 1000000:Int32)), count(distinct $expr4), count(distinct $expr4) filter(($expr3 < 10000:Int32)), count(distinct $expr4) filter(($expr3 >= 10000:Int32) AND ($expr3 < 1000000:Int32)), count(distinct $expr4) filter(($expr3 >= 1000000:Int32)), count(distinct $expr5), count(distinct $expr5) filter(($expr3 < 10000:Int32)), count(distinct $expr5) filter(($expr3 >= 10000:Int32) AND ($expr3 < 1000000:Int32)), count(distinct $expr5) filter(($expr3 >= 1000000:Int32))] } @@ -1359,7 +1359,7 @@ └─BatchProject { exprs: [Field(bid, 3:Int32) as $expr2, ToChar($expr1, 'yyyy-MM-dd':Varchar) as $expr3, ToChar($expr1, 'HH:mm':Varchar) as $expr4, Field(bid, 2:Int32) as $expr5, Field(bid, 1:Int32) as $expr6, Field(bid, 0:Int32) as $expr7] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [channel, day, minute, total_bids, rank1_bids, rank2_bids, rank3_bids, total_bidders, rank1_bidders, rank2_bidders, rank3_bidders, total_auctions, rank1_auctions, rank2_auctions, rank3_auctions], stream_key: [channel, day], pk_columns: [channel, day], pk_conflict: NoCheck } └─StreamHashAgg [append_only] { group_key: [$expr2, $expr3], aggs: [max($expr4), count, count filter(($expr5 < 10000:Int32)), count filter(($expr5 >= 10000:Int32) AND ($expr5 < 1000000:Int32)), count filter(($expr5 >= 1000000:Int32)), count(distinct $expr6), count(distinct $expr6) filter(($expr5 < 10000:Int32)), count(distinct $expr6) filter(($expr5 >= 10000:Int32) AND ($expr5 < 1000000:Int32)), count(distinct $expr6) filter(($expr5 >= 1000000:Int32)), count(distinct $expr7), count(distinct $expr7) filter(($expr5 < 10000:Int32)), count(distinct $expr7) filter(($expr5 >= 10000:Int32) AND ($expr5 < 1000000:Int32)), count(distinct $expr7) filter(($expr5 >= 1000000:Int32))] } @@ -1430,7 +1430,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, ToChar($expr1, 'YYYY-MM-DD':Varchar) as $expr3, Field(bid, 2:Int32) as $expr4] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, day, total_bids, rank1_bids, rank2_bids, rank3_bids, min_price, max_price, avg_price, sum_price], stream_key: [auction, day], pk_columns: [auction, day], pk_conflict: NoCheck } └─StreamProject { exprs: [$expr2, $expr3, count, count filter(($expr4 < 10000:Int32)), count filter(($expr4 >= 10000:Int32) AND ($expr4 < 1000000:Int32)), count filter(($expr4 >= 1000000:Int32)), min($expr4), max($expr4), (sum($expr4) / count($expr4)::Decimal) as $expr5, sum($expr4)] } @@ -1491,7 +1491,7 @@ └─LogicalShare { id: 3 } └─LogicalProject { exprs: [Field(bid, 0:Int32) as $expr1, Field(bid, 1:Int32) as $expr2, Field(bid, 2:Int32) as $expr3, Field(bid, 3:Int32) as $expr4, Field(bid, 4:Int32) as $expr5, date_time, Field(bid, 6:Int32) as $expr6] } └─LogicalFilter { predicate: (event_type = 2:Int32) } - └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchGroupTopN { order: [$expr1 DESC], limit: 1, offset: 0, group_key: [$expr3, $expr2] } @@ -1499,7 +1499,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, Field(bid, 2:Int32) as $expr4, Field(bid, 3:Int32) as $expr5, Field(bid, 4:Int32) as $expr6, $expr1, Field(bid, 6:Int32) as $expr7] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, _row_id(hidden)], stream_key: [bidder, auction], pk_columns: [bidder, auction], pk_conflict: NoCheck, watermark_columns: [date_time] } └─StreamGroupTopN [append_only] { order: [$expr1 DESC], limit: 1, offset: 0, group_key: [$expr3, $expr2], output_watermarks: [$expr1] } @@ -1561,7 +1561,7 @@ └─LogicalShare { id: 3 } └─LogicalProject { exprs: [Field(bid, 0:Int32) as $expr1, Field(bid, 1:Int32) as $expr2, Field(bid, 2:Int32) as $expr3, Field(bid, 3:Int32) as $expr4, Field(bid, 4:Int32) as $expr5, date_time, Field(bid, 6:Int32) as $expr6] } └─LogicalFilter { predicate: (event_type = 2:Int32) } - └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchGroupTopN { order: [$expr1 DESC], limit: 1, offset: 0, with_ties: true, group_key: [$expr3, $expr2] } @@ -1569,7 +1569,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, Field(bid, 2:Int32) as $expr4, Field(bid, 3:Int32) as $expr5, Field(bid, 4:Int32) as $expr6, $expr1, Field(bid, 6:Int32) as $expr7] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, _row_id(hidden)], stream_key: [bidder, auction, _row_id], pk_columns: [bidder, auction, _row_id], pk_conflict: NoCheck, watermark_columns: [date_time] } └─StreamGroupTopN [append_only] { order: [$expr1 DESC], limit: 1, offset: 0, with_ties: true, group_key: [$expr3, $expr2], output_watermarks: [$expr1] } @@ -1630,7 +1630,7 @@ └─LogicalShare { id: 3 } └─LogicalProject { exprs: [Field(bid, 0:Int32) as $expr1, Field(bid, 1:Int32) as $expr2, Field(bid, 2:Int32) as $expr3, Field(bid, 3:Int32) as $expr4, Field(bid, 4:Int32) as $expr5, date_time, Field(bid, 6:Int32) as $expr6] } └─LogicalFilter { predicate: (event_type = 2:Int32) } - └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: nexmark, columns: [event_type, person, auction, bid, date_time, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchOverWindow { window_functions: [row_number() OVER(PARTITION BY $expr2 ORDER BY $expr4 DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)] } @@ -1640,7 +1640,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, Field(bid, 2:Int32) as $expr4, Field(bid, 3:Int32) as $expr5, Field(bid, 4:Int32) as $expr6, $expr1, Field(bid, 6:Int32) as $expr7] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, url, date_time, extra, _row_id(hidden), rank_number], stream_key: [auction, _row_id], pk_columns: [auction, _row_id], pk_conflict: NoCheck } └─StreamOverWindow { window_functions: [row_number() OVER(PARTITION BY $expr2 ORDER BY $expr4 DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)] } @@ -1696,12 +1696,12 @@ │ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr2, Field(bid, 1:Int32) as $expr3, Field(bid, 2:Int32) as $expr4, Field(bid, 3:Int32) as $expr5, Field(bid, 4:Int32) as $expr6, $expr1] } │ └─BatchFilter { predicate: (event_type = 2:Int32) } │ └─BatchProject { exprs: [event_type, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchExchange { order: [], dist: HashShard($expr8) } └─BatchProject { exprs: [Field(auction, 0:Int32) as $expr8, Field(auction, 1:Int32) as $expr9, Field(auction, 2:Int32) as $expr10, Field(auction, 3:Int32) as $expr11, Field(auction, 4:Int32) as $expr12, $expr7, Field(auction, 6:Int32) as $expr13, Field(auction, 7:Int32) as $expr14, Field(auction, 8:Int32) as $expr15] } └─BatchFilter { predicate: (Field(auction, 8:Int32) = 10:Int32) AND (event_type = 1:Int32) } └─BatchProject { exprs: [event_type, auction, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr7] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, url, date_timeb, item_name, description, initial_bid, reserve, date_timea, expires, seller, category, _row_id(hidden), _row_id#1(hidden)], stream_key: [_row_id, _row_id#1, auction], pk_columns: [_row_id, _row_id#1, auction], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard($expr2, _row_id, _row_id) } @@ -1800,7 +1800,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr1, Field(bid, 1:Int32) as $expr2, Field(bid, 2:Int32) as $expr3, Field(bid, 3:Int32) as $expr4, Field(bid, 4:Int32) as $expr5] } └─BatchFilter { predicate: (IsNotNull(ArrayAccess(RegexpMatch(Field(bid, 4:Int32), '(&|^)channel_id=([^&]*)':Varchar), 2:Int32)) OR In(Lower(Field(bid, 3:Int32)), 'apple':Varchar, 'google':Varchar, 'facebook':Varchar, 'baidu':Varchar)) AND (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, bid] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, channel_id, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [$expr2, $expr3, $expr4, $expr5, Case((Lower($expr5) = 'apple':Varchar), '0':Varchar, (Lower($expr5) = 'google':Varchar), '1':Varchar, (Lower($expr5) = 'facebook':Varchar), '2':Varchar, (Lower($expr5) = 'baidu':Varchar), '3':Varchar, ArrayAccess(RegexpMatch($expr6, '(&|^)channel_id=([^&]*)':Varchar), 2:Int32)) as $expr7, _row_id] } @@ -1842,7 +1842,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr1, Field(bid, 1:Int32) as $expr2, Field(bid, 2:Int32) as $expr3, Field(bid, 3:Int32) as $expr4, Field(bid, 4:Int32) as $expr5] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, bid] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, bidder, price, channel, dir1, dir2, dir3, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [$expr2, $expr3, $expr4, $expr5, SplitPart($expr6, '/':Varchar, 4:Int32) as $expr7, SplitPart($expr6, '/':Varchar, 5:Int32) as $expr8, SplitPart($expr6, '/':Varchar, 6:Int32) as $expr9, _row_id] } @@ -1899,13 +1899,13 @@ │ └─BatchProject { exprs: [Field(auction, 0:Int32) as $expr2, Field(auction, 1:Int32) as $expr3] } │ └─BatchFilter { predicate: (event_type = 1:Int32) } │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchHashAgg { group_key: [$expr5], aggs: [max($expr6)] } └─BatchExchange { order: [], dist: HashShard($expr5) } └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr5, Field(bid, 2:Int32) as $expr6] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr4, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction_id, auction_item_name, current_highest_bid, _row_id(hidden), $expr4(hidden)], stream_key: [_row_id, auction_id], pk_columns: [_row_id, auction_id], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard($expr2, _row_id) } @@ -2015,12 +2015,12 @@ │ │ └─BatchProject { exprs: [Field(auction, 0:Int32) as $expr2, Field(auction, 1:Int32) as $expr3] } │ │ └─BatchFilter { predicate: (event_type = 1:Int32) } │ │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - │ │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } │ └─BatchExchange { order: [], dist: HashShard($expr5) } │ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr5] } │ └─BatchFilter { predicate: (event_type = 2:Int32) } │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr4, _row_id] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchProject { exprs: [(sum0(sum0(count)) / sum0(count($expr7))) as $expr8] } └─BatchSimpleAgg { aggs: [sum0(sum0(count)), sum0(count($expr7))] } └─BatchExchange { order: [], dist: Single } @@ -2030,7 +2030,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr7] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr6, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], stream_key: [auction_id, auction_item_name], pk_columns: [auction_id, auction_item_name], pk_conflict: NoCheck } └─StreamDynamicFilter { predicate: (count($expr4) >= $expr5), output: [$expr2, $expr3, count($expr4)] } @@ -2174,7 +2174,7 @@ │ └─BatchProject { exprs: [Field(auction, 0:Int32) as $expr2, Field(auction, 1:Int32) as $expr3] } │ └─BatchFilter { predicate: (event_type = 1:Int32) } │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchProject { exprs: [$expr5] } └─BatchFilter { predicate: (count >= 20:Int32) } └─BatchHashAgg { group_key: [$expr5], aggs: [count] } @@ -2182,7 +2182,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr5] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr4, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], stream_key: [_row_id, auction_id], pk_columns: [_row_id, auction_id], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard($expr2, _row_id) } @@ -2285,7 +2285,7 @@ │ └─BatchProject { exprs: [Field(auction, 0:Int32) as $expr2, Field(auction, 1:Int32) as $expr3] } │ └─BatchFilter { predicate: (event_type = 1:Int32) } │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchProject { exprs: [$expr5] } └─BatchFilter { predicate: (count < 20:Int32) } └─BatchHashAgg { group_key: [$expr5], aggs: [count] } @@ -2293,7 +2293,7 @@ └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr5] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr4, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction_id, auction_item_name, _row_id(hidden)], stream_key: [_row_id, auction_id], pk_columns: [_row_id, auction_id], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard($expr2, _row_id) } @@ -2399,12 +2399,12 @@ │ └─BatchProject { exprs: [Field(auction, 0:Int32) as $expr2, Field(auction, 1:Int32) as $expr3] } │ └─BatchFilter { predicate: (event_type = 1:Int32) } │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchExchange { order: [], dist: HashShard($expr5) } └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr5] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr4, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction_id, auction_item_name, bid_count], stream_key: [auction_id, auction_item_name], pk_columns: [bid_count, auction_id, auction_item_name], pk_conflict: NoCheck } └─StreamProject { exprs: [$expr2, $expr3, count($expr4)] } @@ -2525,12 +2525,12 @@ │ └─BatchProject { exprs: [Field(auction, 0:Int32) as $expr2, $expr1, Field(auction, 6:Int32) as $expr3] } │ └─BatchFilter { predicate: (event_type = 1:Int32) } │ └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr1, _row_id] } - │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + │ └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } └─BatchExchange { order: [], dist: HashShard($expr5) } └─BatchProject { exprs: [Field(bid, 0:Int32) as $expr5, Field(bid, 2:Int32) as $expr6, $expr4] } └─BatchFilter { predicate: (event_type = 2:Int32) } └─BatchProject { exprs: [event_type, person, auction, bid, Case((event_type = 0:Int32), Field(person, 6:Int32), (event_type = 1:Int32), Field(auction, 5:Int32), Field(bid, 5:Int32)) as $expr4, _row_id] } - └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id], filter: (None, None) } + └─BatchSource { source: nexmark, columns: [event_type, person, auction, bid, _row_id] } stream_plan: |- StreamMaterialize { columns: [min_final], stream_key: [], pk_columns: [], pk_conflict: NoCheck } └─StreamProject { exprs: [min(min(max($expr5)))] } diff --git a/src/frontend/planner_test/tests/testdata/output/share.yaml b/src/frontend/planner_test/tests/testdata/output/share.yaml index 5df21816d1fec..cfe5d841cb2c1 100644 --- a/src/frontend/planner_test/tests/testdata/output/share.yaml +++ b/src/frontend/planner_test/tests/testdata/output/share.yaml @@ -27,10 +27,10 @@ └─BatchHashJoin { type: Inner, predicate: id = id, output: [] } ├─BatchExchange { order: [], dist: HashShard(id) } │ └─BatchFilter { predicate: (initial_bid = 1:Int32) } - │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } └─BatchExchange { order: [], dist: HashShard(id) } └─BatchFilter { predicate: (initial_bid = 2:Int32) } - └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [cnt], stream_key: [], pk_columns: [], pk_conflict: NoCheck } └─StreamProject { exprs: [sum0(count)] } @@ -92,7 +92,7 @@ │ └─LogicalProject { exprs: [window_start, auction] } │ └─LogicalHopWindow { time_col: date_time, slide: 00:00:02, size: 00:00:10, output: all } │ └─LogicalFilter { predicate: IsNotNull(date_time) } - │ └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } └─LogicalProject { exprs: [max(count), window_start] } └─LogicalAgg { group_key: [window_start], aggs: [max(count)] } └─LogicalProject { exprs: [window_start, count] } @@ -101,7 +101,7 @@ └─LogicalProject { exprs: [auction, window_start] } └─LogicalHopWindow { time_col: date_time, slide: 00:00:02, size: 00:00:10, output: all } └─LogicalFilter { predicate: IsNotNull(date_time) } - └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchHashJoin { type: Inner, predicate: window_start = window_start AND (count >= max(count)), output: [auction, count] } @@ -111,7 +111,7 @@ │ └─BatchExchange { order: [], dist: HashShard(auction) } │ └─BatchProject { exprs: [auction, date_time] } │ └─BatchFilter { predicate: IsNotNull(date_time) } - │ └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } └─BatchHashAgg { group_key: [window_start], aggs: [max(count)] } └─BatchExchange { order: [], dist: HashShard(window_start) } └─BatchHashAgg { group_key: [auction, window_start], aggs: [count] } @@ -119,7 +119,7 @@ └─BatchExchange { order: [], dist: HashShard(auction) } └─BatchProject { exprs: [auction, date_time] } └─BatchFilter { predicate: IsNotNull(date_time) } - └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id], filter: (None, None) } + └─BatchSource { source: bid, columns: [auction, bidder, price, channel, url, date_time, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [auction, num, window_start(hidden), window_start#1(hidden)], stream_key: [auction, window_start], pk_columns: [auction, window_start], pk_conflict: NoCheck } └─StreamProject { exprs: [auction, count, window_start, window_start] } @@ -298,11 +298,11 @@ ├─BatchExchange { order: [], dist: HashShard(id) } │ └─BatchFilter { predicate: (initial_bid = 1:Int32) AND (AtTimeZone(date_time, 'UTC':Varchar) > '2021-03-31 23:59:59+00:00':Timestamptz) } │ └─BatchProject { exprs: [id, initial_bid, date_time] } - │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + │ └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } └─BatchExchange { order: [], dist: HashShard(id) } └─BatchFilter { predicate: (initial_bid = 2:Int32) } └─BatchProject { exprs: [id, initial_bid, date_time] } - └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id], filter: (None, None) } + └─BatchSource { source: auction, columns: [id, item_name, description, initial_bid, reserve, date_time, expires, seller, category, extra, _row_id] } stream_plan: |- StreamMaterialize { columns: [a_id, b_id, a_ts, b_ts, _row_id(hidden), _row_id#1(hidden)], stream_key: [_row_id, _row_id#1, a_id], pk_columns: [_row_id, _row_id#1, a_id], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard(id, _row_id, _row_id) } diff --git a/src/frontend/planner_test/tests/testdata/output/shared_source.yml b/src/frontend/planner_test/tests/testdata/output/shared_source.yml index 54f50fc2c687d..5bf3739f28411 100644 --- a/src/frontend/planner_test/tests/testdata/output/shared_source.yml +++ b/src/frontend/planner_test/tests/testdata/output/shared_source.yml @@ -36,7 +36,7 @@ batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchProject { exprs: [x, y] } - └─BatchSource { source: s, columns: [x, y, _rw_kafka_timestamp, _row_id], filter: (None, None) } + └─BatchKafkaScan { source: s, columns: [x, y, _rw_kafka_timestamp, _row_id], filter: (None, None) } stream_plan: |- StreamMaterialize { columns: [x, y, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [x, y, _row_id] } @@ -52,7 +52,7 @@ batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchProject { exprs: [x, y] } - └─BatchSource { source: s, columns: [x, y, _rw_kafka_timestamp, _row_id], filter: (None, None) } + └─BatchKafkaScan { source: s, columns: [x, y, _rw_kafka_timestamp, _row_id], filter: (None, None) } stream_plan: |- StreamMaterialize { columns: [x, y, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [x, y, _row_id] } @@ -68,7 +68,7 @@ batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchProject { exprs: [x, y] } - └─BatchSource { source: s, columns: [x, y, _rw_kafka_timestamp, _row_id], filter: (None, None) } + └─BatchKafkaScan { source: s, columns: [x, y, _rw_kafka_timestamp, _row_id], filter: (None, None) } stream_plan: |- StreamMaterialize { columns: [x, y, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [x, y, _row_id] } @@ -84,7 +84,7 @@ batch_plan: |- BatchExchange { order: [], dist: Single } └─BatchProject { exprs: [x, y] } - └─BatchSource { source: s, columns: [x, y, _rw_kafka_timestamp, _row_id], filter: (None, None) } + └─BatchKafkaScan { source: s, columns: [x, y, _rw_kafka_timestamp, _row_id], filter: (None, None) } stream_plan: |- StreamMaterialize { columns: [x, y, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck } └─StreamProject { exprs: [x, y, _row_id] } diff --git a/src/frontend/planner_test/tests/testdata/output/subquery.yaml b/src/frontend/planner_test/tests/testdata/output/subquery.yaml index 451ce0b70a7b8..e17f2f3cf699a 100644 --- a/src/frontend/planner_test/tests/testdata/output/subquery.yaml +++ b/src/frontend/planner_test/tests/testdata/output/subquery.yaml @@ -486,21 +486,21 @@ └─LogicalJoin { type: LeftSemi, on: IsNotDistinctFrom(a1, a1), output: [] } ├─LogicalShare { id: 2 } │ └─LogicalProject { exprs: [a1] } - │ └─LogicalSource { source: a, columns: [a1, a2, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: a, columns: [a1, a2, _row_id] } └─LogicalJoin { type: LeftSemi, on: IsNotDistinctFrom(a1, a1), output: all } ├─LogicalJoin { type: Inner, on: true, output: all } │ ├─LogicalAgg { group_key: [a1], aggs: [] } │ │ └─LogicalShare { id: 2 } │ │ └─LogicalProject { exprs: [a1] } - │ │ └─LogicalSource { source: a, columns: [a1, a2, _row_id], time_range: (Unbounded, Unbounded) } + │ │ └─LogicalSource { source: a, columns: [a1, a2, _row_id] } │ └─LogicalAgg { aggs: [] } - │ └─LogicalSource { source: b, columns: [b1, b2, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: b, columns: [b1, b2, _row_id] } └─LogicalJoin { type: Inner, on: true, output: [a1] } ├─LogicalAgg { group_key: [a1], aggs: [] } │ └─LogicalShare { id: 2 } │ └─LogicalProject { exprs: [a1] } - │ └─LogicalSource { source: a, columns: [a1, a2, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: c, columns: [c1, c2, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: a, columns: [a1, a2, _row_id] } + └─LogicalSource { source: c, columns: [c1, c2, _row_id] } - name: test subquery in table function sql: | create table t(x int[], y int[], k int primary key); diff --git a/src/frontend/planner_test/tests/testdata/output/tpch_variant.yaml b/src/frontend/planner_test/tests/testdata/output/tpch_variant.yaml index 89e884f962235..7b192ccceed49 100644 --- a/src/frontend/planner_test/tests/testdata/output/tpch_variant.yaml +++ b/src/frontend/planner_test/tests/testdata/output/tpch_variant.yaml @@ -136,11 +136,11 @@ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ │ ├─LogicalJoin { type: Inner, on: true, output: all } - │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ │ │ └─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } + │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + │ └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } └─LogicalProject { exprs: [min(ps_supplycost)] } └─LogicalAgg { aggs: [min(ps_supplycost)] } └─LogicalProject { exprs: [ps_supplycost] } @@ -148,29 +148,29 @@ └─LogicalJoin { type: Inner, on: true, output: all } ├─LogicalJoin { type: Inner, on: true, output: all } │ ├─LogicalJoin { type: Inner, on: true, output: all } - │ │ ├─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ ├─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } + │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } optimized_logical_plan_for_batch: |- LogicalJoin { type: Inner, on: (n_regionkey = r_regionkey), output: [s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment] } ├─LogicalJoin { type: Inner, on: (s_nationkey = n_nationkey), output: [p_partkey, p_mfgr, s_name, s_address, s_phone, s_acctbal, s_comment, n_name, n_regionkey] } │ ├─LogicalJoin { type: Inner, on: (s_suppkey = ps_suppkey), output: [p_partkey, p_mfgr, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment] } │ │ ├─LogicalJoin { type: Inner, on: (p_partkey = ps_partkey) AND (ps_supplycost = min(ps_supplycost)), output: [p_partkey, p_mfgr, ps_suppkey] } │ │ │ ├─LogicalJoin { type: Inner, on: (p_partkey = ps_partkey), output: [p_partkey, p_mfgr, ps_suppkey, ps_supplycost] } - │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } │ │ │ └─LogicalAgg { group_key: [ps_partkey], aggs: [min(ps_supplycost)] } │ │ │ └─LogicalJoin { type: Inner, on: (n_regionkey = r_regionkey), output: [ps_supplycost, ps_partkey] } │ │ │ ├─LogicalJoin { type: Inner, on: (s_nationkey = n_nationkey), output: [ps_partkey, ps_supplycost, n_regionkey] } │ │ │ │ ├─LogicalJoin { type: Inner, on: (s_suppkey = ps_suppkey), output: [ps_partkey, ps_supplycost, s_nationkey] } - │ │ │ │ │ ├─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ │ ├─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } + │ │ │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + │ │ │ └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } + │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } batch_plan: |- BatchExchange { order: [s_acctbal DESC, n_name ASC, s_name ASC, p_partkey ASC], dist: Single } └─BatchSort { order: [s_acctbal DESC, n_name ASC, s_name ASC, p_partkey ASC] } @@ -183,9 +183,9 @@ │ │ │ └─BatchHashJoin { type: Inner, predicate: p_partkey = ps_partkey AND ps_supplycost = min(ps_supplycost), output: [p_partkey, p_mfgr, ps_suppkey] } │ │ │ ├─BatchHashJoin { type: Inner, predicate: p_partkey = ps_partkey, output: [p_partkey, p_mfgr, ps_suppkey, ps_supplycost] } │ │ │ │ ├─BatchExchange { order: [], dist: HashShard(p_partkey) } - │ │ │ │ │ └─BatchSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], filter: (None, None) } + │ │ │ │ │ └─BatchSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } │ │ │ │ └─BatchExchange { order: [], dist: HashShard(ps_partkey) } - │ │ │ │ └─BatchSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], filter: (None, None) } + │ │ │ │ └─BatchSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } │ │ │ └─BatchHashAgg { group_key: [ps_partkey], aggs: [min(ps_supplycost)] } │ │ │ └─BatchExchange { order: [], dist: HashShard(ps_partkey) } │ │ │ └─BatchHashJoin { type: Inner, predicate: n_regionkey = r_regionkey, output: [ps_supplycost, ps_partkey] } @@ -194,19 +194,19 @@ │ │ │ │ ├─BatchExchange { order: [], dist: HashShard(s_nationkey) } │ │ │ │ │ └─BatchHashJoin { type: Inner, predicate: ps_suppkey = s_suppkey, output: [ps_partkey, ps_supplycost, s_nationkey] } │ │ │ │ │ ├─BatchExchange { order: [], dist: HashShard(ps_suppkey) } - │ │ │ │ │ │ └─BatchSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], filter: (None, None) } + │ │ │ │ │ │ └─BatchSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } │ │ │ │ │ └─BatchExchange { order: [], dist: HashShard(s_suppkey) } - │ │ │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], filter: (None, None) } + │ │ │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } │ │ │ │ └─BatchExchange { order: [], dist: HashShard(n_nationkey) } - │ │ │ │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], filter: (None, None) } + │ │ │ │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } │ │ │ └─BatchExchange { order: [], dist: HashShard(r_regionkey) } - │ │ │ └─BatchSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], filter: (None, None) } + │ │ │ └─BatchSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } │ │ └─BatchExchange { order: [], dist: HashShard(s_suppkey) } - │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], filter: (None, None) } + │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } │ └─BatchExchange { order: [], dist: HashShard(n_nationkey) } - │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], filter: (None, None) } + │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } └─BatchExchange { order: [], dist: HashShard(r_regionkey) } - └─BatchSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], filter: (None, None) } + └─BatchSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } stream_plan: |- StreamMaterialize { columns: [s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment, _row_id(hidden), min(ps_supplycost)(hidden), ps_partkey(hidden), _row_id#1(hidden), _row_id#2(hidden), r_regionkey(hidden), _row_id#3(hidden), n_nationkey(hidden), _row_id#4(hidden), s_suppkey(hidden)], stream_key: [_row_id, p_partkey, _row_id#1, _row_id#2, r_regionkey, _row_id#3, n_nationkey, _row_id#4, s_suppkey, min(ps_supplycost), ps_partkey], pk_columns: [s_acctbal, n_name, s_name, p_partkey, _row_id, _row_id#1, _row_id#2, r_regionkey, _row_id#3, n_nationkey, _row_id#4, s_suppkey, min(ps_supplycost), ps_partkey], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard(p_partkey, _row_id, min(ps_supplycost), ps_partkey, _row_id, _row_id, r_regionkey, _row_id, n_nationkey, _row_id, s_suppkey) } @@ -488,12 +488,12 @@ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ │ ├─LogicalJoin { type: Inner, on: true, output: all } - │ │ │ │ ├─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ ├─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } + │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } + │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } optimized_logical_plan_for_batch: |- LogicalAgg { group_key: [n_name], aggs: [sum($expr1)] } └─LogicalProject { exprs: [n_name, (l_extendedprice * (1:Int32::Decimal - l_discount)) as $expr1] } @@ -502,12 +502,12 @@ │ ├─LogicalJoin { type: Inner, on: (l_orderkey = o_orderkey) AND (l_suppkey = s_suppkey), output: [s_nationkey, l_extendedprice, l_discount] } │ │ ├─LogicalJoin { type: Inner, on: (c_nationkey = s_nationkey), output: [o_orderkey, s_suppkey, s_nationkey] } │ │ │ ├─LogicalJoin { type: Inner, on: (c_custkey = o_custkey), output: [c_nationkey, o_orderkey] } - │ │ │ │ ├─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ ├─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } + │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } + │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } batch_plan: |- BatchExchange { order: [sum($expr1) DESC], dist: Single } └─BatchSort { order: [sum($expr1) DESC] } @@ -524,17 +524,17 @@ │ │ │ ├─BatchExchange { order: [], dist: HashShard(c_nationkey) } │ │ │ │ └─BatchHashJoin { type: Inner, predicate: c_custkey = o_custkey, output: [c_nationkey, o_orderkey] } │ │ │ │ ├─BatchExchange { order: [], dist: HashShard(c_custkey) } - │ │ │ │ │ └─BatchSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id], filter: (None, None) } + │ │ │ │ │ └─BatchSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id] } │ │ │ │ └─BatchExchange { order: [], dist: HashShard(o_custkey) } - │ │ │ │ └─BatchSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], filter: (None, None) } + │ │ │ │ └─BatchSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } │ │ │ └─BatchExchange { order: [], dist: HashShard(s_nationkey) } - │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], filter: (None, None) } + │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } │ │ └─BatchExchange { order: [], dist: HashShard(l_orderkey, l_suppkey) } - │ │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], filter: (None, None) } + │ │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } │ └─BatchExchange { order: [], dist: HashShard(n_nationkey) } - │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], filter: (None, None) } + │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } └─BatchExchange { order: [], dist: HashShard(r_regionkey) } - └─BatchSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], filter: (None, None) } + └─BatchSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } stream_plan: |- StreamMaterialize { columns: [n_name, revenue], stream_key: [n_name], pk_columns: [revenue, n_name], pk_conflict: NoCheck } └─StreamProject { exprs: [n_name, sum($expr1)] } @@ -750,12 +750,12 @@ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ │ ├─LogicalJoin { type: Inner, on: true, output: all } - │ │ │ │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } + │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } + │ │ └─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id] } + │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } optimized_logical_plan_for_batch: |- LogicalAgg { group_key: [n_name, n_name, $expr1], aggs: [sum($expr2)] } └─LogicalProject { exprs: [n_name, n_name, Extract('YEAR':Varchar, l_shipdate) as $expr1, (l_extendedprice * (1:Int32::Decimal - l_discount)) as $expr2] } @@ -764,12 +764,12 @@ │ ├─LogicalJoin { type: Inner, on: (o_orderkey = l_orderkey), output: [l_extendedprice, l_discount, l_shipdate, n_name, o_custkey] } │ │ ├─LogicalJoin { type: Inner, on: (s_nationkey = n_nationkey), output: [l_orderkey, l_extendedprice, l_discount, l_shipdate, n_name] } │ │ │ ├─LogicalJoin { type: Inner, on: (s_suppkey = l_suppkey), output: [s_nationkey, l_orderkey, l_extendedprice, l_discount, l_shipdate] } - │ │ │ │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } + │ │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } + │ └─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id] } + └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } batch_plan: |- BatchExchange { order: [n_name ASC, n_name ASC, $expr1 ASC], dist: Single } └─BatchSort { order: [n_name ASC, n_name ASC, $expr1 ASC] } @@ -786,17 +786,17 @@ │ │ │ ├─BatchExchange { order: [], dist: HashShard(s_nationkey) } │ │ │ │ └─BatchHashJoin { type: Inner, predicate: s_suppkey = l_suppkey, output: [s_nationkey, l_orderkey, l_extendedprice, l_discount, l_shipdate] } │ │ │ │ ├─BatchExchange { order: [], dist: HashShard(s_suppkey) } - │ │ │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], filter: (None, None) } + │ │ │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } │ │ │ │ └─BatchExchange { order: [], dist: HashShard(l_suppkey) } - │ │ │ │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], filter: (None, None) } + │ │ │ │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } │ │ │ └─BatchExchange { order: [], dist: HashShard(n_nationkey) } - │ │ │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], filter: (None, None) } + │ │ │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } │ │ └─BatchExchange { order: [], dist: HashShard(o_orderkey) } - │ │ └─BatchSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], filter: (None, None) } + │ │ └─BatchSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } │ └─BatchExchange { order: [], dist: HashShard(c_custkey) } - │ └─BatchSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id], filter: (None, None) } + │ └─BatchSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id] } └─BatchExchange { order: [], dist: HashShard(n_nationkey) } - └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], filter: (None, None) } + └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } stream_plan: |- StreamMaterialize { columns: [supp_nation, cust_nation, l_year, revenue], stream_key: [supp_nation, cust_nation, l_year], pk_columns: [supp_nation, cust_nation, l_year], pk_conflict: NoCheck } └─StreamProject { exprs: [n_name, n_name, $expr1, sum($expr2)] } @@ -1020,14 +1020,14 @@ │ │ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ │ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ │ │ │ ├─LogicalJoin { type: Inner, on: true, output: all } - │ │ │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } + │ │ │ │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } + │ │ │ └─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id] } + │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } optimized_logical_plan_for_batch: |- LogicalProject { exprs: [$expr1, RoundDigit((sum($expr3) / sum($expr2)), 6:Int32) as $expr4] } └─LogicalAgg { group_key: [$expr1], aggs: [sum($expr3), sum($expr2)] } @@ -1040,14 +1040,14 @@ │ │ │ ├─LogicalJoin { type: Inner, on: (s_nationkey = n_nationkey), output: [l_orderkey, l_extendedprice, l_discount, n_name] } │ │ │ │ ├─LogicalJoin { type: Inner, on: (s_suppkey = l_suppkey), output: [l_orderkey, l_extendedprice, l_discount, s_nationkey] } │ │ │ │ │ ├─LogicalJoin { type: Inner, on: (p_partkey = l_partkey), output: [l_orderkey, l_suppkey, l_extendedprice, l_discount] } - │ │ │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } + │ │ │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } + │ │ │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } + │ │ └─LogicalSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id] } + │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + └─LogicalSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } batch_plan: |- BatchExchange { order: [$expr1 ASC], dist: Single } └─BatchProject { exprs: [$expr1, RoundDigit((sum($expr3) / sum($expr2)), 6:Int32) as $expr4] } @@ -1070,21 +1070,21 @@ │ │ │ │ │ ├─BatchExchange { order: [], dist: HashShard(l_suppkey) } │ │ │ │ │ │ └─BatchHashJoin { type: Inner, predicate: p_partkey = l_partkey, output: [l_orderkey, l_suppkey, l_extendedprice, l_discount] } │ │ │ │ │ │ ├─BatchExchange { order: [], dist: HashShard(p_partkey) } - │ │ │ │ │ │ │ └─BatchSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], filter: (None, None) } + │ │ │ │ │ │ │ └─BatchSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } │ │ │ │ │ │ └─BatchExchange { order: [], dist: HashShard(l_partkey) } - │ │ │ │ │ │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], filter: (None, None) } + │ │ │ │ │ │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } │ │ │ │ │ └─BatchExchange { order: [], dist: HashShard(s_suppkey) } - │ │ │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], filter: (None, None) } + │ │ │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } │ │ │ │ └─BatchExchange { order: [], dist: HashShard(n_nationkey) } - │ │ │ │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], filter: (None, None) } + │ │ │ │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } │ │ │ └─BatchExchange { order: [], dist: HashShard(o_orderkey) } - │ │ │ └─BatchSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], filter: (None, None) } + │ │ │ └─BatchSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } │ │ └─BatchExchange { order: [], dist: HashShard(c_custkey) } - │ │ └─BatchSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id], filter: (None, None) } + │ │ └─BatchSource { source: customer, columns: [c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal, c_mktsegment, c_comment, _row_id] } │ └─BatchExchange { order: [], dist: HashShard(n_nationkey) } - │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], filter: (None, None) } + │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } └─BatchExchange { order: [], dist: HashShard(r_regionkey) } - └─BatchSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id], filter: (None, None) } + └─BatchSource { source: region, columns: [r_regionkey, r_name, r_comment, _row_id] } stream_plan: |- StreamMaterialize { columns: [o_year, mkt_share], stream_key: [o_year], pk_columns: [o_year], pk_conflict: NoCheck } └─StreamProject { exprs: [$expr1, RoundDigit((sum($expr3) / sum($expr2)), 6:Int32) as $expr4] } @@ -1359,12 +1359,12 @@ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ │ ├─LogicalJoin { type: Inner, on: true, output: all } - │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } + │ │ └─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } + │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } + └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } optimized_logical_plan_for_batch: |- LogicalProject { exprs: [n_name, $expr1, RoundDigit(sum($expr2), 2:Int32) as $expr3] } └─LogicalAgg { group_key: [n_name, $expr1], aggs: [sum($expr2)] } @@ -1374,12 +1374,12 @@ │ ├─LogicalJoin { type: Inner, on: (s_nationkey = n_nationkey), output: [l_orderkey, l_partkey, l_suppkey, l_quantity, l_extendedprice, l_discount, n_name] } │ │ ├─LogicalJoin { type: Inner, on: (s_suppkey = l_suppkey), output: [l_orderkey, l_partkey, l_suppkey, l_quantity, l_extendedprice, l_discount, s_nationkey] } │ │ │ ├─LogicalJoin { type: Inner, on: (p_partkey = l_partkey), output: [l_orderkey, l_partkey, l_suppkey, l_quantity, l_extendedprice, l_discount] } - │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], time_range: (Unbounded, Unbounded) } - └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ ├─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } + │ │ │ └─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + │ └─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } + └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } batch_plan: |- BatchExchange { order: [n_name ASC, $expr1 DESC], dist: Single } └─BatchProject { exprs: [n_name, $expr1, RoundDigit(sum($expr2), 2:Int32) as $expr3] } @@ -1397,17 +1397,17 @@ │ │ │ ├─BatchExchange { order: [], dist: HashShard(l_suppkey) } │ │ │ │ └─BatchHashJoin { type: Inner, predicate: p_partkey = l_partkey, output: [l_orderkey, l_partkey, l_suppkey, l_quantity, l_extendedprice, l_discount] } │ │ │ │ ├─BatchExchange { order: [], dist: HashShard(p_partkey) } - │ │ │ │ │ └─BatchSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], filter: (None, None) } + │ │ │ │ │ └─BatchSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } │ │ │ │ └─BatchExchange { order: [], dist: HashShard(l_partkey) } - │ │ │ │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], filter: (None, None) } + │ │ │ │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } │ │ │ └─BatchExchange { order: [], dist: HashShard(s_suppkey) } - │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], filter: (None, None) } + │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } │ │ └─BatchExchange { order: [], dist: HashShard(n_nationkey) } - │ │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], filter: (None, None) } + │ │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } │ └─BatchExchange { order: [], dist: HashShard(ps_partkey, ps_suppkey) } - │ └─BatchSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], filter: (None, None) } + │ └─BatchSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } └─BatchExchange { order: [], dist: HashShard(o_orderkey) } - └─BatchSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], filter: (None, None) } + └─BatchSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } stream_plan: |- StreamMaterialize { columns: [nation, o_year, sum_profit], stream_key: [nation, o_year], pk_columns: [nation, o_year], pk_conflict: NoCheck } └─StreamProject { exprs: [n_name, $expr1, RoundDigit(sum($expr2), 2:Int32) as $expr3] } @@ -1607,34 +1607,34 @@ └─LogicalFilter { predicate: (s_nationkey = n_nationkey) } └─LogicalApply { type: LeftSemi, on: (s_suppkey = ps_suppkey), correlated_id: 1 } ├─LogicalJoin { type: Inner, on: true, output: all } - │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } └─LogicalProject { exprs: [ps_suppkey] } └─LogicalFilter { predicate: (ps_availqty::Decimal > $expr1) } └─LogicalApply { type: LeftOuter, on: true, correlated_id: 3, max_one_row: true } ├─LogicalApply { type: LeftSemi, on: (ps_partkey = p_partkey), correlated_id: 2 } - │ ├─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ ├─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } │ └─LogicalProject { exprs: [p_partkey] } - │ └─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } └─LogicalProject { exprs: [(0.5:Decimal * sum(l_quantity)) as $expr1] } └─LogicalAgg { aggs: [sum(l_quantity)] } └─LogicalProject { exprs: [l_quantity] } └─LogicalFilter { predicate: (l_partkey = CorrelatedInputRef { index: 0, correlated_id: 3 }) AND (l_suppkey = CorrelatedInputRef { index: 1, correlated_id: 3 }) } - └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } optimized_logical_plan_for_batch: |- LogicalJoin { type: LeftSemi, on: (s_suppkey = ps_suppkey), output: [s_name, s_address] } ├─LogicalJoin { type: Inner, on: (s_nationkey = n_nationkey), output: [s_suppkey, s_name, s_address] } - │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } └─LogicalJoin { type: Inner, on: (ps_partkey = l_partkey) AND (ps_suppkey = l_suppkey) AND ($expr1 > $expr2), output: [ps_suppkey] } ├─LogicalProject { exprs: [ps_partkey, ps_suppkey, ps_availqty::Decimal as $expr1] } │ └─LogicalJoin { type: LeftSemi, on: (ps_partkey = p_partkey), output: [ps_partkey, ps_suppkey, ps_availqty] } - │ ├─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ ├─LogicalSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } │ └─LogicalProject { exprs: [p_partkey] } - │ └─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } └─LogicalProject { exprs: [(0.5:Decimal * sum(l_quantity)) as $expr2, l_partkey, l_suppkey] } └─LogicalAgg { group_key: [l_partkey, l_suppkey], aggs: [sum(l_quantity)] } - └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } batch_plan: |- BatchExchange { order: [s_name ASC], dist: Single } └─BatchSort { order: [s_name ASC] } @@ -1642,23 +1642,23 @@ ├─BatchExchange { order: [], dist: HashShard(s_suppkey) } │ └─BatchHashJoin { type: Inner, predicate: s_nationkey = n_nationkey, output: [s_suppkey, s_name, s_address] } │ ├─BatchExchange { order: [], dist: HashShard(s_nationkey) } - │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], filter: (None, None) } + │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } │ └─BatchExchange { order: [], dist: HashShard(n_nationkey) } - │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], filter: (None, None) } + │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } └─BatchExchange { order: [], dist: HashShard(ps_suppkey) } └─BatchHashJoin { type: Inner, predicate: ps_partkey = l_partkey AND ps_suppkey = l_suppkey AND ($expr1 > $expr2), output: [ps_suppkey] } ├─BatchExchange { order: [], dist: HashShard(ps_partkey, ps_suppkey) } │ └─BatchProject { exprs: [ps_partkey, ps_suppkey, ps_availqty::Decimal as $expr1] } │ └─BatchHashJoin { type: LeftSemi, predicate: ps_partkey = p_partkey, output: [ps_partkey, ps_suppkey, ps_availqty] } │ ├─BatchExchange { order: [], dist: HashShard(ps_partkey) } - │ │ └─BatchSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id], filter: (None, None) } + │ │ └─BatchSource { source: partsupp, columns: [ps_partkey, ps_suppkey, ps_availqty, ps_supplycost, ps_comment, _row_id] } │ └─BatchExchange { order: [], dist: HashShard(p_partkey) } │ └─BatchProject { exprs: [p_partkey] } - │ └─BatchSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id], filter: (None, None) } + │ └─BatchSource { source: part, columns: [p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice, p_comment, _row_id] } └─BatchProject { exprs: [(0.5:Decimal * sum(l_quantity)) as $expr2, l_partkey, l_suppkey] } └─BatchHashAgg { group_key: [l_partkey, l_suppkey], aggs: [sum(l_quantity)] } └─BatchExchange { order: [], dist: HashShard(l_partkey, l_suppkey) } - └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], filter: (None, None) } + └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } stream_plan: |- StreamMaterialize { columns: [s_name, s_address, _row_id(hidden), _row_id#1(hidden), s_nationkey(hidden), s_suppkey(hidden)], stream_key: [_row_id, _row_id#1, s_nationkey, s_suppkey], pk_columns: [s_name, _row_id, _row_id#1, s_nationkey, s_suppkey], pk_conflict: NoCheck } └─StreamExchange { dist: HashShard(_row_id, _row_id, s_nationkey, s_suppkey) } @@ -1840,16 +1840,16 @@ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ ├─LogicalJoin { type: Inner, on: true, output: all } │ │ │ ├─LogicalJoin { type: Inner, on: true, output: all } - │ │ │ │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } + │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } + │ │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } + │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } │ └─LogicalProject { exprs: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment] } │ └─LogicalFilter { predicate: (l_orderkey = CorrelatedInputRef { index: 8, correlated_id: 1 }) AND (l_suppkey <> CorrelatedInputRef { index: 10, correlated_id: 1 }) } - │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } └─LogicalProject { exprs: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment] } └─LogicalFilter { predicate: (l_orderkey = CorrelatedInputRef { index: 8, correlated_id: 2 }) AND (l_suppkey <> CorrelatedInputRef { index: 10, correlated_id: 2 }) AND (l_receiptdate > l_commitdate) } - └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } optimized_logical_plan_for_batch: |- LogicalAgg { group_key: [s_name], aggs: [count] } └─LogicalJoin { type: LeftAnti, on: (l_orderkey = l_orderkey) AND (l_suppkey <> l_suppkey), output: [s_name] } @@ -1857,16 +1857,16 @@ │ ├─LogicalJoin { type: Inner, on: (o_orderkey = l_orderkey), output: [s_name, l_orderkey, l_suppkey] } │ │ ├─LogicalJoin { type: Inner, on: (s_nationkey = n_nationkey), output: [s_name, l_orderkey, l_suppkey] } │ │ │ ├─LogicalJoin { type: Inner, on: (s_suppkey = l_suppkey), output: [s_name, s_nationkey, l_orderkey, l_suppkey] } - │ │ │ │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ ├─LogicalSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } │ │ │ │ └─LogicalFilter { predicate: (l_receiptdate > l_commitdate) } - │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], time_range: (Unbounded, Unbounded) } - │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ │ │ │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } + │ │ │ └─LogicalSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } + │ │ └─LogicalSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } │ └─LogicalProject { exprs: [l_orderkey, l_suppkey] } - │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } + │ └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } └─LogicalProject { exprs: [l_orderkey, l_suppkey] } └─LogicalFilter { predicate: (l_receiptdate > l_commitdate) } - └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } batch_plan: |- BatchExchange { order: [count DESC, s_name ASC], dist: Single } └─BatchSort { order: [count DESC, s_name ASC] } @@ -1880,21 +1880,21 @@ │ │ │ ├─BatchExchange { order: [], dist: HashShard(s_nationkey) } │ │ │ │ └─BatchHashJoin { type: Inner, predicate: s_suppkey = l_suppkey, output: [s_name, s_nationkey, l_orderkey, l_suppkey] } │ │ │ │ ├─BatchExchange { order: [], dist: HashShard(s_suppkey) } - │ │ │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id], filter: (None, None) } + │ │ │ │ │ └─BatchSource { source: supplier, columns: [s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal, s_comment, _row_id] } │ │ │ │ └─BatchExchange { order: [], dist: HashShard(l_suppkey) } │ │ │ │ └─BatchFilter { predicate: (l_receiptdate > l_commitdate) } - │ │ │ │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], filter: (None, None) } + │ │ │ │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } │ │ │ └─BatchExchange { order: [], dist: HashShard(n_nationkey) } - │ │ │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id], filter: (None, None) } + │ │ │ └─BatchSource { source: nation, columns: [n_nationkey, n_name, n_regionkey, n_comment, _row_id] } │ │ └─BatchExchange { order: [], dist: HashShard(o_orderkey) } - │ │ └─BatchSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id], filter: (None, None) } + │ │ └─BatchSource { source: orders, columns: [o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, _row_id] } │ └─BatchExchange { order: [], dist: HashShard(l_orderkey) } │ └─BatchProject { exprs: [l_orderkey, l_suppkey] } - │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], filter: (None, None) } + │ └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } └─BatchExchange { order: [], dist: HashShard(l_orderkey) } └─BatchProject { exprs: [l_orderkey, l_suppkey] } └─BatchFilter { predicate: (l_receiptdate > l_commitdate) } - └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id], filter: (None, None) } + └─BatchSource { source: lineitem, columns: [l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment, _row_id] } stream_plan: |- StreamMaterialize { columns: [s_name, numwait], stream_key: [s_name], pk_columns: [numwait, s_name], pk_conflict: NoCheck } └─StreamHashAgg { group_key: [s_name], aggs: [count] } diff --git a/src/frontend/planner_test/tests/testdata/output/watermark.yaml b/src/frontend/planner_test/tests/testdata/output/watermark.yaml index 954734459861c..67e098154ece6 100644 --- a/src/frontend/planner_test/tests/testdata/output/watermark.yaml +++ b/src/frontend/planner_test/tests/testdata/output/watermark.yaml @@ -5,7 +5,7 @@ select t.v1 - INTERVAL '2' SECOND as v1 from t; logical_plan: |- LogicalProject { exprs: [(v1 - '00:00:02':Interval) as $expr1] } - └─LogicalSource { source: t, columns: [v1, _row_id], time_range: (Unbounded, Unbounded) } + └─LogicalSource { source: t, columns: [v1, _row_id] } stream_plan: |- StreamMaterialize { columns: [v1, _row_id(hidden)], stream_key: [_row_id], pk_columns: [_row_id], pk_conflict: NoCheck, watermark_columns: [v1] } └─StreamProject { exprs: [SubtractWithTimeZone(v1, '00:00:02':Interval, 'UTC':Varchar) as $expr1, _row_id], output_watermarks: [$expr1] } diff --git a/src/frontend/src/catalog/function_catalog.rs b/src/frontend/src/catalog/function_catalog.rs index 142bc222a59b8..1a0e01db1b92a 100644 --- a/src/frontend/src/catalog/function_catalog.rs +++ b/src/frontend/src/catalog/function_catalog.rs @@ -35,6 +35,8 @@ pub struct FunctionCatalog { pub link: Option, pub compressed_binary: Option>, pub always_retry_on_network_error: bool, + pub function_type: Option, + pub runtime: Option, } #[derive(Clone, Display, PartialEq, Eq, Hash, Debug)] @@ -72,6 +74,8 @@ impl From<&PbFunction> for FunctionCatalog { link: prost.link.clone(), compressed_binary: prost.compressed_binary.clone(), always_retry_on_network_error: prost.always_retry_on_network_error, + function_type: prost.function_type.clone(), + runtime: prost.runtime.clone(), } } } diff --git a/src/frontend/src/error.rs b/src/frontend/src/error.rs index 27a6418a7b0cf..e2ec1b35fe504 100644 --- a/src/frontend/src/error.rs +++ b/src/frontend/src/error.rs @@ -164,6 +164,8 @@ pub enum ErrorCode { #[backtrace] SessionConfigError, ), + #[error("{0} has been deprecated, please use {1} instead.")] + Deprecated(String, String), } /// The result type for the frontend crate. diff --git a/src/frontend/src/expr/table_function.rs b/src/frontend/src/expr/table_function.rs index c72c207c53783..4703112bc16d3 100644 --- a/src/frontend/src/expr/table_function.rs +++ b/src/frontend/src/expr/table_function.rs @@ -80,6 +80,8 @@ impl TableFunction { identifier: c.identifier.clone(), body: c.body.clone(), compressed_binary: c.compressed_binary.clone(), + function_type: c.function_type.clone(), + runtime: c.runtime.clone(), }), } } diff --git a/src/frontend/src/expr/user_defined_function.rs b/src/frontend/src/expr/user_defined_function.rs index a9f7f148e8dfa..44abfa1859c42 100644 --- a/src/frontend/src/expr/user_defined_function.rs +++ b/src/frontend/src/expr/user_defined_function.rs @@ -60,6 +60,8 @@ impl UserDefinedFunction { link: udf.link.clone(), compressed_binary: udf.compressed_binary.clone(), always_retry_on_network_error: udf.always_retry_on_network_error, + function_type: udf.function_type.clone(), + runtime: udf.runtime.clone(), }; Ok(Self { @@ -96,6 +98,8 @@ impl Expr for UserDefinedFunction { body: self.catalog.body.clone(), compressed_binary: self.catalog.compressed_binary.clone(), always_retry_on_network_error: self.catalog.always_retry_on_network_error, + function_type: self.catalog.function_type.clone(), + runtime: self.catalog.runtime.clone(), })), } } diff --git a/src/frontend/src/handler/create_function.rs b/src/frontend/src/handler/create_function.rs index cb2a88c64cf37..428a5612e1770 100644 --- a/src/frontend/src/handler/create_function.rs +++ b/src/frontend/src/handler/create_function.rs @@ -64,6 +64,21 @@ pub async fn handle_create_function( // correct protocol. None => "".to_string(), }; + + let rt = match params.runtime { + Some(runtime) => { + if language.as_str() == "javascript" { + runtime.to_string() + } else { + return Err(ErrorCode::InvalidParameterValue( + "runtime is only supported for javascript".to_string(), + ) + .into()); + } + } + None => "".to_string(), + }; + let return_type; let kind = match returns { Some(CreateFunctionReturns::Value(data_type)) => { @@ -122,6 +137,8 @@ pub async fn handle_create_function( let mut link = None; let mut body = None; let mut compressed_binary = None; + let mut function_type = None; + let mut runtime = None; match language.as_str() { "python" if params.using.is_none() => { @@ -177,7 +194,7 @@ pub async fn handle_create_function( } link = Some(l); } - "javascript" => { + "javascript" if rt.as_str() != "deno" => { identifier = function_name.to_string(); body = Some( params @@ -185,6 +202,46 @@ pub async fn handle_create_function( .ok_or_else(|| ErrorCode::InvalidParameterValue("AS must be specified".into()))? .into_string(), ); + runtime = Some("quickjs".to_string()); + } + "javascript" if rt.as_str() == "deno" => { + identifier = function_name.to_string(); + match (params.using, params.as_) { + (None, None) => { + return Err(ErrorCode::InvalidParameterValue( + "Either USING or AS must be specified".into(), + ) + .into()) + } + (None, Some(_as)) => body = Some(_as.into_string()), + (Some(CreateFunctionUsing::Link(link)), None) => { + let bytes = download_code_from_link(&link).await?; + compressed_binary = Some(zstd::stream::encode_all(bytes.as_slice(), 0)?); + } + (Some(CreateFunctionUsing::Base64(encoded)), None) => { + use base64::prelude::{Engine, BASE64_STANDARD}; + let bytes = BASE64_STANDARD + .decode(encoded) + .context("invalid base64 encoding")?; + compressed_binary = Some(zstd::stream::encode_all(bytes.as_slice(), 0)?); + } + (Some(_), Some(_)) => { + return Err(ErrorCode::InvalidParameterValue( + "Both USING and AS cannot be specified".into(), + ) + .into()) + } + }; + + function_type = match params.function_type { + Some(CreateFunctionType::Sync) => Some("sync".to_string()), + Some(CreateFunctionType::Async) => Some("async".to_string()), + Some(CreateFunctionType::Generator) => Some("generator".to_string()), + Some(CreateFunctionType::AsyncGenerator) => Some("async_generator".to_string()), + None => None, + }; + + runtime = Some("deno".to_string()); } "rust" => { if params.using.is_some() { @@ -282,6 +339,8 @@ pub async fn handle_create_function( always_retry_on_network_error: with_options .always_retry_on_network_error .unwrap_or_default(), + runtime, + function_type, }; let catalog_writer = session.catalog_writer()?; @@ -364,6 +423,19 @@ fn find_wasm_identifier_v2( Ok(identifier.into()) } +/// Download wasm binary from a link. +#[allow(clippy::unused_async)] +async fn download_code_from_link(link: &str) -> Result> { + // currently only local file system is supported + if let Some(path) = link.strip_prefix("fs://") { + let content = + std::fs::read(path).context("failed to read the code from local file system")?; + Ok(content) + } else { + Err(ErrorCode::InvalidParameterValue("only 'fs://' is supported".to_string()).into()) + } +} + /// Generate a function identifier in v0.1 format from the function signature. fn wasm_identifier_v1( name: &str, diff --git a/src/frontend/src/handler/create_source.rs b/src/frontend/src/handler/create_source.rs index 364c7aafed12b..0830cdb5392de 100644 --- a/src/frontend/src/handler/create_source.rs +++ b/src/frontend/src/handler/create_source.rs @@ -68,7 +68,7 @@ use thiserror_ext::AsReport; use super::RwPgResponse; use crate::binder::Binder; use crate::catalog::source_catalog::SourceCatalog; -use crate::error::ErrorCode::{self, InvalidInputSyntax, NotSupported, ProtocolError}; +use crate::error::ErrorCode::{self, Deprecated, InvalidInputSyntax, NotSupported, ProtocolError}; use crate::error::{Result, RwError}; use crate::expr::Expr; use crate::handler::create_table::{ @@ -1077,6 +1077,13 @@ pub fn validate_compatibility( } } + if connector == S3_CONNECTOR { + return Err(RwError::from(Deprecated( + S3_CONNECTOR.to_string(), + OPENDAL_S3_CONNECTOR.to_string(), + ))); + } + let compatible_encodes = compatible_formats .get(&source_schema.format) .ok_or_else(|| { diff --git a/src/frontend/src/handler/create_sql_function.rs b/src/frontend/src/handler/create_sql_function.rs index f4c683b4d7a0e..ae7b2730e25d5 100644 --- a/src/frontend/src/handler/create_sql_function.rs +++ b/src/frontend/src/handler/create_sql_function.rs @@ -344,6 +344,8 @@ pub async fn handle_create_sql_function( link: None, owner: session.user_id(), always_retry_on_network_error: false, + runtime: None, + function_type: None, }; let catalog_writer = session.catalog_writer()?; diff --git a/src/frontend/src/optimizer/logical_optimization.rs b/src/frontend/src/optimizer/logical_optimization.rs index 6448bd76d8c78..834c293f212b6 100644 --- a/src/frontend/src/optimizer/logical_optimization.rs +++ b/src/frontend/src/optimizer/logical_optimization.rs @@ -424,6 +424,14 @@ static LOGICAL_FILTER_EXPRESSION_SIMPLIFY: LazyLock = LazyLoc ) }); +static REWRITE_SOURCE_FOR_BATCH: LazyLock = LazyLock::new(|| { + OptimizationStage::new( + "Rewrite Source For Batch", + vec![SourceToKafkaScanRule::create()], + ApplyOrder::TopDown, + ) +}); + impl LogicalOptimizer { pub fn predicate_pushdown( plan: PlanRef, @@ -661,6 +669,7 @@ impl LogicalOptimizer { // Convert the dag back to the tree, because we don't support DAG plan for batch. plan = plan.optimize_by_rules(&DAG_TO_TREE); + plan = plan.optimize_by_rules(&REWRITE_SOURCE_FOR_BATCH); plan = plan.optimize_by_rules(&GROUPING_SETS); plan = plan.optimize_by_rules(&REWRITE_LIKE_EXPR); plan = plan.optimize_by_rules(&SET_OPERATION_MERGE); diff --git a/src/frontend/src/optimizer/mod.rs b/src/frontend/src/optimizer/mod.rs index c498f43b95208..f68f2f3bc9e0c 100644 --- a/src/frontend/src/optimizer/mod.rs +++ b/src/frontend/src/optimizer/mod.rs @@ -974,6 +974,7 @@ fn require_additional_exchange_on_root_in_distributed_mode(plan: PlanRef) -> boo fn is_source(plan: &PlanRef) -> bool { plan.node_type() == PlanNodeType::BatchSource + || plan.node_type() == PlanNodeType::BatchKafkaScan } fn is_insert(plan: &PlanRef) -> bool { @@ -1005,6 +1006,7 @@ fn require_additional_exchange_on_root_in_local_mode(plan: PlanRef) -> bool { fn is_source(plan: &PlanRef) -> bool { plan.node_type() == PlanNodeType::BatchSource + || plan.node_type() == PlanNodeType::BatchKafkaScan } fn is_insert(plan: &PlanRef) -> bool { diff --git a/src/frontend/src/optimizer/plan_node/batch_kafka_scan.rs b/src/frontend/src/optimizer/plan_node/batch_kafka_scan.rs new file mode 100644 index 0000000000000..423fe2a6771ee --- /dev/null +++ b/src/frontend/src/optimizer/plan_node/batch_kafka_scan.rs @@ -0,0 +1,140 @@ +// Copyright 2024 RisingWave Labs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use std::ops::Bound; +use std::ops::Bound::{Excluded, Included, Unbounded}; +use std::rc::Rc; + +use pretty_xmlish::{Pretty, XmlNode}; +use risingwave_pb::batch_plan::plan_node::NodeBody; +use risingwave_pb::batch_plan::SourceNode; + +use super::batch::prelude::*; +use super::utils::{childless_record, column_names_pretty, Distill}; +use super::{ + generic, ExprRewritable, PlanBase, PlanRef, ToBatchPb, ToDistributedBatch, ToLocalBatch, +}; +use crate::catalog::source_catalog::SourceCatalog; +use crate::error::Result; +use crate::optimizer::plan_node::expr_visitable::ExprVisitable; +use crate::optimizer::property::{Distribution, Order}; + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct BatchKafkaScan { + pub base: PlanBase, + pub core: generic::Source, + + /// Kafka timestamp range. + kafka_timestamp_range: (Bound, Bound), +} + +impl BatchKafkaScan { + pub fn new(core: generic::Source, kafka_timestamp_range: (Bound, Bound)) -> Self { + let base = PlanBase::new_batch_with_core( + &core, + // Use `Single` by default, will be updated later with `clone_with_dist`. + Distribution::Single, + Order::any(), + ); + + Self { + base, + core, + kafka_timestamp_range, + } + } + + pub fn column_names(&self) -> Vec<&str> { + self.schema().names_str() + } + + pub fn source_catalog(&self) -> Option> { + self.core.catalog.clone() + } + + pub fn kafka_timestamp_range_value(&self) -> (Option, Option) { + let (lower_bound, upper_bound) = &self.kafka_timestamp_range; + let lower_bound = match lower_bound { + Included(t) => Some(*t), + Excluded(t) => Some(*t - 1), + Unbounded => None, + }; + + let upper_bound = match upper_bound { + Included(t) => Some(*t), + Excluded(t) => Some(*t + 1), + Unbounded => None, + }; + (lower_bound, upper_bound) + } + + pub fn clone_with_dist(&self) -> Self { + let base = self + .base + .clone_with_new_distribution(Distribution::SomeShard); + Self { + base, + core: self.core.clone(), + kafka_timestamp_range: self.kafka_timestamp_range, + } + } +} + +impl_plan_tree_node_for_leaf! { BatchKafkaScan } + +impl Distill for BatchKafkaScan { + fn distill<'a>(&self) -> XmlNode<'a> { + let src = Pretty::from(self.source_catalog().unwrap().name.clone()); + let fields = vec![ + ("source", src), + ("columns", column_names_pretty(self.schema())), + ("filter", Pretty::debug(&self.kafka_timestamp_range_value())), + ]; + childless_record("BatchKafkaScan", fields) + } +} + +impl ToLocalBatch for BatchKafkaScan { + fn to_local(&self) -> Result { + Ok(self.clone_with_dist().into()) + } +} + +impl ToDistributedBatch for BatchKafkaScan { + fn to_distributed(&self) -> Result { + Ok(self.clone_with_dist().into()) + } +} + +impl ToBatchPb for BatchKafkaScan { + fn to_batch_prost_body(&self) -> NodeBody { + let source_catalog = self.source_catalog().unwrap(); + NodeBody::Source(SourceNode { + source_id: source_catalog.id, + info: Some(source_catalog.info.clone()), + columns: self + .core + .column_catalog + .iter() + .map(|c| c.to_protobuf()) + .collect(), + with_properties: source_catalog.with_properties.clone().into_iter().collect(), + split: vec![], + }) + } +} + +impl ExprRewritable for BatchKafkaScan {} + +impl ExprVisitable for BatchKafkaScan {} diff --git a/src/frontend/src/optimizer/plan_node/batch_source.rs b/src/frontend/src/optimizer/plan_node/batch_source.rs index a0ece261dcea0..3836940be745e 100644 --- a/src/frontend/src/optimizer/plan_node/batch_source.rs +++ b/src/frontend/src/optimizer/plan_node/batch_source.rs @@ -56,10 +56,6 @@ impl BatchSource { self.core.catalog.clone() } - pub fn kafka_timestamp_range_value(&self) -> (Option, Option) { - self.core.kafka_timestamp_range_value() - } - pub fn as_of(&self) -> Option { self.core.as_of.clone() } @@ -83,7 +79,6 @@ impl Distill for BatchSource { let mut fields = vec![ ("source", src), ("columns", column_names_pretty(self.schema())), - ("filter", Pretty::debug(&self.kafka_timestamp_range_value())), ]; if let Some(as_of) = &self.core.as_of { fields.push(("as_of", Pretty::debug(as_of))); diff --git a/src/frontend/src/optimizer/plan_node/generic/source.rs b/src/frontend/src/optimizer/plan_node/generic/source.rs index 0c1caa620a4bb..40bd376dd46ca 100644 --- a/src/frontend/src/optimizer/plan_node/generic/source.rs +++ b/src/frontend/src/optimizer/plan_node/generic/source.rs @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::ops::Bound; -use std::ops::Bound::{Excluded, Included, Unbounded}; use std::rc::Rc; use educe::Educe; @@ -65,9 +63,6 @@ pub struct Source { #[educe(Hash(ignore))] pub ctx: OptimizerContextRef, - /// Kafka timestamp range, currently we only support kafka, so we just leave it like this. - pub(crate) kafka_timestamp_range: (Bound, Bound), - pub as_of: Option, } @@ -113,6 +108,12 @@ impl Source { .is_some_and(|catalog| catalog.with_properties.is_iceberg_connector()) } + pub fn is_kafka_connector(&self) -> bool { + self.catalog + .as_ref() + .is_some_and(|catalog| catalog.with_properties.is_kafka_connector()) + } + /// Currently, only iceberg source supports time travel. pub fn support_time_travel(&self) -> bool { self.is_iceberg_connector() @@ -136,22 +137,6 @@ impl Source { (self, original_row_id_index) } - pub fn kafka_timestamp_range_value(&self) -> (Option, Option) { - let (lower_bound, upper_bound) = &self.kafka_timestamp_range; - let lower_bound = match lower_bound { - Included(t) => Some(*t), - Excluded(t) => Some(*t - 1), - Unbounded => None, - }; - - let upper_bound = match upper_bound { - Included(t) => Some(*t), - Excluded(t) => Some(*t + 1), - Unbounded => None, - }; - (lower_bound, upper_bound) - } - pub fn infer_internal_table_catalog(require_dist_key: bool) -> TableCatalog { // note that source's internal table is to store partition_id -> offset mapping and its // schema is irrelevant to input schema diff --git a/src/frontend/src/optimizer/plan_node/logical_kafka_scan.rs b/src/frontend/src/optimizer/plan_node/logical_kafka_scan.rs new file mode 100644 index 0000000000000..18ae05a135ff9 --- /dev/null +++ b/src/frontend/src/optimizer/plan_node/logical_kafka_scan.rs @@ -0,0 +1,346 @@ +// Copyright 2024 RisingWave Labs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use std::cmp::{max, min}; +use std::ops::Bound; +use std::ops::Bound::{Excluded, Included, Unbounded}; +use std::rc::Rc; + +use pretty_xmlish::{Pretty, XmlNode}; +use risingwave_common::catalog::{Schema, KAFKA_TIMESTAMP_COLUMN_NAME}; +use risingwave_connector::source::DataType; + +use super::generic::GenericPlanRef; +use super::utils::{childless_record, Distill}; +use super::{ + generic, BatchProject, ColPrunable, ExprRewritable, Logical, LogicalFilter, LogicalProject, + PlanBase, PlanRef, PredicatePushdown, ToBatch, ToStream, +}; +use crate::catalog::source_catalog::SourceCatalog; +use crate::error::Result; +use crate::expr::{Expr, ExprImpl, ExprRewriter, ExprType, ExprVisitor}; +use crate::optimizer::plan_node::expr_visitable::ExprVisitable; +use crate::optimizer::plan_node::utils::column_names_pretty; +use crate::optimizer::plan_node::{ + BatchKafkaScan, ColumnPruningContext, LogicalSource, PredicatePushdownContext, + RewriteStreamContext, ToStreamContext, +}; +use crate::utils::{ColIndexMapping, Condition}; + +/// `LogicalKafkaScan` is only used by batch queries. At the beginning of the batch query optimization, `LogicalSource` with a kafka property would be converted into a `LogicalKafkaScan`. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct LogicalKafkaScan { + pub base: PlanBase, + pub core: generic::Source, + + /// Expressions to output. This field presents and will be turned to a `Project` when + /// converting to a physical plan, only if there are generated columns. + output_exprs: Option>, + + /// Kafka timestamp range. + kafka_timestamp_range: (Bound, Bound), +} + +impl LogicalKafkaScan { + pub fn new(logical_source: &LogicalSource) -> Self { + assert!(logical_source.core.is_kafka_connector()); + + let base = logical_source.base.clone_with_new_plan_id(); + let core = logical_source.core.clone(); + let kafka_timestamp_range = (Bound::Unbounded, Bound::Unbounded); + + LogicalKafkaScan { + base, + core, + output_exprs: logical_source.output_exprs.clone(), + kafka_timestamp_range, + } + } + + pub fn source_catalog(&self) -> Option> { + self.core.catalog.clone() + } + + fn clone_with_kafka_timestamp_range(&self, range: (Bound, Bound)) -> Self { + Self { + base: self.base.clone(), + core: self.core.clone(), + output_exprs: self.output_exprs.clone(), + kafka_timestamp_range: range, + } + } +} + +impl_plan_tree_node_for_leaf! {LogicalKafkaScan} +impl Distill for LogicalKafkaScan { + fn distill<'a>(&self) -> XmlNode<'a> { + let fields = if let Some(catalog) = self.source_catalog() { + let src = Pretty::from(catalog.name.clone()); + let time = Pretty::debug(&self.kafka_timestamp_range); + vec![ + ("source", src), + ("columns", column_names_pretty(self.schema())), + ("time_range", time), + ] + } else { + vec![] + }; + childless_record("LogicalKafkaScan", fields) + } +} + +impl ColPrunable for LogicalKafkaScan { + fn prune_col(&self, required_cols: &[usize], _ctx: &mut ColumnPruningContext) -> PlanRef { + let mapping = ColIndexMapping::with_remaining_columns(required_cols, self.schema().len()); + LogicalProject::with_mapping(self.clone().into(), mapping).into() + } +} + +impl ExprRewritable for LogicalKafkaScan { + fn has_rewritable_expr(&self) -> bool { + self.output_exprs.is_some() + } + + fn rewrite_exprs(&self, r: &mut dyn ExprRewriter) -> PlanRef { + let mut output_exprs = self.output_exprs.clone(); + + for expr in output_exprs.iter_mut().flatten() { + *expr = r.rewrite_expr(expr.clone()); + } + + Self { + output_exprs, + ..self.clone() + } + .into() + } +} + +impl ExprVisitable for LogicalKafkaScan { + fn visit_exprs(&self, v: &mut dyn ExprVisitor) { + self.output_exprs + .iter() + .flatten() + .for_each(|e| v.visit_expr(e)); + } +} + +/// A util function to extract kafka offset timestamp range. +/// +/// Currently we only support limiting kafka offset timestamp range using literals, e.g. we only +/// support expressions like `_rw_kafka_timestamp <= '2022-10-11 1:00:00+00:00'`. +/// +/// # Parameters +/// +/// * `expr`: Expression to be consumed. +/// * `range`: Original timestamp range, if `expr` can be recognized, we will update `range`. +/// * `schema`: Input schema. +/// +/// # Return Value +/// +/// If `expr` can be recognized and consumed by this function, then we return `None`. +/// Otherwise `expr` is returned. +fn expr_to_kafka_timestamp_range( + expr: ExprImpl, + range: &mut (Bound, Bound), + schema: &Schema, +) -> Option { + let merge_upper_bound = |first, second| -> Bound { + match (first, second) { + (first, Unbounded) => first, + (Unbounded, second) => second, + (Included(f1), Included(f2)) => Included(min(f1, f2)), + (Included(f1), Excluded(f2)) => { + if f1 < f2 { + Included(f1) + } else { + Excluded(f2) + } + } + (Excluded(f1), Included(f2)) => { + if f2 < f1 { + Included(f2) + } else { + Excluded(f1) + } + } + (Excluded(f1), Excluded(f2)) => Excluded(min(f1, f2)), + } + }; + + let merge_lower_bound = |first, second| -> Bound { + match (first, second) { + (first, Unbounded) => first, + (Unbounded, second) => second, + (Included(f1), Included(f2)) => Included(max(f1, f2)), + (Included(f1), Excluded(f2)) => { + if f1 > f2 { + Included(f1) + } else { + Excluded(f2) + } + } + (Excluded(f1), Included(f2)) => { + if f2 > f1 { + Included(f2) + } else { + Excluded(f1) + } + } + (Excluded(f1), Excluded(f2)) => Excluded(max(f1, f2)), + } + }; + + let extract_timestampz_literal = |expr: &ExprImpl| -> Result> { + match expr { + ExprImpl::FunctionCall(function_call) if function_call.inputs().len() == 2 => { + match (&function_call.inputs()[0], &function_call.inputs()[1]) { + (ExprImpl::InputRef(input_ref), literal) + if let Some(datum) = literal.try_fold_const().transpose()? + && schema.fields[input_ref.index].name + == KAFKA_TIMESTAMP_COLUMN_NAME + && literal.return_type() == DataType::Timestamptz => + { + Ok(Some(( + datum.unwrap().into_timestamptz().timestamp_millis(), + false, + ))) + } + (literal, ExprImpl::InputRef(input_ref)) + if let Some(datum) = literal.try_fold_const().transpose()? + && schema.fields[input_ref.index].name + == KAFKA_TIMESTAMP_COLUMN_NAME + && literal.return_type() == DataType::Timestamptz => + { + Ok(Some(( + datum.unwrap().into_timestamptz().timestamp_millis(), + true, + ))) + } + _ => Ok(None), + } + } + _ => Ok(None), + } + }; + + match &expr { + ExprImpl::FunctionCall(function_call) => { + if let Ok(Some((timestampz_literal, reverse))) = extract_timestampz_literal(&expr) { + match function_call.func_type() { + ExprType::GreaterThan => { + if reverse { + range.1 = merge_upper_bound(range.1, Excluded(timestampz_literal)); + } else { + range.0 = merge_lower_bound(range.0, Excluded(timestampz_literal)); + } + + None + } + ExprType::GreaterThanOrEqual => { + if reverse { + range.1 = merge_upper_bound(range.1, Included(timestampz_literal)); + } else { + range.0 = merge_lower_bound(range.0, Included(timestampz_literal)); + } + None + } + ExprType::Equal => { + range.0 = merge_lower_bound(range.0, Included(timestampz_literal)); + range.1 = merge_upper_bound(range.1, Included(timestampz_literal)); + None + } + ExprType::LessThan => { + if reverse { + range.0 = merge_lower_bound(range.0, Excluded(timestampz_literal)); + } else { + range.1 = merge_upper_bound(range.1, Excluded(timestampz_literal)); + } + None + } + ExprType::LessThanOrEqual => { + if reverse { + range.0 = merge_lower_bound(range.0, Included(timestampz_literal)); + } else { + range.1 = merge_upper_bound(range.1, Included(timestampz_literal)); + } + None + } + _ => Some(expr), + } + } else { + Some(expr) + } + } + _ => Some(expr), + } +} + +impl PredicatePushdown for LogicalKafkaScan { + fn predicate_pushdown( + &self, + predicate: Condition, + _ctx: &mut PredicatePushdownContext, + ) -> PlanRef { + let mut range = self.kafka_timestamp_range; + + let mut new_conjunctions = Vec::with_capacity(predicate.conjunctions.len()); + for expr in predicate.conjunctions { + if let Some(e) = expr_to_kafka_timestamp_range(expr, &mut range, self.base.schema()) { + // Not recognized, so push back + new_conjunctions.push(e); + } + } + + let new_source = self.clone_with_kafka_timestamp_range(range).into(); + + if new_conjunctions.is_empty() { + new_source + } else { + LogicalFilter::create( + new_source, + Condition { + conjunctions: new_conjunctions, + }, + ) + } + } +} + +impl ToBatch for LogicalKafkaScan { + fn to_batch(&self) -> Result { + let mut plan: PlanRef = + BatchKafkaScan::new(self.core.clone(), self.kafka_timestamp_range).into(); + + if let Some(exprs) = &self.output_exprs { + let logical_project = generic::Project::new(exprs.to_vec(), plan); + plan = BatchProject::new(logical_project).into(); + } + + Ok(plan) + } +} + +impl ToStream for LogicalKafkaScan { + fn to_stream(&self, _ctx: &mut ToStreamContext) -> Result { + unreachable!() + } + + fn logical_rewrite_for_stream( + &self, + _ctx: &mut RewriteStreamContext, + ) -> Result<(PlanRef, ColIndexMapping)> { + unreachable!() + } +} diff --git a/src/frontend/src/optimizer/plan_node/logical_source.rs b/src/frontend/src/optimizer/plan_node/logical_source.rs index fd4aaba5b7d20..8a8fd37bd66b3 100644 --- a/src/frontend/src/optimizer/plan_node/logical_source.rs +++ b/src/frontend/src/optimizer/plan_node/logical_source.rs @@ -12,17 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::cmp::{max, min}; -use std::ops::Bound; -use std::ops::Bound::{Excluded, Included, Unbounded}; use std::rc::Rc; use fixedbitset::FixedBitSet; use pretty_xmlish::{Pretty, XmlNode}; use risingwave_common::bail; -use risingwave_common::catalog::{ - ColumnCatalog, ColumnDesc, Field, Schema, KAFKA_TIMESTAMP_COLUMN_NAME, -}; +use risingwave_common::catalog::{ColumnCatalog, ColumnDesc, Field}; use risingwave_connector::source::iceberg::ICEBERG_CONNECTOR; use risingwave_connector::source::{DataType, UPSTREAM_SOURCE_KEY}; use risingwave_pb::plan_common::column_desc::GeneratedOrDefaultColumn; @@ -39,7 +34,7 @@ use super::{ }; use crate::catalog::source_catalog::SourceCatalog; use crate::error::Result; -use crate::expr::{Expr, ExprImpl, ExprRewriter, ExprType, ExprVisitor, InputRef}; +use crate::expr::{ExprImpl, ExprRewriter, ExprVisitor, InputRef}; use crate::optimizer::optimizer_context::OptimizerContextRef; use crate::optimizer::plan_node::expr_visitable::ExprVisitable; use crate::optimizer::plan_node::stream_fs_fetch::StreamFsFetch; @@ -60,10 +55,10 @@ pub struct LogicalSource { /// Expressions to output. This field presents and will be turned to a `Project` when /// converting to a physical plan, only if there are generated columns. - output_exprs: Option>, + pub(crate) output_exprs: Option>, /// When there are generated columns, the `StreamRowIdGen`'s `row_id_index` is different from /// the one in `core`. So we store the one in `output_exprs` here. - output_row_id_index: Option, + pub(crate) output_row_id_index: Option, } impl LogicalSource { @@ -75,15 +70,12 @@ impl LogicalSource { ctx: OptimizerContextRef, as_of: Option, ) -> Result { - let kafka_timestamp_range = (Bound::Unbounded, Bound::Unbounded); - let core = generic::Source { catalog: source_catalog, column_catalog, row_id_index, kind, ctx, - kafka_timestamp_range, as_of, }; @@ -249,17 +241,6 @@ impl LogicalSource { pub fn source_catalog(&self) -> Option> { self.core.catalog.clone() } - - fn clone_with_kafka_timestamp_range(&self, range: (Bound, Bound)) -> Self { - let mut core = self.core.clone(); - core.kafka_timestamp_range = range; - Self { - base: self.base.clone(), - core, - output_exprs: self.output_exprs.clone(), - output_row_id_index: self.output_row_id_index, - } - } } impl_plan_tree_node_for_leaf! {LogicalSource} @@ -267,11 +248,9 @@ impl Distill for LogicalSource { fn distill<'a>(&self) -> XmlNode<'a> { let fields = if let Some(catalog) = self.source_catalog() { let src = Pretty::from(catalog.name.clone()); - let time = Pretty::debug(&self.core.kafka_timestamp_range); let mut fields = vec![ ("source", src), ("columns", column_names_pretty(self.schema())), - ("time_range", time), ]; if let Some(as_of) = &self.core.as_of { fields.push(("as_of", Pretty::debug(as_of))); @@ -320,190 +299,22 @@ impl ExprVisitable for LogicalSource { } } -/// A util function to extract kafka offset timestamp range. -/// -/// Currently we only support limiting kafka offset timestamp range using literals, e.g. we only -/// support expressions like `_rw_kafka_timestamp <= '2022-10-11 1:00:00+00:00'`. -/// -/// # Parameters -/// -/// * `expr`: Expression to be consumed. -/// * `range`: Original timestamp range, if `expr` can be recognized, we will update `range`. -/// * `schema`: Input schema. -/// -/// # Return Value -/// -/// If `expr` can be recognized and consumed by this function, then we return `None`. -/// Otherwise `expr` is returned. -fn expr_to_kafka_timestamp_range( - expr: ExprImpl, - range: &mut (Bound, Bound), - schema: &Schema, -) -> Option { - let merge_upper_bound = |first, second| -> Bound { - match (first, second) { - (first, Unbounded) => first, - (Unbounded, second) => second, - (Included(f1), Included(f2)) => Included(min(f1, f2)), - (Included(f1), Excluded(f2)) => { - if f1 < f2 { - Included(f1) - } else { - Excluded(f2) - } - } - (Excluded(f1), Included(f2)) => { - if f2 < f1 { - Included(f2) - } else { - Excluded(f1) - } - } - (Excluded(f1), Excluded(f2)) => Excluded(min(f1, f2)), - } - }; - - let merge_lower_bound = |first, second| -> Bound { - match (first, second) { - (first, Unbounded) => first, - (Unbounded, second) => second, - (Included(f1), Included(f2)) => Included(max(f1, f2)), - (Included(f1), Excluded(f2)) => { - if f1 > f2 { - Included(f1) - } else { - Excluded(f2) - } - } - (Excluded(f1), Included(f2)) => { - if f2 > f1 { - Included(f2) - } else { - Excluded(f1) - } - } - (Excluded(f1), Excluded(f2)) => Excluded(max(f1, f2)), - } - }; - - let extract_timestampz_literal = |expr: &ExprImpl| -> Result> { - match expr { - ExprImpl::FunctionCall(function_call) if function_call.inputs().len() == 2 => { - match (&function_call.inputs()[0], &function_call.inputs()[1]) { - (ExprImpl::InputRef(input_ref), literal) - if let Some(datum) = literal.try_fold_const().transpose()? - && schema.fields[input_ref.index].name - == KAFKA_TIMESTAMP_COLUMN_NAME - && literal.return_type() == DataType::Timestamptz => - { - Ok(Some(( - datum.unwrap().into_timestamptz().timestamp_millis(), - false, - ))) - } - (literal, ExprImpl::InputRef(input_ref)) - if let Some(datum) = literal.try_fold_const().transpose()? - && schema.fields[input_ref.index].name - == KAFKA_TIMESTAMP_COLUMN_NAME - && literal.return_type() == DataType::Timestamptz => - { - Ok(Some(( - datum.unwrap().into_timestamptz().timestamp_millis(), - true, - ))) - } - _ => Ok(None), - } - } - _ => Ok(None), - } - }; - - match &expr { - ExprImpl::FunctionCall(function_call) => { - if let Ok(Some((timestampz_literal, reverse))) = extract_timestampz_literal(&expr) { - match function_call.func_type() { - ExprType::GreaterThan => { - if reverse { - range.1 = merge_upper_bound(range.1, Excluded(timestampz_literal)); - } else { - range.0 = merge_lower_bound(range.0, Excluded(timestampz_literal)); - } - - None - } - ExprType::GreaterThanOrEqual => { - if reverse { - range.1 = merge_upper_bound(range.1, Included(timestampz_literal)); - } else { - range.0 = merge_lower_bound(range.0, Included(timestampz_literal)); - } - None - } - ExprType::Equal => { - range.0 = merge_lower_bound(range.0, Included(timestampz_literal)); - range.1 = merge_upper_bound(range.1, Included(timestampz_literal)); - None - } - ExprType::LessThan => { - if reverse { - range.0 = merge_lower_bound(range.0, Excluded(timestampz_literal)); - } else { - range.1 = merge_upper_bound(range.1, Excluded(timestampz_literal)); - } - None - } - ExprType::LessThanOrEqual => { - if reverse { - range.0 = merge_lower_bound(range.0, Included(timestampz_literal)); - } else { - range.1 = merge_upper_bound(range.1, Included(timestampz_literal)); - } - None - } - _ => Some(expr), - } - } else { - Some(expr) - } - } - _ => Some(expr), - } -} - impl PredicatePushdown for LogicalSource { fn predicate_pushdown( &self, predicate: Condition, _ctx: &mut PredicatePushdownContext, ) -> PlanRef { - let mut range = self.core.kafka_timestamp_range; - - let mut new_conjunctions = Vec::with_capacity(predicate.conjunctions.len()); - for expr in predicate.conjunctions { - if let Some(e) = expr_to_kafka_timestamp_range(expr, &mut range, self.base.schema()) { - // Not recognized, so push back - new_conjunctions.push(e); - } - } - - let new_source = self.clone_with_kafka_timestamp_range(range).into(); - - if new_conjunctions.is_empty() { - new_source - } else { - LogicalFilter::create( - new_source, - Condition { - conjunctions: new_conjunctions, - }, - ) - } + LogicalFilter::create(self.clone().into(), predicate) } } impl ToBatch for LogicalSource { fn to_batch(&self) -> Result { + assert!( + !self.core.is_kafka_connector(), + "LogicalSource with a kafka property should be converted to LogicalKafkaScan" + ); let mut plan: PlanRef = BatchSource::new(self.core.clone()).into(); if let Some(exprs) = &self.output_exprs { diff --git a/src/frontend/src/optimizer/plan_node/mod.rs b/src/frontend/src/optimizer/plan_node/mod.rs index ff749781f9265..c2c46e0766efb 100644 --- a/src/frontend/src/optimizer/plan_node/mod.rs +++ b/src/frontend/src/optimizer/plan_node/mod.rs @@ -856,6 +856,7 @@ mod logical_hop_window; mod logical_insert; mod logical_intersect; mod logical_join; +mod logical_kafka_scan; mod logical_limit; mod logical_max_one_row; mod logical_multi_join; @@ -903,6 +904,7 @@ mod stream_topn; mod stream_values; mod stream_watermark_filter; +mod batch_kafka_scan; mod derive; mod stream_cdc_table_scan; mod stream_share; @@ -919,6 +921,7 @@ pub use batch_hash_agg::BatchHashAgg; pub use batch_hash_join::BatchHashJoin; pub use batch_hop_window::BatchHopWindow; pub use batch_insert::BatchInsert; +pub use batch_kafka_scan::BatchKafkaScan; pub use batch_limit::BatchLimit; pub use batch_lookup_join::BatchLookupJoin; pub use batch_max_one_row::BatchMaxOneRow; @@ -949,6 +952,7 @@ pub use logical_hop_window::LogicalHopWindow; pub use logical_insert::LogicalInsert; pub use logical_intersect::LogicalIntersect; pub use logical_join::LogicalJoin; +pub use logical_kafka_scan::LogicalKafkaScan; pub use logical_limit::LogicalLimit; pub use logical_max_one_row::LogicalMaxOneRow; pub use logical_multi_join::{LogicalMultiJoin, LogicalMultiJoinBuilder}; @@ -1053,6 +1057,7 @@ macro_rules! for_all_plan_nodes { , { Logical, Intersect } , { Logical, Except } , { Logical, MaxOneRow } + , { Logical, KafkaScan } , { Batch, SimpleAgg } , { Batch, HashAgg } , { Batch, SortAgg } @@ -1080,6 +1085,7 @@ macro_rules! for_all_plan_nodes { , { Batch, Source } , { Batch, OverWindow } , { Batch, MaxOneRow } + , { Batch, KafkaScan } , { Stream, Project } , { Stream, Filter } , { Stream, TableScan } @@ -1151,6 +1157,7 @@ macro_rules! for_logical_plan_nodes { , { Logical, Intersect } , { Logical, Except } , { Logical, MaxOneRow } + , { Logical, KafkaScan } } }; } @@ -1187,6 +1194,7 @@ macro_rules! for_batch_plan_nodes { , { Batch, Source } , { Batch, OverWindow } , { Batch, MaxOneRow } + , { Batch, KafkaScan } } }; } diff --git a/src/frontend/src/optimizer/rule/mod.rs b/src/frontend/src/optimizer/rule/mod.rs index dff3f986ce22a..e52e0ca7a8b37 100644 --- a/src/frontend/src/optimizer/rule/mod.rs +++ b/src/frontend/src/optimizer/rule/mod.rs @@ -157,9 +157,11 @@ pub use apply_hop_window_transpose_rule::*; mod agg_call_merge_rule; pub use agg_call_merge_rule::*; mod pull_up_correlated_predicate_agg_rule; +mod source_to_kafka_scan_rule; mod values_extract_project_rule; pub use batch::batch_push_limit_to_scan_rule::*; pub use pull_up_correlated_predicate_agg_rule::*; +pub use source_to_kafka_scan_rule::*; pub use values_extract_project_rule::*; #[macro_export] @@ -233,6 +235,7 @@ macro_rules! for_all_rules { , { ValuesExtractProjectRule } , { BatchPushLimitToScanRule } , { PullUpCorrelatedPredicateAggRule } + , { SourceToKafkaScanRule } } }; } diff --git a/src/frontend/src/optimizer/rule/source_to_kafka_scan_rule.rs b/src/frontend/src/optimizer/rule/source_to_kafka_scan_rule.rs new file mode 100644 index 0000000000000..244278bdc33c4 --- /dev/null +++ b/src/frontend/src/optimizer/rule/source_to_kafka_scan_rule.rs @@ -0,0 +1,35 @@ +// Copyright 2024 RisingWave Labs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::{BoxedRule, Rule}; +use crate::optimizer::plan_node::{LogicalKafkaScan, LogicalSource}; +use crate::optimizer::PlanRef; + +pub struct SourceToKafkaScanRule {} +impl Rule for SourceToKafkaScanRule { + fn apply(&self, plan: PlanRef) -> Option { + let source: &LogicalSource = plan.as_logical_source()?; + if source.core.is_kafka_connector() { + Some(LogicalKafkaScan::new(source).into()) + } else { + None + } + } +} + +impl SourceToKafkaScanRule { + pub fn create() -> BoxedRule { + Box::new(SourceToKafkaScanRule {}) + } +} diff --git a/src/frontend/src/scheduler/distributed/stage.rs b/src/frontend/src/scheduler/distributed/stage.rs index 9a5e00fbfd702..32dac7200619a 100644 --- a/src/frontend/src/scheduler/distributed/stage.rs +++ b/src/frontend/src/scheduler/distributed/stage.rs @@ -987,7 +987,7 @@ impl StageRunner { node_body: Some(NodeBody::RowSeqScan(scan_node)), } } - PlanNodeType::BatchSource => { + PlanNodeType::BatchSource | PlanNodeType::BatchKafkaScan => { let node_body = execution_plan_node.node.clone(); let NodeBody::Source(mut source_node) = node_body else { unreachable!(); diff --git a/src/frontend/src/scheduler/local.rs b/src/frontend/src/scheduler/local.rs index ede32d2033353..c6340189743f6 100644 --- a/src/frontend/src/scheduler/local.rs +++ b/src/frontend/src/scheduler/local.rs @@ -472,7 +472,7 @@ impl LocalQueryExecution { node_body: Some(node_body), }) } - PlanNodeType::BatchSource => { + PlanNodeType::BatchSource | PlanNodeType::BatchKafkaScan => { let mut node_body = execution_plan_node.node.clone(); match &mut node_body { NodeBody::Source(ref mut source_node) => { diff --git a/src/frontend/src/scheduler/plan_fragmenter.rs b/src/frontend/src/scheduler/plan_fragmenter.rs index d95f4d627926c..9fc9316d02814 100644 --- a/src/frontend/src/scheduler/plan_fragmenter.rs +++ b/src/frontend/src/scheduler/plan_fragmenter.rs @@ -54,7 +54,7 @@ use crate::catalog::catalog_service::CatalogReader; use crate::catalog::TableId; use crate::error::RwError; use crate::optimizer::plan_node::generic::{GenericPlanRef, PhysicalPlanRef}; -use crate::optimizer::plan_node::{BatchSource, PlanNodeId, PlanNodeType}; +use crate::optimizer::plan_node::{BatchKafkaScan, BatchSource, PlanNodeId, PlanNodeType}; use crate::optimizer::property::Distribution; use crate::optimizer::PlanRef; use crate::scheduler::SchedulerResult; @@ -294,7 +294,7 @@ impl SourceScanInfo { match fetch_info.connector { ConnectorProperties::Kafka(prop) => { let mut kafka_enumerator = - KafkaSplitEnumerator::new(*prop, SourceEnumeratorContext::default().into()) + KafkaSplitEnumerator::new(*prop, SourceEnumeratorContext::dummy().into()) .await?; let split_info = kafka_enumerator .list_splits_batch(fetch_info.timebound.0, fetch_info.timebound.1) @@ -329,7 +329,7 @@ impl SourceScanInfo { } ConnectorProperties::Iceberg(prop) => { let iceberg_enumerator = - IcebergSplitEnumerator::new(*prop, SourceEnumeratorContext::default().into()) + IcebergSplitEnumerator::new(*prop, SourceEnumeratorContext::dummy().into()) .await?; let time_travel_info = match fetch_info.as_of { @@ -1003,7 +1003,23 @@ impl BatchPlanFragmenter { return Ok(None); } - if let Some(source_node) = node.as_batch_source() { + if let Some(batch_kafka_node) = node.as_batch_kafka_scan() { + let batch_kafka_scan: &BatchKafkaScan = batch_kafka_node; + let source_catalog = batch_kafka_scan.source_catalog(); + if let Some(source_catalog) = source_catalog { + let property = ConnectorProperties::extract( + source_catalog.with_properties.clone().into_iter().collect(), + false, + )?; + let timestamp_bound = batch_kafka_scan.kafka_timestamp_range_value(); + return Ok(Some(SourceScanInfo::new(SourceFetchInfo { + connector: property, + timebound: timestamp_bound, + as_of: None, + }))); + } + } else if let Some(source_node) = node.as_batch_source() { + // TODO: use specific batch operator instead of batch source. let source_node: &BatchSource = source_node; let source_catalog = source_node.source_catalog(); if let Some(source_catalog) = source_catalog { @@ -1011,11 +1027,10 @@ impl BatchPlanFragmenter { source_catalog.with_properties.clone().into_iter().collect(), false, )?; - let timestamp_bound = source_node.kafka_timestamp_range_value(); let as_of = source_node.as_of(); return Ok(Some(SourceScanInfo::new(SourceFetchInfo { connector: property, - timebound: timestamp_bound, + timebound: (None, None), as_of, }))); } diff --git a/src/meta/model_v2/migration/src/lib.rs b/src/meta/model_v2/migration/src/lib.rs index 724355358b026..7feaf88788693 100644 --- a/src/meta/model_v2/migration/src/lib.rs +++ b/src/meta/model_v2/migration/src/lib.rs @@ -8,6 +8,7 @@ mod m20240304_074901_subscription; mod m20240410_082733_with_version_column_migration; mod m20240410_154406_session_params; mod m20240417_062305_subscription_internal_table_name; +mod m20240418_142249_function_runtime; pub struct Migrator; @@ -21,6 +22,7 @@ impl MigratorTrait for Migrator { Box::new(m20240410_082733_with_version_column_migration::Migration), Box::new(m20240410_154406_session_params::Migration), Box::new(m20240417_062305_subscription_internal_table_name::Migration), + Box::new(m20240418_142249_function_runtime::Migration), ] } } diff --git a/src/meta/model_v2/migration/src/m20240418_142249_function_runtime.rs b/src/meta/model_v2/migration/src/m20240418_142249_function_runtime.rs new file mode 100644 index 0000000000000..80dcfae266c8d --- /dev/null +++ b/src/meta/model_v2/migration/src/m20240418_142249_function_runtime.rs @@ -0,0 +1,61 @@ +use sea_orm_migration::prelude::{Table as MigrationTable, *}; + +#[derive(DeriveMigrationName)] +pub struct Migration; + +#[async_trait::async_trait] +impl MigrationTrait for Migration { + async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { + assert!(manager.has_table(Function::Table.to_string()).await?); + + manager + .alter_table( + MigrationTable::alter() + .table(Function::Table) + .add_column(ColumnDef::new(Function::Runtime).string()) + .to_owned(), + ) + .await?; + + manager + .alter_table( + MigrationTable::alter() + .table(Function::Table) + .add_column(ColumnDef::new(Function::FunctionType).string()) + .to_owned(), + ) + .await?; + + Ok(()) + } + + async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { + // drop tables cascade. + + manager + .alter_table( + MigrationTable::alter() + .table(Function::Table) + .drop_column(Alias::new(Function::Runtime.to_string())) + .to_owned(), + ) + .await?; + + manager + .alter_table( + MigrationTable::alter() + .table(Function::Table) + .drop_column(Alias::new(Function::FunctionType.to_string())) + .to_owned(), + ) + .await?; + Ok(()) + } +} + +#[derive(DeriveIden)] +enum Function { + Table, + Runtime, + FunctionType, +} diff --git a/src/meta/model_v2/src/function.rs b/src/meta/model_v2/src/function.rs index e0d79f3bc5571..520df5cd2bf05 100644 --- a/src/meta/model_v2/src/function.rs +++ b/src/meta/model_v2/src/function.rs @@ -47,6 +47,8 @@ pub struct Model { pub compressed_binary: Option>, pub kind: FunctionKind, pub always_retry_on_network_error: bool, + pub runtime: Option, + pub function_type: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] @@ -104,6 +106,8 @@ impl From for ActiveModel { compressed_binary: Set(function.compressed_binary), kind: Set(function.kind.unwrap().into()), always_retry_on_network_error: Set(function.always_retry_on_network_error), + runtime: Set(function.runtime), + function_type: Set(function.function_type), } } } diff --git a/src/meta/service/src/cloud_service.rs b/src/meta/service/src/cloud_service.rs index 9c213bd7cb9e2..b77b751b281e7 100644 --- a/src/meta/service/src/cloud_service.rs +++ b/src/meta/service/src/cloud_service.rs @@ -159,7 +159,7 @@ impl CloudService for CloudServiceImpl { async fn new_enumerator( props: P, ) -> ConnectorResult { - P::SplitEnumerator::new(props, SourceEnumeratorContext::default().into()).await + P::SplitEnumerator::new(props, SourceEnumeratorContext::dummy().into()).await } dispatch_source_prop!(props.unwrap(), props, { diff --git a/src/meta/src/controller/mod.rs b/src/meta/src/controller/mod.rs index ff98459888399..a271ab85bb928 100644 --- a/src/meta/src/controller/mod.rs +++ b/src/meta/src/controller/mod.rs @@ -324,6 +324,8 @@ impl From> for PbFunction { compressed_binary: value.0.compressed_binary, kind: Some(value.0.kind.into()), always_retry_on_network_error: value.0.always_retry_on_network_error, + runtime: value.0.runtime, + function_type: value.0.function_type, } } } diff --git a/src/meta/src/rpc/ddl_controller.rs b/src/meta/src/rpc/ddl_controller.rs index 1c551f46b6fc1..c0aa62750facb 100644 --- a/src/meta/src/rpc/ddl_controller.rs +++ b/src/meta/src/rpc/ddl_controller.rs @@ -845,7 +845,7 @@ impl DdlController { async fn new_enumerator_for_validate( source_props: P, ) -> Result { - P::SplitEnumerator::new(source_props, SourceEnumeratorContext::default().into()).await + P::SplitEnumerator::new(source_props, SourceEnumeratorContext::dummy().into()).await } for actor in &stream_scan_fragment.actors { diff --git a/src/sqlparser/src/ast/mod.rs b/src/sqlparser/src/ast/mod.rs index 79c12c1b6cc6f..5b587981ac67e 100644 --- a/src/sqlparser/src/ast/mod.rs +++ b/src/sqlparser/src/ast/mod.rs @@ -2884,6 +2884,9 @@ impl fmt::Display for TableColumnDef { pub struct CreateFunctionBody { /// LANGUAGE lang_name pub language: Option, + + pub runtime: Option, + /// IMMUTABLE | STABLE | VOLATILE pub behavior: Option, /// AS 'definition' @@ -2894,6 +2897,8 @@ pub struct CreateFunctionBody { pub return_: Option, /// USING ... pub using: Option, + + pub function_type: Option, } impl fmt::Display for CreateFunctionBody { @@ -2901,6 +2906,11 @@ impl fmt::Display for CreateFunctionBody { if let Some(language) = &self.language { write!(f, " LANGUAGE {language}")?; } + + if let Some(runtime) = &self.runtime { + write!(f, " RUNTIME {runtime}")?; + } + if let Some(behavior) = &self.behavior { write!(f, " {behavior}")?; } @@ -2913,6 +2923,9 @@ impl fmt::Display for CreateFunctionBody { if let Some(using) = &self.using { write!(f, " {using}")?; } + if let Some(function_type) = &self.function_type { + write!(f, " {function_type}")?; + } Ok(()) } } @@ -2987,6 +3000,42 @@ impl fmt::Display for CreateFunctionUsing { } } +#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +pub enum FunctionRuntime { + QuickJs, + Deno, +} + +impl fmt::Display for FunctionRuntime { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + FunctionRuntime::QuickJs => write!(f, "quickjs"), + FunctionRuntime::Deno => write!(f, "deno"), + } + } +} + +#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +pub enum CreateFunctionType { + Sync, + Async, + Generator, + AsyncGenerator, +} + +impl fmt::Display for CreateFunctionType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + CreateFunctionType::Sync => write!(f, "SYNC"), + CreateFunctionType::Async => write!(f, "ASYNC"), + CreateFunctionType::Generator => write!(f, "SYNC GENERATOR"), + CreateFunctionType::AsyncGenerator => write!(f, "ASYNC GENERATOR"), + } + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum SetVariableValue { @@ -3206,6 +3255,8 @@ mod tests { as_: Some(FunctionDefinition::SingleQuotedDef("SELECT 1".to_string())), return_: None, using: None, + runtime: None, + function_type: None, }, with_options: CreateFunctionWithOptions { always_retry_on_network_error: None, @@ -3227,6 +3278,8 @@ mod tests { as_: Some(FunctionDefinition::SingleQuotedDef("SELECT 1".to_string())), return_: None, using: None, + runtime: None, + function_type: None, }, with_options: CreateFunctionWithOptions { always_retry_on_network_error: Some(true), @@ -3236,5 +3289,29 @@ mod tests { "CREATE FUNCTION foo(INT) RETURNS INT LANGUAGE python IMMUTABLE AS 'SELECT 1' WITH ( ALWAYS_RETRY_NETWORK_ERRORS = true )", format!("{}", create_function) ); + + let create_function = Statement::CreateFunction { + temporary: false, + or_replace: false, + name: ObjectName(vec![Ident::new_unchecked("foo")]), + args: Some(vec![OperateFunctionArg::unnamed(DataType::Int)]), + returns: Some(CreateFunctionReturns::Value(DataType::Int)), + params: CreateFunctionBody { + language: Some(Ident::new_unchecked("javascript")), + behavior: None, + as_: Some(FunctionDefinition::SingleQuotedDef("SELECT 1".to_string())), + return_: None, + using: None, + runtime: Some(FunctionRuntime::Deno), + function_type: Some(CreateFunctionType::AsyncGenerator), + }, + with_options: CreateFunctionWithOptions { + always_retry_on_network_error: None, + }, + }; + assert_eq!( + "CREATE FUNCTION foo(INT) RETURNS INT LANGUAGE javascript RUNTIME deno AS 'SELECT 1' ASYNC GENERATOR", + format!("{}", create_function) + ); } } diff --git a/src/sqlparser/src/keywords.rs b/src/sqlparser/src/keywords.rs index 5d282427d4537..630162964bcec 100644 --- a/src/sqlparser/src/keywords.rs +++ b/src/sqlparser/src/keywords.rs @@ -89,6 +89,7 @@ define_keywords!( ASC, ASENSITIVE, ASYMMETRIC, + ASYNC, AT, ATOMIC, AUTHORIZATION, @@ -246,6 +247,7 @@ define_keywords!( FUNCTION, FUNCTIONS, FUSION, + GENERATOR, GET, GLOBAL, GRANT, @@ -438,6 +440,7 @@ define_keywords!( ROWID, ROWS, ROW_NUMBER, + RUNTIME, SAVEPOINT, SCALAR, SCHEMA, diff --git a/src/sqlparser/src/parser.rs b/src/sqlparser/src/parser.rs index 92009ecb016ea..b4459a1f7c76a 100644 --- a/src/sqlparser/src/parser.rs +++ b/src/sqlparser/src/parser.rs @@ -2440,6 +2440,9 @@ impl Parser { } else if self.parse_keyword(Keyword::LANGUAGE) { ensure_not_set(&body.language, "LANGUAGE")?; body.language = Some(self.parse_identifier()?); + } else if self.parse_keyword(Keyword::RUNTIME) { + ensure_not_set(&body.runtime, "RUNTIME")?; + body.runtime = Some(self.parse_function_runtime()?); } else if self.parse_keyword(Keyword::IMMUTABLE) { ensure_not_set(&body.behavior, "IMMUTABLE | STABLE | VOLATILE")?; body.behavior = Some(FunctionBehavior::Immutable); @@ -2455,6 +2458,15 @@ impl Parser { } else if self.parse_keyword(Keyword::USING) { ensure_not_set(&body.using, "USING")?; body.using = Some(self.parse_create_function_using()?); + } else if self.parse_keyword(Keyword::SYNC) { + ensure_not_set(&body.function_type, "SYNC | ASYNC")?; + body.function_type = Some(self.parse_function_type(false, false)?); + } else if self.parse_keyword(Keyword::ASYNC) { + ensure_not_set(&body.function_type, "SYNC | ASYNC")?; + body.function_type = Some(self.parse_function_type(true, false)?); + } else if self.parse_keyword(Keyword::GENERATOR) { + ensure_not_set(&body.function_type, "SYNC | ASYNC")?; + body.function_type = Some(self.parse_function_type(false, true)?); } else { return Ok(body); } @@ -2477,6 +2489,36 @@ impl Parser { } } + fn parse_function_runtime(&mut self) -> Result { + let ident = self.parse_identifier()?; + match ident.value.to_lowercase().as_str() { + "deno" => Ok(FunctionRuntime::Deno), + "quickjs" => Ok(FunctionRuntime::QuickJs), + r => Err(ParserError::ParserError(format!( + "Unsupported runtime: {r}" + ))), + } + } + + fn parse_function_type( + &mut self, + is_async: bool, + is_generator: bool, + ) -> Result { + let is_generator = if is_generator { + true + } else { + self.parse_keyword(Keyword::GENERATOR) + }; + + match (is_async, is_generator) { + (false, false) => Ok(CreateFunctionType::Sync), + (true, false) => Ok(CreateFunctionType::Async), + (false, true) => Ok(CreateFunctionType::Generator), + (true, true) => Ok(CreateFunctionType::AsyncGenerator), + } + } + // CREATE USER name [ [ WITH ] option [ ... ] ] // where option can be: // SUPERUSER | NOSUPERUSER diff --git a/src/sqlparser/tests/sqlparser_postgres.rs b/src/sqlparser/tests/sqlparser_postgres.rs index 9ef7a7f085c4b..d70625c33d770 100644 --- a/src/sqlparser/tests/sqlparser_postgres.rs +++ b/src/sqlparser/tests/sqlparser_postgres.rs @@ -872,6 +872,31 @@ fn parse_create_function() { with_options: Default::default(), } ); + + let sql = "CREATE FUNCTION add(INT, INT) RETURNS INT LANGUAGE SQL IMMUTABLE AS 'select $1 + $2;' ASYNC"; + assert_eq!( + verified_stmt(sql), + Statement::CreateFunction { + or_replace: false, + temporary: false, + name: ObjectName(vec![Ident::new_unchecked("add")]), + args: Some(vec![ + OperateFunctionArg::unnamed(DataType::Int), + OperateFunctionArg::unnamed(DataType::Int), + ]), + returns: Some(CreateFunctionReturns::Value(DataType::Int)), + params: CreateFunctionBody { + language: Some("SQL".into()), + behavior: Some(FunctionBehavior::Immutable), + as_: Some(FunctionDefinition::SingleQuotedDef( + "select $1 + $2;".into() + )), + function_type: Some(CreateFunctionType::Async), + ..Default::default() + }, + with_options: Default::default(), + } + ); } #[test] diff --git a/src/stream/src/executor/backfill/cdc/cdc_backfill.rs b/src/stream/src/executor/backfill/cdc/cdc_backfill.rs index 234eceea9fc9b..96a53ace0b25b 100644 --- a/src/stream/src/executor/backfill/cdc/cdc_backfill.rs +++ b/src/stream/src/executor/backfill/cdc/cdc_backfill.rs @@ -626,7 +626,7 @@ pub async fn transform_upstream(upstream: BoxedMessageStream, schema: &Schema) { let mut parser = DebeziumParser::new( props, get_rw_columns(schema), - Arc::new(SourceContext::default()), + Arc::new(SourceContext::dummy()), ) .await .map_err(StreamExecutorError::connector_error)?; diff --git a/src/stream/src/executor/source/fetch_executor.rs b/src/stream/src/executor/source/fetch_executor.rs index 1d6e409c63a24..c555fb036d94c 100644 --- a/src/stream/src/executor/source/fetch_executor.rs +++ b/src/stream/src/executor/source/fetch_executor.rs @@ -172,10 +172,10 @@ impl FsFetchExecutor { self.actor_ctx.id, source_id, self.actor_ctx.fragment_id, + source_name.to_owned(), source_desc.metrics.clone(), self.source_ctrl_opts.clone(), source_desc.source.config.clone(), - source_name.to_owned(), ) } diff --git a/src/stream/src/executor/source/fs_source_executor.rs b/src/stream/src/executor/source/fs_source_executor.rs index 13b876c05c2be..36b7783950232 100644 --- a/src/stream/src/executor/source/fs_source_executor.rs +++ b/src/stream/src/executor/source/fs_source_executor.rs @@ -100,10 +100,10 @@ impl FsSourceExecutor { self.actor_ctx.id, self.stream_source_core.source_id, self.actor_ctx.fragment_id, + self.stream_source_core.source_name.clone(), source_desc.metrics.clone(), self.source_ctrl_opts.clone(), source_desc.source.config.clone(), - self.stream_source_core.source_name.clone(), ); let stream = source_desc .source diff --git a/src/stream/src/executor/source/source_backfill_executor.rs b/src/stream/src/executor/source/source_backfill_executor.rs index be752b4598a3a..7b3c594cab5af 100644 --- a/src/stream/src/executor/source/source_backfill_executor.rs +++ b/src/stream/src/executor/source/source_backfill_executor.rs @@ -210,10 +210,10 @@ impl SourceBackfillExecutorInner { self.actor_ctx.id, self.stream_source_core.source_id, self.actor_ctx.fragment_id, + self.stream_source_core.source_name.clone(), source_desc.metrics.clone(), self.source_ctrl_opts.clone(), source_desc.source.config.clone(), - self.stream_source_core.source_name.clone(), ); let stream = source_desc .source diff --git a/src/stream/src/executor/source/source_executor.rs b/src/stream/src/executor/source/source_executor.rs index d86a85ec5bde4..cf54166afd396 100644 --- a/src/stream/src/executor/source/source_executor.rs +++ b/src/stream/src/executor/source/source_executor.rs @@ -160,14 +160,14 @@ impl SourceExecutor { self.actor_ctx.id, self.stream_source_core.as_ref().unwrap().source_id, self.actor_ctx.fragment_id, - source_desc.metrics.clone(), - self.source_ctrl_opts.clone(), - source_desc.source.config.clone(), self.stream_source_core .as_ref() .unwrap() .source_name .clone(), + source_desc.metrics.clone(), + self.source_ctrl_opts.clone(), + source_desc.source.config.clone(), ); let stream = source_desc .source @@ -839,7 +839,10 @@ mod tests { Arc::new(StreamingMetrics::unused()), barrier_rx, system_params_manager.get_params(), - SourceCtrlOpts::default(), + SourceCtrlOpts { + chunk_size: 1024, + rate_limit: None, + }, ); let mut executor = executor.boxed().execute(); @@ -927,7 +930,10 @@ mod tests { Arc::new(StreamingMetrics::unused()), barrier_rx, system_params_manager.get_params(), - SourceCtrlOpts::default(), + SourceCtrlOpts { + chunk_size: 1024, + rate_limit: None, + }, ); let mut handler = executor.boxed().execute(); diff --git a/src/stream/src/from_proto/source/trad_source.rs b/src/stream/src/from_proto/source/trad_source.rs index ca057ced81f6f..3610c8a95caf0 100644 --- a/src/stream/src/from_proto/source/trad_source.rs +++ b/src/stream/src/from_proto/source/trad_source.rs @@ -269,7 +269,10 @@ impl ExecutorBuilder for SourceExecutorBuilder { barrier_receiver, system_params, // we don't expect any data in, so no need to set chunk_sizes - SourceCtrlOpts::default(), + SourceCtrlOpts { + chunk_size: 0, + rate_limit: None, + }, ); Ok((params.info, exec).into()) } diff --git a/src/stream/src/task/barrier_manager.rs b/src/stream/src/task/barrier_manager.rs index 0f3a90ad81f45..9d006a426d6b7 100644 --- a/src/stream/src/task/barrier_manager.rs +++ b/src/stream/src/task/barrier_manager.rs @@ -62,7 +62,7 @@ use risingwave_storage::store::SyncResult; use crate::executor::exchange::permit::Receiver; use crate::executor::monitor::StreamingMetrics; -use crate::executor::{Actor, Barrier, DispatchExecutor, Mutation}; +use crate::executor::{Actor, Barrier, DispatchExecutor, Mutation, StreamExecutorError}; use crate::task::barrier_manager::progress::BackfillState; /// If enabled, all actors will be grouped in the same tracing span within one epoch. @@ -694,7 +694,8 @@ impl LocalBarrierWorker { /// will notice actor's exit while collecting. async fn notify_failure(&mut self, actor_id: ActorId, err: StreamError) { self.add_failure(actor_id, err.clone()); - let root_err = self.try_find_root_failure(err).await; + let root_err = self.try_find_root_failure().await; + let failed_epochs = self.state.epochs_await_on_actor(actor_id).collect_vec(); if !failed_epochs.is_empty() { self.control_stream_handle.reset_stream_with_err( @@ -709,7 +710,6 @@ impl LocalBarrierWorker { } fn add_failure(&mut self, actor_id: ActorId, err: StreamError) { - let err = err.into_unexpected_exit(actor_id); if let Some(prev_err) = self.failure_actors.insert(actor_id, err) { warn!( actor_id, @@ -719,7 +719,7 @@ impl LocalBarrierWorker { } } - async fn try_find_root_failure(&mut self, default_err: StreamError) -> StreamError { + async fn try_find_root_failure(&mut self) -> StreamError { if let Some(root_failure) = &self.root_failure { return root_failure.clone(); } @@ -731,7 +731,10 @@ impl LocalBarrierWorker { }) .await; self.root_failure = try_find_root_actor_failure(self.failure_actors.values()); - self.root_failure.clone().unwrap_or(default_err) + + self.root_failure + .clone() + .expect("failure actors should not be empty") } } @@ -817,7 +820,9 @@ impl LocalBarrierManager { /// When a actor exit unexpectedly, it should report this event using this function, so meta /// will notice actor's exit while collecting. pub fn notify_failure(&self, actor_id: ActorId, err: StreamError) { - let _ = self.actor_failure_sender.send((actor_id, err)); + let _ = self + .actor_failure_sender + .send((actor_id, err.into_unexpected_exit(actor_id))); } /// When a `RemoteInput` get a barrier, it should wait and read the barrier mutation from the barrier manager. @@ -839,26 +844,30 @@ impl LocalBarrierManager { pub fn try_find_root_actor_failure<'a>( actor_errors: impl IntoIterator, ) -> Option { - use crate::executor::StreamExecutorError; - let stream_executor_error_score = |e: &StreamExecutorError| { + fn stream_executor_error_score(e: &StreamExecutorError) -> i32 { use crate::executor::error::ErrorKind; match e.inner() { ErrorKind::ChannelClosed(_) => 0, ErrorKind::Internal(_) => 1, _ => 999, } - }; - let stream_error_score = |e: &&StreamError| { + } + + fn stream_error_score(e: &StreamError) -> i32 { use crate::error::ErrorKind; match e.inner() { + // `UnexpectedExit` wraps the original error. Score on the inner error. + ErrorKind::UnexpectedExit { source, .. } => stream_error_score(source), + ErrorKind::Internal(_) => 1000, ErrorKind::Executor(ee) => 2000 + stream_executor_error_score(ee), _ => 3000, } - }; + } + actor_errors .into_iter() - .max_by_key(stream_error_score) + .max_by_key(|&e| stream_error_score(e)) .cloned() }