diff --git a/.github/workflows/test-pg_analytics.yml b/.github/workflows/test-pg_analytics.yml index b2ec88d7..0b2bc85f 100644 --- a/.github/workflows/test-pg_analytics.yml +++ b/.github/workflows/test-pg_analytics.yml @@ -153,3 +153,13 @@ jobs: export DATABASE_URL=postgresql://localhost:288${{ matrix.pg_version }}/postgres export RUST_BACKTRACE=1 cargo test --package tests --features "pg${{ matrix.pg_version }}" --no-default-features + cargo pgrx test "pg${{ matrix.pg_version }}" + + - name: Run sqllogictest + if: steps.check_skip.outputs.skip_remaining_steps != 'true' + run: | + echo "" + echo "Running sqllogictest..." + cd tests/sqllogictests + export DATABASE_URL=postgresql://localhost:288${{ matrix.pg_version }}/postgres + cargo test --test sqllogictests --features pg${{ matrix.pg_version }} diff --git a/Cargo.lock b/Cargo.lock index b2b958ea..77449e7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" @@ -39,7 +39,7 @@ dependencies = [ "getrandom", "once_cell", "version_check", - "zerocopy 0.7.35", + "zerocopy", ] [[package]] @@ -97,11 +97,60 @@ dependencies = [ "yansi-term", ] +[[package]] +name = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "approx" @@ -114,15 +163,15 @@ dependencies = [ [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "arrow" @@ -362,7 +411,7 @@ dependencies = [ "arrow-schema 51.0.0", "chrono", "half 2.4.1", - "indexmap 2.3.0", + "indexmap 2.6.0", "lexical-core", "num", "serde", @@ -543,9 +592,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.12" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec134f64e2bc57411226dfc4e52dec859ddfc7e711fc5e07b612584f000e4aa" +checksum = "103db485efc3e41214fe4fda9f3dbeae2eb9082f48fd236e6095627a9422066e" dependencies = [ "bzip2", "flate2", @@ -561,13 +610,13 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.1.0", + "fastrand 2.1.1", "futures-lite 2.3.0", "slab", ] @@ -580,7 +629,7 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.3.3", + "async-io 2.3.4", "async-lock 3.4.0", "blocking", "futures-lite 2.3.0", @@ -610,9 +659,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ "async-lock 3.4.0", "cfg-if", @@ -620,11 +669,11 @@ dependencies = [ "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.2", - "rustix 0.38.34", + "polling 3.7.3", + "rustix 0.38.37", "slab", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -656,7 +705,7 @@ dependencies = [ "async-attributes", "async-channel 1.9.0", "async-global-executor", - "async-io 2.3.3", + "async-io 2.3.4", "async-lock 3.4.0", "crossbeam-utils", "futures-channel", @@ -682,9 +731,9 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", @@ -718,15 +767,15 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-config" -version = "1.5.6" +version = "1.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "848d7b9b605720989929279fa644ce8f244d0ce3146fcca5b70e4eb7b3c020fc" +checksum = "7198e6f03240fdceba36656d8be440297b6b82270325908c7381f37d826a74f6" dependencies = [ "aws-credential-types", "aws-runtime", @@ -741,7 +790,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.1.0", + "fastrand 2.1.1", "hex", "http 0.2.12", "ring", @@ -780,7 +829,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.1.0", + "fastrand 2.1.1", "http 0.2.12", "http-body 0.4.6", "once_cell", @@ -792,9 +841,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.49.0" +version = "1.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e518950d4ac43508c8bfc2fe4e24b0752d99eab80134461d5e162dcda0214b55" +checksum = "8888c238bf93c77c5df8274b3999fd7fc1bb3fb658616f40dfde9e4fcd9efd94" dependencies = [ "ahash 0.8.11", "aws-credential-types", @@ -811,7 +860,7 @@ dependencies = [ "aws-smithy-xml", "aws-types", "bytes", - "fastrand 2.1.0", + "fastrand 2.1.1", "hex", "hmac", "http 0.2.12", @@ -827,9 +876,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.42.0" +version = "1.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27bf24cd0d389daa923e974b0e7c38daf308fc21e963c049f57980235017175e" +checksum = "0dc2faec3205d496c7e57eff685dd944203df7ce16a4116d0281c44021788a7b" dependencies = [ "aws-credential-types", "aws-runtime", @@ -849,9 +898,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.43.0" +version = "1.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43b3220f1c46ac0e9dcc0a97d94b93305dacb36d1dd393996300c6b9b74364" +checksum = "c93c241f52bc5e0476e259c953234dab7e2a35ee207ee202e86c0095ec4951dc" dependencies = [ "aws-credential-types", "aws-runtime", @@ -871,9 +920,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.42.0" +version = "1.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1c46924fb1add65bba55636e12812cae2febf68c0f37361766f627ddcca91ce" +checksum = "b259429be94a3459fa1b00c5684faee118d74f9577cc50aebadc36e507c63b5f" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1006,22 +1055,22 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1ce695746394772e7000b39fe073095db6d45a862d0767dd5ad0ac0d7f8eb87" +checksum = "a065c0fe6fdbdf9f11817eb68582b2ab4aff9e9c39e986ae48f7ec576c6322db" dependencies = [ "aws-smithy-async", "aws-smithy-http", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", - "fastrand 2.1.0", + "fastrand 2.1.1", "h2", "http 0.2.12", "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", @@ -1050,9 +1099,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.6" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03701449087215b5369c7ea17fef0dd5d24cb93439ec5af0c7615f58c3f22605" +checksum = "147100a7bea70fa20ef224a6bad700358305f5dc0f84649c53769761395b355b" dependencies = [ "base64-simd", "bytes", @@ -1099,17 +1148,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -1168,7 +1217,7 @@ dependencies = [ "bitflags 2.6.0", "cexpr", "clang-sys", - "itertools", + "itertools 0.13.0", "proc-macro2", "quote", "regex", @@ -1215,9 +1264,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" +checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" dependencies = [ "arrayref", "arrayvec", @@ -1263,7 +1312,7 @@ dependencies = [ "home", "http 1.1.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-named-pipe", "hyper-rustls 0.26.0", "hyper-util", @@ -1271,8 +1320,8 @@ dependencies = [ "log", "pin-project-lite", "rustls 0.22.4", - "rustls-native-certs 0.7.1", - "rustls-pemfile 2.1.2", + "rustls-native-certs 0.7.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", "serde_derive", @@ -1373,18 +1422,18 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.16.3" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83" +checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" +checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" dependencies = [ "proc-macro2", "quote", @@ -1399,9 +1448,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "bytes-utils" @@ -1467,12 +1516,13 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.7" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -1576,6 +1626,46 @@ dependencies = [ "libloading", ] +[[package]] +name = "clap" +version = "4.5.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + [[package]] name = "codepage" version = "0.1.2" @@ -1585,6 +1675,12 @@ dependencies = [ "encoding_rs", ] +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + [[package]] name = "comfy-table" version = "7.1.1" @@ -1633,9 +1729,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "convert_case" @@ -1658,15 +1754,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1858,8 +1954,8 @@ dependencies = [ "glob", "half 2.4.1", "hashbrown 0.14.5", - "indexmap 2.3.0", - "itertools", + "indexmap 2.6.0", + "itertools 0.12.1", "log", "num_cpus", "object_store", @@ -1961,7 +2057,7 @@ dependencies = [ "datafusion-expr", "datafusion-physical-expr", "hex", - "itertools", + "itertools 0.12.1", "log", "md-5", "regex", @@ -1985,7 +2081,7 @@ dependencies = [ "datafusion-execution", "datafusion-expr", "datafusion-functions", - "itertools", + "itertools 0.12.1", "log", "paste", ] @@ -2003,7 +2099,7 @@ dependencies = [ "datafusion-expr", "datafusion-physical-expr", "hashbrown 0.14.5", - "itertools", + "itertools 0.12.1", "log", "regex-syntax", ] @@ -2031,8 +2127,8 @@ dependencies = [ "half 2.4.1", "hashbrown 0.14.5", "hex", - "indexmap 2.3.0", - "itertools", + "indexmap 2.6.0", + "itertools 0.12.1", "log", "md-5", "paste", @@ -2064,8 +2160,8 @@ dependencies = [ "futures", "half 2.4.1", "hashbrown 0.14.5", - "indexmap 2.3.0", - "itertools", + "indexmap 2.6.0", + "itertools 0.12.1", "log", "once_cell", "parking_lot", @@ -2149,8 +2245,8 @@ dependencies = [ "fix-hidden-lifetime-bug", "futures", "hashbrown 0.14.5", - "indexmap 2.3.0", - "itertools", + "indexmap 2.6.0", + "itertools 0.12.1", "lazy_static", "libc", "maplit", @@ -2308,6 +2404,18 @@ dependencies = [ "signature 1.6.4", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "either" version = "1.13.0" @@ -2366,6 +2474,26 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -2382,6 +2510,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "escape8259" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5692dd7b5a1978a5aeb0ce83b7655c58ca8efdcb79d21036ea249da95afec2c6" + [[package]] name = "etcetera" version = "0.8.0" @@ -2453,9 +2587,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "ff" @@ -2469,30 +2603,30 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] name = "fix-hidden-lifetime-bug" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40976db4d694ad47c9cdf86bd978cf4cfbe1c29469d5d1fc5b730a75e3d43a9b" +checksum = "ab7b4994e93dd63050356bdde7d417591d1b348523638dc1c1f539f16e338d55" dependencies = [ "fix-hidden-lifetime-bug-proc_macros", ] [[package]] name = "fix-hidden-lifetime-bug-proc_macros" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75ab4fc77a21a7e7704c9ddbceaeb00ad8512b71b83738f3c0f17a0f44ee24a3" +checksum = "e8f0de9daf465d763422866d0538f07be1596e05623e120b37b4f715f5585200" dependencies = [ "proc-macro2", "quote", @@ -2517,9 +2651,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "miniz_oxide", @@ -2542,6 +2676,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -2551,6 +2691,15 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + [[package]] name = "funty" version = "2.0.0" @@ -2559,9 +2708,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -2574,9 +2723,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -2584,15 +2733,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -2612,9 +2761,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -2637,7 +2786,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.1.0", + "fastrand 2.1.1", "futures-core", "futures-io", "parking", @@ -2646,9 +2795,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -2657,15 +2806,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" @@ -2675,9 +2824,9 @@ checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -2738,9 +2887,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -2783,7 +2932,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.3.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -2836,6 +2985,17 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + [[package]] name = "hashlink" version = "0.8.4" @@ -2973,9 +3133,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2991,9 +3151,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -3015,9 +3175,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -3039,7 +3199,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278" dependencies = [ "hex", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -3055,7 +3215,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "rustls 0.21.12", "rustls-native-certs 0.6.3", @@ -3071,11 +3231,11 @@ checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "log", "rustls 0.22.4", - "rustls-native-certs 0.7.1", + "rustls-native-certs 0.7.3", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", @@ -3084,20 +3244,19 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "pin-project-lite", "socket2 0.5.7", "tokio", - "tower", "tower-service", "tracing", ] @@ -3110,7 +3269,7 @@ checksum = "acf569d43fa9848e510358c07b80f4adf34084ddc28c6a4a651ee8474c070dcc" dependencies = [ "hex", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -3119,9 +3278,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3175,12 +3334,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.3.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", "serde", ] @@ -3230,6 +3389,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.12.1" @@ -3239,6 +3404,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -3256,9 +3430,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -3347,9 +3521,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libduckdb-sys" @@ -3390,6 +3564,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", + "redox_syscall", ] [[package]] @@ -3403,6 +3578,18 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "libtest-mimic" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc0bda45ed5b3a2904262c1bb91e526127aa70e7ef3758aba2ef93cf896b9b58" +dependencies = [ + "clap", + "escape8259", + "termcolor", + "threadpool", +] + [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -3436,11 +3623,11 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] @@ -3493,18 +3680,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi 0.3.9", "libc", @@ -3631,9 +3818,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.2" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] @@ -3649,7 +3836,7 @@ dependencies = [ "chrono", "futures", "humantime", - "itertools", + "itertools 0.12.1", "parking_lot", "percent-encoding", "snafu", @@ -3661,9 +3848,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl-probe" @@ -3694,11 +3881,12 @@ checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" [[package]] name = "owo-colors" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" dependencies = [ - "supports-color", + "supports-color 2.1.0", + "supports-color 3.0.1", ] [[package]] @@ -3712,11 +3900,32 @@ dependencies = [ "sha2", ] +[[package]] +name = "paradedb-sqllogictest" +version = "0.2.1" +dependencies = [ + "anyhow", + "async-std", + "async-trait", + "bigdecimal", + "bytes", + "chrono", + "datafusion", + "futures", + "log", + "num_cpus", + "pgrx", + "sqllogictest", + "sqlparser 0.50.0", + "sqlx", + "thiserror", +] + [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -3736,7 +3945,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] @@ -3849,9 +4058,9 @@ checksum = "df202b0b0f5b8e389955afd5f27b007b00fb948162953f1db9c70d2c7e3157d7" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", "thiserror", @@ -3865,7 +4074,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.3.0", + "indexmap 2.6.0", ] [[package]] @@ -4027,26 +4236,6 @@ dependencies = [ "siphasher", ] -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", -] - [[package]] name = "pin-project-lite" version = "0.2.14" @@ -4061,12 +4250,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.1.0", + "fastrand 2.1.1", "futures-io", ] @@ -4103,9 +4292,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "polling" @@ -4125,17 +4314,17 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.2" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.34", + "rustix 0.38.37", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4146,11 +4335,11 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy 0.6.6", + "zerocopy", ] [[package]] @@ -4187,9 +4376,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -4211,7 +4400,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools", + "itertools 0.12.1", "proc-macro2", "quote", "syn 2.0.79", @@ -4294,27 +4483,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -4323,9 +4503,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", @@ -4335,9 +4515,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -4352,9 +4532,9 @@ checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "relative-path" @@ -4399,9 +4579,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", "bytecheck", @@ -4417,9 +4597,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" dependencies = [ "proc-macro2", "quote", @@ -4487,9 +4667,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.35.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" +checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" dependencies = [ "arrayvec", "borsh", @@ -4547,9 +4727,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -4579,7 +4759,7 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -4598,12 +4778,12 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.2", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", "security-framework", @@ -4620,19 +4800,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -4646,9 +4825,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -4657,9 +4836,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -4678,11 +4857,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4736,9 +4915,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -4785,9 +4964,9 @@ dependencies = [ [[package]] name = "serde_arrow" -version = "0.11.7" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2118d57cd864dbd4fc0a54afcd1adc245051edf03c7419b99e4b7fb47bb3052a" +checksum = "f11dc39a704b214e72e4cec092fff98180ac432f5f7850dd0d55e9012c29fba9" dependencies = [ "arrow-array 51.0.0", "arrow-buffer 51.0.0", @@ -4822,9 +5001,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "6dbcf9b78a125ee667ae19388837dd12294b858d101fdd393cb9d5501ef09eb2" dependencies = [ "itoa", "memchr", @@ -4845,9 +5024,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -4866,15 +5045,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.3.0", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", @@ -4884,9 +5063,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", "proc-macro2", @@ -4963,9 +5142,15 @@ dependencies = [ [[package]] name = "simdutf8" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "similar" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "siphasher" @@ -5094,14 +5279,38 @@ checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" [[package]] name = "sqlformat" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" dependencies = [ "nom", "unicode_categories", ] +[[package]] +name = "sqllogictest" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b6b8f606d3c4cdcaf2031c4320b79d7584e454b79562ba3d675f49701c160e" +dependencies = [ + "async-trait", + "educe", + "fs-err", + "futures", + "glob", + "humantime", + "itertools 0.13.0", + "libtest-mimic", + "md-5", + "owo-colors", + "regex", + "similar", + "subst", + "tempfile", + "thiserror", + "tracing", +] + [[package]] name = "sqlparser" version = "0.44.0" @@ -5170,7 +5379,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.3.0", + "indexmap 2.6.0", "log", "memchr", "once_cell", @@ -5438,6 +5647,16 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "subst" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3c1ba4fd019bc866333a61fe205fc9b686e3cf5971dd8dfc116657d933031c" +dependencies = [ + "memchr", + "unicode-width", +] + [[package]] name = "subtle" version = "2.6.1" @@ -5476,6 +5695,15 @@ dependencies = [ "is_ci", ] +[[package]] +name = "supports-color" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8775305acf21c96926c900ad056abeef436701108518cf890020387236ac5a77" +dependencies = [ + "is_ci", +] + [[package]] name = "syn" version = "1.0.109" @@ -5518,9 +5746,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" +checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020" dependencies = [ "filetime", "libc", @@ -5529,17 +5757,26 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", - "fastrand 2.1.0", + "fastrand 2.1.1", "once_cell", - "rustix 0.38.34", + "rustix 0.38.37", "windows-sys 0.59.0", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "testcontainers" version = "0.16.7" @@ -5588,6 +5825,7 @@ dependencies = [ "duckdb", "futures", "geojson", + "paradedb-sqllogictest", "pgrx", "rstest", "serde", @@ -5606,24 +5844,33 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", "syn 2.0.79", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "thrift" version = "0.17.0" @@ -5742,9 +5989,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -5776,43 +6023,22 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", "winnow", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -5870,9 +6096,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "unescape" @@ -5882,9 +6108,9 @@ checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" @@ -5894,30 +6120,30 @@ checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-properties" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode_categories" @@ -5949,11 +6175,17 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "serde", @@ -6022,19 +6254,20 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -6047,9 +6280,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -6059,9 +6292,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6069,9 +6302,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -6082,15 +6315,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -6098,11 +6331,11 @@ dependencies = [ [[package]] name = "whoami" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ - "redox_syscall 0.4.1", + "redox_syscall", "wasite", ] @@ -6124,11 +6357,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6296,9 +6529,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -6320,7 +6553,7 @@ checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", "linux-raw-sys 0.4.14", - "rustix 0.38.34", + "rustix 0.38.37", ] [[package]] @@ -6353,34 +6586,14 @@ version = "3.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a599daf1b507819c1121f0bf87fa37eb19daac6aff3aefefd4e6e2e0f2020fc" -[[package]] -name = "zerocopy" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" -dependencies = [ - "byteorder", - "zerocopy-derive 0.6.6", -] - [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy-derive" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", + "byteorder", + "zerocopy-derive", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2812ef34..09824976 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "pg_analytics" description = "Postgres for analytics, powered by DuckDB" -version = "0.2.1" -edition = "2021" -license = "AGPL-3.0" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } [lib] crate-type = ["cdylib", "rlib"] @@ -18,20 +18,20 @@ pg17 = ["pgrx/pg17", "supabase-wrappers/pg17"] pg_test = [] [dependencies] -anyhow = "1.0.88" -async-std = { version = "1.13.0", features = ["tokio1", "attributes"] } -chrono = "0.4.38" +anyhow = { workspace = true } +async-std = { workspace = true } +chrono = { workspace = true } duckdb = { git = "https://github.com/paradedb/duckdb-rs.git", features = [ "bundled", "extensions-full", ], rev = "e532dd6" } -pgrx = "0.12.6" +pgrx = { workspace = true } serde_json = "1.0.128" signal-hook = "0.3.17" -sqlparser = "0.50.0" +sqlparser = { workspace = true } strum = { version = "0.26.3", features = ["derive"] } supabase-wrappers = { git = "https://github.com/paradedb/wrappers.git", default-features = false, rev = "f5ecb8d" } -thiserror = "1.0.63" +thiserror = { workspace = true } uuid = "1.10.0" [dev-dependencies] @@ -43,4 +43,26 @@ path = "src/bin/pgrx_embed.rs" [workspace] resolver = "2" -members = ["tests"] +members = ["./", "tests", "tests/sqllogictests"] + +[workspace.package] +version = "0.2.1" +edition = "2021" +license = "AGPL-3.0" + +[workspace.dependencies] +anyhow = "1.0.89" +async-std = { version = "1.13.0", features = ["tokio1", "attributes"] } +thiserror = "1.0.64" +sqlx = { version = "0.7.4", features = [ + "postgres", + "runtime-async-std", + "time", + "bigdecimal", + "uuid", + "chrono", +] } +pgrx = "0.12.5" +chrono = "0.4.19" +datafusion = "37.1.0" +sqlparser = "0.50.0" diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 591e4937..413fc8a0 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "tests" description = "test suite for pg_analytics" -version = "0.2.1" -edition = "2021" -license = "AGPL-3.0" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } [lib] crate-type = ["rlib"] @@ -18,9 +18,9 @@ pg13 = ["pgrx/pg13"] [dependencies] [dev-dependencies] -anyhow = "1.0.88" -async-std = { version = "1.13.0", features = ["tokio1", "attributes"] } -chrono = "0.4.38" +anyhow = { workspace = true } +async-std = { workspace = true } +chrono = { workspace = true } duckdb = { git = "https://github.com/paradedb/duckdb-rs.git", features = [ "bundled", "extensions-full", @@ -41,16 +41,10 @@ futures = "0.3.30" rstest = "0.19.0" serde_arrow = { version = "0.11.7", features = ["arrow-51"] } soa_derive = "0.13.0" -sqlx = { version = "0.7.4", features = [ - "postgres", - "runtime-async-std", - "time", - "bigdecimal", - "uuid", - "chrono", -] } +sqlx = { workspace = true } tempfile = "3.12.0" testcontainers = "0.16.7" testcontainers-modules = { version = "0.4.3", features = ["localstack"] } time = { version = "0.3.36", features = ["serde"] } geojson = "0.24.1" +paradedb-sqllogictest = { path = "./sqllogictests" } diff --git a/tests/sqllogictests/Cargo.toml b/tests/sqllogictests/Cargo.toml new file mode 100644 index 00000000..bfe36716 --- /dev/null +++ b/tests/sqllogictests/Cargo.toml @@ -0,0 +1,38 @@ +[package] +name = "paradedb-sqllogictest" +readme = "README.md" +version = { workspace = true } +edition = { workspace = true } +license = { workspace = true } + +[features] +pg13 = ["pgrx/pg13"] +pg14 = ["pgrx/pg14"] +pg15 = ["pgrx/pg15"] +pg16 = ["pgrx/pg16"] +pg17 = ["pgrx/pg17"] + +[lib] +name = "paradedb_sqllogictest" + +[dependencies] +sqlx = { workspace = true } +async-std = { workspace = true } +thiserror = { workspace = true } +datafusion = { workspace = true } +bytes = "1.7.1" +anyhow = { workspace = true } +pgrx = { workspace = true } +chrono = { workspace = true } +bigdecimal = { version = "0.3.1", features = ["serde"] } +sqllogictest = "0.22.0" +futures = "0.3.30" +log = "0.4.14" +num_cpus = "1.13.0" +sqlparser = { workspace = true } +async-trait = "0.1.83" + +[[test]] +harness = false +name = "sqllogictests" +path = "bin/sqllogictests.rs" diff --git a/tests/sqllogictests/README.md b/tests/sqllogictests/README.md new file mode 100644 index 00000000..cb179634 --- /dev/null +++ b/tests/sqllogictests/README.md @@ -0,0 +1,93 @@ + + +# **ParadeDB SQL Logic Tests** + +This document outlines the `sqllogictests` submodule of the **ParadeDB** project, which provides functionality for validating SQL query behavior using the [sqllogictest](https://www.sqlite.org/sqllogictest/doc/trunk/about.wiki) format. + +## **Overview** + +The `sqllogictests` module leverages [sqllogictest-rs](https://github.com/risinglightdb/sqllogictest-rs) to parse and execute `.slt` files located in the [`test_files`](test_files) directory. These tests ensure correctness of SQL queries by comparing actual outputs against expected results, facilitating cross-engine SQL validation. + +## **Running Tests: Quick Examples** + +Below are example commands for running the sqllogictests with various configurations: + +```shell +# Run all SQL logic tests +cargo test --test sqllogictests +``` + +## **Reference: `.slt` File Format** + +The `.slt` file format was initially developed for SQLite to validate SQL engine behavior. It is designed to be **engine-agnostic**, meaning it can be reused across different SQL engines by ensuring query outputs are consistent with expected results. + +Each `.slt` file operates independently, allowing parallel execution of tests. Typical `.slt` files contain setup commands (e.g., `CREATE TABLE`) followed by queries to test the behavior of the SQL engine. + +### **Format of Query Records** + +```sql +# +query + +---- + +``` + +#### **Explanation of Components** + +- **`test_name`**: Unique identifier for the test case. +- **`type_string`**: A string defining the number and type of result columns. Each character in the string corresponds to a column type: + + - `B`: **Boolean** + - `D`: **Datetime** + - `I`: **Integer** + - `P`: Timestamp (**P**) + - `R`: Floating-point (**R**eal) + - `T`: **Text** + - `?`: Any other type + +- **`sort_mode`**: Optional parameter specifying how results should be sorted. + + - `nosort` (default): Results are presented in the order they are returned by the database engine. Use this only when an `ORDER BY` clause is specified, or the result contains a single row. + - `rowsort`: Rows are sorted lexicographically by their string representation using [sort_unstable](https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable). Note: `"9"` sorts after `"10"`. + - `valuesort`: Each value is sorted independently, disregarding row groupings. + +- **`expected_result`**: The output expected from the SQL engine. + - Floating-point values are rounded to 12 decimal places. + - `NULL` values are represented as `NULL`. + - Empty strings are rendered as `(empty)`. + - Boolean values appear as `true` or `false`. + +> :warning: It is recommended to either **use `ORDER BY`** or apply `rowsort` when queries do not specify an explicit order. + +--- + +## **Example Test Case** + +```sql +# group_by_distinct +query TTI +SELECT a, b, COUNT(DISTINCT c) FROM my_table GROUP BY a, b ORDER BY a, b; +---- +foo bar 10 +foo baz 5 +foo 4 + 3 +``` + +--- + +This technical documentation provides the necessary guidelines for configuring, running, and extending the SQL logic tests in the `ParadeDB` project. For more details on value conversions, consult the conversion rules defined in [`/sqllogictests/src/conversion.rs`]. diff --git a/tests/sqllogictests/bin/sqllogictests.rs b/tests/sqllogictests/bin/sqllogictests.rs new file mode 100644 index 00000000..14d693c8 --- /dev/null +++ b/tests/sqllogictests/bin/sqllogictests.rs @@ -0,0 +1,175 @@ +// Copyright (c) 2023-2024 Retake, Inc. +// +// This file is part of ParadeDB - Postgres for Search and Analytics +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +use std::{ + ffi::OsStr, + fs, + path::{Path, PathBuf}, +}; + +use anyhow::Result; +use async_std::task::block_on; +use datafusion::common::runtime::SpawnedTask; +use futures::StreamExt; +use log::info; + +use paradedb_sqllogictest::engine::Db; +use sqllogictest::strict_column_validator; + +const TEST_DIRECTORY: &str = "test_files/"; + +pub fn main() -> Result<()> { + block_on(run_tests()) +} + +async fn run_tests() -> Result<()> { + // Run all tests in parallel, reporting failures at the end + let errors: Vec<_> = futures::stream::iter(read_test_files()?) + .map(|test_file| { + SpawnedTask::spawn(async move { + println!("Running {:?}", test_file.relative_path); + run_test_file(test_file).await?; + Ok(()) as Result<()> + }) + .join() + }) + // run up to num_cpus streams in parallel + .buffer_unordered(num_cpus::get()) + .flat_map(|result| { + // Filter out any Ok() leaving only the DataFusionErrors + futures::stream::iter(match result { + // Tokio panic error + Err(e) => Some(anyhow::anyhow!("{e}")), + Ok(thread_result) => match thread_result { + // Test run error + Err(e) => Some(e), + // success + Ok(_) => None, + }, + }) + }) + .collect() + .await; + + // report on any errors + if !errors.is_empty() { + for e in &errors { + println!("{e}"); + } + anyhow::bail!("{} errors occurred", errors.len()); + } else { + Ok(()) + } +} + +fn read_test_files<'a>() -> Result + 'a>> { + Ok(Box::new( + read_dir_recursive(TEST_DIRECTORY)? + .into_iter() + .map(TestFile::new) + .filter(|f| f.is_slt_file()), + )) +} + +fn read_dir_recursive>(path: P) -> Result> { + let mut dst = vec![]; + read_dir_recursive_impl(&mut dst, path.as_ref())?; + Ok(dst) +} + +/// Append all paths recursively to dst +fn read_dir_recursive_impl(dst: &mut Vec, path: &Path) -> Result<()> { + let entries = std::fs::read_dir(path) + .map_err(|e| anyhow::anyhow!("Error reading directory {path:?}: {e}"))?; + for entry in entries { + let path = entry + .map_err(|e| anyhow::anyhow!("Error reading entry in directory {path:?}: {e}"))? + .path(); + + if path.is_dir() { + read_dir_recursive_impl(dst, &path)?; + } else { + dst.push(path); + } + } + + Ok(()) +} + +async fn run_test_file(test_file: TestFile) -> Result<()> { + let TestFile { + path, + relative_path, + } = test_file; + info!("Running with ParadeDB runner: {}", path.display()); + + setup_scratch_dir(&relative_path)?; + let mut runner = sqllogictest::Runner::new(|| async { Ok(Db::new().await) }); + + runner.with_column_validator(strict_column_validator); + + runner + .run_file_async(path) + .await + .map_err(|e| anyhow::anyhow!("Error running test file: {}", e)) +} + +/// Represents a parsed test file +#[derive(Debug)] +struct TestFile { + /// The absolute path to the file + pub path: PathBuf, + /// The relative path of the file (used for display) + pub relative_path: PathBuf, +} + +impl TestFile { + fn new(path: PathBuf) -> Self { + let relative_path = PathBuf::from( + path.to_string_lossy() + .strip_prefix(TEST_DIRECTORY) + .unwrap_or(""), + ); + + Self { + path, + relative_path, + } + } + + fn is_slt_file(&self) -> bool { + self.path.extension() == Some(OsStr::new("slt")) + } +} + +/// Sets up an empty directory at test_files/scratch/ +/// creating it if needed and clearing any file contents if it exists +/// This allows tests for inserting to external tables or copy to +/// to persist data to disk and have consistent state when running +/// a new test +fn setup_scratch_dir(name: &Path) -> Result<()> { + // go from copy.slt --> copy + let file_stem = name.file_stem().expect("File should have a stem"); + let path = PathBuf::from("test_files").join("scratch").join(file_stem); + + info!("Creating scratch dir in {path:?}"); + if path.exists() { + fs::remove_dir_all(&path)?; + } + fs::create_dir_all(&path)?; + Ok(()) +} diff --git a/tests/sqllogictests/src/arrow.rs b/tests/sqllogictests/src/arrow.rs new file mode 100644 index 00000000..d56ea36e --- /dev/null +++ b/tests/sqllogictests/src/arrow.rs @@ -0,0 +1,301 @@ +// Copyright (c) 2023-2024 Retake, Inc. +// +// This file is part of ParadeDB - Postgres for Search and Analytics +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +use std::sync::Arc; + +use anyhow::{bail, Result}; +use bigdecimal::{BigDecimal, ToPrimitive}; +use chrono::{NaiveDate, NaiveDateTime, NaiveTime, Timelike}; +use datafusion::arrow::array::*; +use datafusion::arrow::datatypes::{DataType, Field, SchemaRef, TimeUnit}; +use datafusion::arrow::record_batch::RecordBatch; +use pgrx::pg_sys::InvalidOid; +use pgrx::PgBuiltInOids; +use sqlx::postgres::PgRow; +use sqlx::{Postgres, Row, TypeInfo, ValueRef}; + +fn valid(data_type: &DataType, oid: u32) -> bool { + let oid = match PgBuiltInOids::from_u32(oid) { + Ok(oid) => oid, + _ => return false, + }; + match data_type { + DataType::Null => false, + DataType::Boolean => matches!(oid, PgBuiltInOids::BOOLOID), + DataType::Int8 => matches!(oid, PgBuiltInOids::INT2OID), + DataType::Int16 => matches!(oid, PgBuiltInOids::INT2OID), + DataType::Int32 => matches!(oid, PgBuiltInOids::INT4OID), + DataType::Int64 => matches!(oid, PgBuiltInOids::INT8OID), + DataType::UInt8 => matches!(oid, PgBuiltInOids::INT2OID), + DataType::UInt16 => matches!(oid, PgBuiltInOids::INT4OID), + DataType::UInt32 => matches!(oid, PgBuiltInOids::INT8OID), + DataType::UInt64 => matches!(oid, PgBuiltInOids::NUMERICOID), + DataType::Float16 => false, // Not supported yet. + DataType::Float32 => matches!(oid, PgBuiltInOids::FLOAT4OID), + DataType::Float64 => matches!(oid, PgBuiltInOids::FLOAT8OID), + DataType::Timestamp(_, _) => matches!(oid, PgBuiltInOids::TIMESTAMPOID), + DataType::Date32 => matches!(oid, PgBuiltInOids::DATEOID), + DataType::Date64 => matches!(oid, PgBuiltInOids::DATEOID), + DataType::Time32(_) => matches!(oid, PgBuiltInOids::TIMEOID), + DataType::Time64(_) => matches!(oid, PgBuiltInOids::TIMEOID), + DataType::Duration(_) => false, // Not supported yet. + DataType::Interval(_) => false, // Not supported yet. + DataType::Binary => matches!(oid, PgBuiltInOids::BYTEAOID), + DataType::FixedSizeBinary(_) => false, // Not supported yet. + DataType::LargeBinary => matches!(oid, PgBuiltInOids::BYTEAOID), + DataType::BinaryView => matches!(oid, PgBuiltInOids::BYTEAOID), + DataType::Utf8 => matches!(oid, PgBuiltInOids::TEXTOID), + DataType::LargeUtf8 => matches!(oid, PgBuiltInOids::TEXTOID), + // Remaining types are not supported yet. + DataType::Utf8View => false, + DataType::List(_) => false, + DataType::ListView(_) => false, + DataType::FixedSizeList(_, _) => false, + DataType::LargeList(_) => false, + DataType::LargeListView(_) => false, + DataType::Struct(_) => false, + DataType::Union(_, _) => false, + DataType::Dictionary(_, _) => false, + DataType::Decimal128(_, _) => false, + DataType::Decimal256(_, _) => false, + DataType::Map(_, _) => false, + DataType::RunEndEncoded(_, _) => false, + } +} + +fn decode<'r, T: sqlx::Decode<'r, Postgres> + sqlx::Type>( + field: &Field, + row: &'r PgRow, +) -> Result { + let field_name = field.name(); + let field_type = field.data_type(); + + let col = row.try_get_raw(field.name().as_str())?; + let info = col.type_info(); + let oid = info.oid().map(|o| o.0).unwrap_or(InvalidOid.into()); + if !valid(field_type, oid) { + bail!( + "field '{}' has arrow type '{}', which cannot be read from postgres type '{}'", + field.name(), + field.data_type(), + info.name() + ) + } + + Ok(row.try_get(field_name.as_str())?) +} + +pub fn schema_to_batch(schema: &SchemaRef, rows: &[PgRow]) -> Result { + let unix_epoch = NaiveDate::from_ymd_opt(1970, 1, 1).unwrap(); + let arrays = schema + .fields() + .into_iter() + .map(|field| { + Ok(match field.data_type() { + DataType::Boolean => Arc::new(BooleanArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .collect::>>()?, + )) as ArrayRef, + DataType::Int8 => Arc::new(Int8Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| row.map(|o| o.map(|n| n as i8))) + .collect::>>()?, + )) as ArrayRef, + DataType::Int16 => Arc::new(Int16Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .collect::>>()?, + )) as ArrayRef, + DataType::Int32 => Arc::new(Int32Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .collect::>>()?, + )) as ArrayRef, + DataType::Int64 => Arc::new(Int64Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .collect::>>()?, + )) as ArrayRef, + DataType::UInt8 => Arc::new(UInt8Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| row.map(|o| o.map(|n| n as u8))) + .collect::>>()?, + )) as ArrayRef, + DataType::UInt16 => Arc::new(UInt16Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| row.map(|o| o.map(|n| n as u16))) + .collect::>>()?, + )) as ArrayRef, + DataType::UInt32 => Arc::new(UInt32Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| row.map(|o| o.map(|n| n as u32))) + .collect::>>()?, + )) as ArrayRef, + DataType::UInt64 => Arc::new(UInt64Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| row.map(|o| o.and_then(|n| n.to_u64()))) + .collect::>>()?, + )) as ArrayRef, + DataType::Float32 => Arc::new(Float32Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .collect::>>()?, + )) as ArrayRef, + DataType::Float64 => Arc::new(Float64Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .collect::>>()?, + )) as ArrayRef, + DataType::Timestamp(unit, _) => match unit { + TimeUnit::Second => Arc::new(TimestampSecondArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| row.map(|o| o.map(|n| n.and_utc().timestamp()))) + .collect::>>()?, + )) as ArrayRef, + TimeUnit::Millisecond => Arc::new(TimestampMillisecondArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| row.map(|o| o.map(|n| n.and_utc().timestamp_millis()))) + .collect::>>()?, + )) as ArrayRef, + TimeUnit::Microsecond => Arc::new(TimestampMicrosecondArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| row.map(|o| o.map(|n| n.and_utc().timestamp_micros()))) + .collect::>>()?, + )) as ArrayRef, + TimeUnit::Nanosecond => Arc::new(TimestampNanosecondArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| { + row.map(|o| o.and_then(|n| n.and_utc().timestamp_nanos_opt())) + }) + .collect::>>()?, + )) as ArrayRef, + }, + DataType::Date32 => Arc::new(Date32Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| { + row.map(|o| { + o.map(|n| n.signed_duration_since(unix_epoch).num_days() as i32) + }) + }) + .collect::>>()?, + )) as ArrayRef, + DataType::Date64 => Arc::new(Date64Array::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| { + row.map(|o| { + o.map(|n| n.signed_duration_since(unix_epoch).num_milliseconds()) + }) + }) + .collect::>>()?, + )) as ArrayRef, + DataType::Time32(unit) => match unit { + TimeUnit::Second => Arc::new(Time32SecondArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| row.map(|o| o.map(|n| n.num_seconds_from_midnight() as i32))) + .collect::>>()?, + )) as ArrayRef, + TimeUnit::Millisecond => Arc::new(Time32MillisecondArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| { + row.map(|o| { + o.map(|n| { + (n.num_seconds_from_midnight() * 1000 + + (n.nanosecond() / 1_000_000)) + as i32 + }) + }) + }) + .collect::>>()?, + )) as ArrayRef, + TimeUnit::Microsecond => bail!("arrow time32 does not support microseconds"), + TimeUnit::Nanosecond => bail!("arrow time32 does not support nanoseconds"), + }, + DataType::Time64(unit) => match unit { + TimeUnit::Second => bail!("arrow time64i does not support seconds"), + TimeUnit::Millisecond => bail!("arrow time64 does not support milliseconds"), + TimeUnit::Microsecond => Arc::new(Time64MicrosecondArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| { + row.map(|o| { + o.map(|n| { + (n.num_seconds_from_midnight() * 1_000_000 + + (n.nanosecond() / 1_000)) + as i64 + }) + }) + }) + .collect::>>()?, + )) as ArrayRef, + TimeUnit::Nanosecond => Arc::new(Time64NanosecondArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .map(|row| { + row.map(|o| { + o.map(|n| { + (n.num_seconds_from_midnight() as u64 * 1_000_000_000 + + (n.nanosecond() as u64)) + .try_into() + .ok() + .unwrap_or(i64::MAX) + }) + }) + }) + .collect::>>()?, + )) as ArrayRef, + }, + DataType::Binary => Arc::new(BinaryArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .collect::>>()?, + )) as ArrayRef, + DataType::LargeBinary => Arc::new(LargeBinaryArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .collect::>>()?, + )) as ArrayRef, + DataType::Utf8 => Arc::new(StringArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .collect::>>()?, + )) as ArrayRef, + DataType::LargeUtf8 => Arc::new(LargeStringArray::from( + rows.iter() + .map(|row| decode::>(field, row)) + .collect::>>()?, + )) as ArrayRef, + _ => bail!("cannot read into arrow type '{}'", field.data_type()), + }) + }) + .collect::>>()?; + + Ok(RecordBatch::try_new(schema.clone(), arrays)?) +} diff --git a/tests/sqllogictests/src/conversion.rs b/tests/sqllogictests/src/conversion.rs new file mode 100644 index 00000000..51475638 --- /dev/null +++ b/tests/sqllogictests/src/conversion.rs @@ -0,0 +1,70 @@ +// Copyright (c) 2023-2024 Retake, Inc. +// +// This file is part of ParadeDB - Postgres for Search and Analytics +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +use bigdecimal::BigDecimal; +use std::str::FromStr; + +/// Represents a constant for NULL string in your database. +pub const NULL_STR: &str = "NULL"; + +pub(crate) fn bool_to_str(value: bool) -> String { + if value { + "true".to_string() + } else { + "false".to_string() + } +} + +pub(crate) fn varchar_to_str(value: &str) -> String { + if value.is_empty() { + "(empty)".to_string() + } else { + value.trim_end_matches('\n').to_string() + } +} + +pub(crate) fn f32_to_str(value: f32) -> String { + if value.is_nan() { + // The sign of NaN can be different depending on platform. + // So the string representation of NaN ignores the sign. + "NaN".to_string() + } else if value == f32::INFINITY { + "Infinity".to_string() + } else if value == f32::NEG_INFINITY { + "-Infinity".to_string() + } else { + big_decimal_to_str(BigDecimal::from_str(&value.to_string()).unwrap()) + } +} + +pub(crate) fn f64_to_str(value: f64) -> String { + if value.is_nan() { + // The sign of NaN can be different depending on platform. + // So the string representation of NaN ignores the sign. + "NaN".to_string() + } else if value == f64::INFINITY { + "Infinity".to_string() + } else if value == f64::NEG_INFINITY { + "-Infinity".to_string() + } else { + big_decimal_to_str(BigDecimal::from_str(&value.to_string()).unwrap()) + } +} + +pub(crate) fn big_decimal_to_str(value: BigDecimal) -> String { + value.round(12).normalized().to_string() +} diff --git a/tests/tests/fixtures/db.rs b/tests/sqllogictests/src/engine.rs similarity index 82% rename from tests/tests/fixtures/db.rs rename to tests/sqllogictests/src/engine.rs index 91a38736..c104c694 100644 --- a/tests/tests/fixtures/db.rs +++ b/tests/sqllogictests/src/engine.rs @@ -1,5 +1,3 @@ -#![allow(dead_code)] - // Copyright (c) 2023-2024 Retake, Inc. // // This file is part of ParadeDB - Postgres for Search and Analytics @@ -17,16 +15,20 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -// TECH DEBT: This file is a copy of the `db.rs` file from https://github.com/paradedb/paradedb/blob/dev/tests/src/fixtures/db.rs +// TECH DEBT: This file is a copy of the `db.rs` file from https://github.com/paradedb/paradedb/blob/dev/shared/src/fixtures/db.rs // We duplicated because the paradedb repo may use a different version of pgrx than pg_analytics, but eventually we should // move this into a separate crate without any dependencies on pgrx. -use super::arrow::schema_to_batch; +use crate::normalize::convert_rows; +use crate::normalize::convert_types; use async_std::prelude::Stream; use async_std::stream::StreamExt; use async_std::task::block_on; +use async_trait::async_trait; use bytes::Bytes; use datafusion::arrow::{datatypes::SchemaRef, record_batch::RecordBatch}; +use sqllogictest::DBOutput; +use sqlx::Row; use sqlx::{ postgres::PgRow, testing::{TestArgs, TestContext, TestSupport}, @@ -34,6 +36,12 @@ use sqlx::{ }; use std::time::{SystemTime, UNIX_EPOCH}; +use crate::error::{Result, SqlLogicTestError}; +use crate::{ + arrow::schema_to_batch, + output::{DFColumnType, DFOutput}, +}; + pub struct Db { context: TestContext, } @@ -109,6 +117,13 @@ where }) } + fn fetch_dynamic_result( + self, + connection: &mut PgConnection, + ) -> Result, sqlx::Error> { + block_on(async { sqlx::query(self.as_ref()).fetch_all(connection).await }) + } + /// A convenient helper for processing PgRow results from Postgres into a DataFusion RecordBatch. /// It's important to note that the retrieved RecordBatch may not necessarily have the same /// column order as your Postgres table, or parquet file in a foreign table. @@ -196,3 +211,35 @@ pub trait DisplayAsync: Stream> + Sized { } impl DisplayAsync for T where T: Stream> + Send + Sized {} + +#[async_trait] +impl sqllogictest::AsyncDB for Db { + type Error = SqlLogicTestError; + type ColumnType = DFColumnType; + + async fn run(&mut self, sql: &str) -> Result, Self::Error> { + let mut conn = self.connection().await; + run_query(sql, &mut conn).await + } + + fn engine_name(&self) -> &str { + "ParadeDB" + } +} + +async fn run_query(sql: impl Into + Query, conn: &mut PgConnection) -> Result { + let results: Vec = sql.fetch_dynamic_result(conn)?; + + let rows = convert_rows(&results); + let types = if rows.is_empty() { + vec![] + } else { + convert_types(results[0].columns()) + }; + + if rows.is_empty() && types.is_empty() { + Ok(DBOutput::StatementComplete(0)) + } else { + Ok(DBOutput::Rows { types, rows }) + } +} diff --git a/tests/sqllogictests/src/error.rs b/tests/sqllogictests/src/error.rs new file mode 100644 index 00000000..b98444b6 --- /dev/null +++ b/tests/sqllogictests/src/error.rs @@ -0,0 +1,49 @@ +// Copyright (c) 2023-2024 Retake, Inc. +// +// This file is part of ParadeDB - Postgres for Search and Analytics +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +use datafusion::arrow::error::ArrowError; +use sqllogictest::TestError; +use sqlparser::parser::ParserError; +use thiserror::Error; + +pub type Result = std::result::Result; + +/// ParadeDB sql-logicaltest error +#[derive(Debug, Error)] +pub enum SqlLogicTestError { + /// Error from sqlx + #[error("Postgres error(from sqlx crate): {0}")] + Sqlx(#[from] sqlx::Error), + /// Error from sqllogictest-rs + #[error("SqlLogicTest error(from sqllogictest-rs crate): {0}")] + SqlLogicTest(#[from] TestError), + /// Error returned when SQL is syntactically incorrect. + #[error("SQL Parser error: {0}")] + Sql(#[from] ParserError), + /// Error from arrow-rs + #[error("Arrow error: {0}")] + Arrow(#[from] ArrowError), + /// Generic error + #[error("Other Error: {0}")] + Other(String), +} + +impl From for SqlLogicTestError { + fn from(value: String) -> Self { + SqlLogicTestError::Other(value) + } +} diff --git a/tests/sqllogictests/src/lib.rs b/tests/sqllogictests/src/lib.rs new file mode 100644 index 00000000..fa96f224 --- /dev/null +++ b/tests/sqllogictests/src/lib.rs @@ -0,0 +1,6 @@ +pub mod arrow; +mod conversion; +pub mod engine; +mod error; +mod normalize; +mod output; diff --git a/tests/sqllogictests/src/normalize.rs b/tests/sqllogictests/src/normalize.rs new file mode 100644 index 00000000..cfd614d6 --- /dev/null +++ b/tests/sqllogictests/src/normalize.rs @@ -0,0 +1,93 @@ +// Copyright (c) 2023-2024 Retake, Inc. +// +// This file is part of ParadeDB - Postgres for Search and Analytics +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +use crate::conversion::{ + big_decimal_to_str, bool_to_str, f32_to_str, f64_to_str, varchar_to_str, NULL_STR, +}; +use crate::output::DFColumnType; +use bigdecimal::BigDecimal; +use chrono::NaiveDateTime; +use sqlx::postgres::{PgColumn, PgRow}; +use sqlx::TypeInfo; +use sqlx::{Column, Row}; + +pub(crate) fn convert_rows(rows: &[PgRow]) -> Vec> { + rows.iter() + .map(|row| { + row.columns() + .iter() + .enumerate() + .map(|(idx, column)| cell_to_string(row, column, idx)) + .collect::>() + }) + .collect::>() +} + +macro_rules! make_string { + ($row:ident, $idx:ident, $t:ty) => {{ + let value: Option<$t> = $row.get($idx); + match value { + Some(value) => value.to_string(), + None => NULL_STR.to_string(), + } + }}; + ($row:ident, $idx:ident, $t:ty, $convert:ident) => {{ + let value: Option<$t> = $row.get($idx); + match value { + Some(value) => $convert(value).to_string(), + None => NULL_STR.to_string(), + } + }}; +} + +fn cell_to_string(row: &PgRow, column: &PgColumn, idx: usize) -> String { + match column.type_info().name() { + "CHAR" => make_string!(row, idx, i8), + "BOOL" => make_string!(row, idx, bool, bool_to_str), + "INT2" => make_string!(row, idx, i16), + "INT4" => make_string!(row, idx, i32), + "INT8" => make_string!(row, idx, i64), + "FLOAT4" => make_string!(row, idx, f32, f32_to_str), + "FLOAT8" => make_string!(row, idx, f64, f64_to_str), + "NUMERIC" => make_string!(row, idx, BigDecimal, big_decimal_to_str), + "BPCHAR" | "VARCHAR" | "TEXT" => make_string!(row, idx, &str, varchar_to_str), + "DATE" => make_string!(row, idx, chrono::NaiveDate), + "TIME" => make_string!(row, idx, chrono::NaiveTime), + "TIMESTAMP" => { + let value: Option = row.get(idx); + value + .map(|d| format!("{d:?}")) + .unwrap_or_else(|| "NULL".to_string()) + } + name => unimplemented!("Unsupported type: {}", name), + } +} + +pub(crate) fn convert_types(columns: &[PgColumn]) -> Vec { + columns + .iter() + .map(|t| match t.type_info().name() { + "BOOL" => DFColumnType::Boolean, + "INT2" | "INT4" | "INT8" => DFColumnType::Integer, + "BPCHAR" | "VARCHAR" | "TEXT" => DFColumnType::Text, + "FLOAT4" | "FLOAT8" | "NUMERIC" => DFColumnType::Float, + "DATE" | "TIME" => DFColumnType::DateTime, + "TIMESTAMP" => DFColumnType::Timestamp, + _ => DFColumnType::Another, + }) + .collect() +} diff --git a/tests/sqllogictests/src/output.rs b/tests/sqllogictests/src/output.rs new file mode 100644 index 00000000..16b445f1 --- /dev/null +++ b/tests/sqllogictests/src/output.rs @@ -0,0 +1,57 @@ +// Copyright (c) 2023-2024 Retake, Inc. +// +// This file is part of ParadeDB - Postgres for Search and Analytics +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +use sqllogictest::{ColumnType, DBOutput}; + +#[derive(Debug, PartialEq, Eq, Clone)] +pub enum DFColumnType { + Boolean, + DateTime, + Integer, + Float, + Text, + Timestamp, + Another, +} + +impl ColumnType for DFColumnType { + fn from_char(value: char) -> Option { + match value { + 'B' => Some(Self::Boolean), + 'D' => Some(Self::DateTime), + 'I' => Some(Self::Integer), + 'P' => Some(Self::Timestamp), + 'R' => Some(Self::Float), + 'T' => Some(Self::Text), + _ => Some(Self::Another), + } + } + + fn to_char(&self) -> char { + match self { + Self::Boolean => 'B', + Self::DateTime => 'D', + Self::Integer => 'I', + Self::Timestamp => 'P', + Self::Float => 'R', + Self::Text => 'T', + Self::Another => '?', + } + } +} + +pub(crate) type DFOutput = DBOutput; diff --git a/tests/sqllogictests/test_files/explain.slt b/tests/sqllogictests/test_files/explain.slt new file mode 100644 index 00000000..53c6c7c4 --- /dev/null +++ b/tests/sqllogictests/test_files/explain.slt @@ -0,0 +1,162 @@ +# Copyright (c) 2023-2024 Retake, Inc. +# +# This file is part of ParadeDB - Postgres for Search and Analytics +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +####### +# Load the pg_analytics extension +####### +statement ok +DROP EXTENSION IF EXISTS pg_analytics CASCADE; + +statement ok +CREATE EXTENSION pg_analytics; + +####### +# Setup test data table +####### +statement ok +CREATE TABLE nyc_trips ( + "VendorID" INT, + "tpep_pickup_datetime" TIMESTAMP, + "tpep_dropoff_datetime" TIMESTAMP, + "passenger_count" BIGINT, + "trip_distance" DOUBLE PRECISION, + "RatecodeID" DOUBLE PRECISION, + "store_and_fwd_flag" TEXT, + "PULocationID" REAL, + "DOLocationID" REAL, + "payment_type" DOUBLE PRECISION, + "fare_amount" DOUBLE PRECISION, + "extra" DOUBLE PRECISION, + "mta_tax" DOUBLE PRECISION, + "tip_amount" DOUBLE PRECISION, + "tolls_amount" DOUBLE PRECISION, + "improvement_surcharge" DOUBLE PRECISION, + "total_amount" DOUBLE PRECISION +); + +statement ok +INSERT INTO nyc_trips ("VendorID", tpep_pickup_datetime, tpep_dropoff_datetime, passenger_count, trip_distance, "RatecodeID", store_and_fwd_flag, "PULocationID", "DOLocationID", payment_type, fare_amount, extra, mta_tax, tip_amount, tolls_amount, improvement_surcharge, total_amount) +VALUES +(2, '2024-01-24 15:17:12', '2024-01-24 15:34:53', 1, 3.33, 1, 'N', 239, 246, 1, 20.5, 0, 0.5, 3, 0, 1, 27.5), +(2, '2024-01-24 15:52:24', '2024-01-24 16:01:39', 1, 1.61, 1, 'N', 234, 249, 1, 10.7, 0, 0.5, 3.67, 0, 1, 18.37), +(2, '2024-01-24 15:08:55', '2024-01-24 15:31:35', 1, 4.38, 1, 'N', 88, 211, 1, 25.4, 0, 0.5, 5.88, 0, 1, 35.28), +(2, '2024-01-24 15:42:55', '2024-01-24 15:51:35', 1, 0.95, 1, 'N', 211, 234, 1, 9.3, 0, 0.5, 2.66, 0, 1, 15.96), +(2, '2024-01-24 15:52:23', '2024-01-24 16:12:53', 1, 2.58, 1, 'N', 68, 144, 1, 18.4, 0, 0.5, 4.48, 0, 1, 26.88), +(1, '2024-01-24 15:30:55', '2024-01-24 16:38:46', 1, 15.8, 2, 'N', 164, 132, 1, 70, 2.5, 0.5, 10, 6.94, 1, 90.94), +(2, '2024-01-24 15:21:48', '2024-01-24 15:59:06', 2, 7.69, 1, 'N', 231, 161, 1, 40.8, 0, 0.5, 6.5, 0, 1, 51.3), +(2, '2024-01-24 15:47:59', '2024-01-24 16:12:38', 1, 8.31, 1, 'N', 138, 262, 1, 35.2, 5, 0.5, 10, 6.94, 1, 62.89), +(2, '2024-01-24 15:55:32', '2024-01-24 16:23:01', 1, 8.47, 1, 'N', 132, 192, 2, 36.6, 0, 0.5, 0, 0, 1, 39.85), +(1, '2024-01-24 15:02:22', '2024-01-24 15:13:11', 1, 1.4, 1, 'N', 226, 7, 2, 11.4, 0, 0.5, 0, 0, 1, 12.9), +(1, '2024-01-24 15:49:04', '2024-01-24 15:55:15', 1, 0.9, 1, 'N', 43, 237, 1, 7.9, 5, 0.5, 2.85, 0, 1, 17.25), +(2, '2024-01-24 15:10:53', '2024-01-24 15:20:45', 1, 0.55, 1, 'N', 237, 237, 1, 10, 0, 0.5, 2.8, 0, 1, 16.8), +(1, '2024-01-24 15:09:28', '2024-01-24 16:21:23', 1, 16.2, 5, 'N', 230, 132, 1, 86.55, 0, 0, 17.5, 0, 1, 105.05), +(2, '2024-01-24 15:14:11', '2024-01-24 15:27:17', 1, 0.74, 1, 'N', 236, 237, 2, 12.1, 0, 0.5, 0, 0, 1, 16.1), +(2, '2024-01-24 15:56:34', '2024-01-24 16:27:32', 1, 3.79, 1, 'N', 230, 144, 1, 27.5, 0, 0.5, 7.88, 0, 1, 39.38), +(2, '2024-01-24 15:31:32', '2024-01-24 15:46:48', 2, 1.9, 1, 'N', 246, 161, 1, 14.9, 0, 0.5, 3.78, 0, 1, 22.68), +(2, '2024-01-24 15:50:45', '2024-01-24 16:22:14', 1, 6.82, 1, 'N', 162, 261, 1, 33.8, 0, 0.5, 3.78, 0, 1, 41.58), +(2, '2024-01-24 15:54:18', '2024-01-24 16:24:41', 1, 8.26, 1, 'N', 138, 262, 1, 37.3, 5, 0.5, 10.65, 6.94, 1, 65.64), +(2, '2024-01-24 15:11:02', '2024-01-24 15:33:35', 1, 1.6, 1, 'N', 162, 263, 1, 19.1, 0, 0.5, 4.62, 0, 1, 27.72), +(2, '2024-01-24 15:20:01', '2024-01-24 15:34:38', 2, 1.79, 1, 'N', 68, 163, 2, 14.2, 0, 0.5, 0, 0, 1, 18.2), +(2, '2024-01-24 15:50:36', '2024-01-24 15:59:20', 1, 0.58, 1, 'N', 162, 229, 1, 9.3, 0, 0.5, 3.33, 0, 1, 16.63), +(1, '2024-01-24 15:04:08', '2024-01-24 15:23:57', 1, 2, 1, 'N', 246, 161, 1, 14.9, 2.5, 0.5, 1, 0, 1, 19.9), +(1, '2024-01-24 15:25:27', '2024-01-24 15:37:29', 1, 1.6, 1, 'N', 161, 233, 1, 10.7, 2.5, 0.5, 3.65, 0, 1, 18.35), +(1, '2024-01-24 15:40:53', '2024-01-24 15:45:56', 1, 1.1, 1, 'Y', 233, 162, 1, 7.2, 2.5, 0.5, 2.24, 0, 1, 13.44), +(1, '2024-01-24 15:56:09', '2024-01-24 16:05:35', 1, 1.6, 1, 'N', 237, 239, 1, 10, 2.5, 0.5, 4.2, 0, 1, 18.2), +(2, '2024-01-24 15:03:07', '2024-01-24 15:21:19', 2, 5.73, 5, 'N', 180, 132, 1, 84, 0, 0, 17, 0, 1, 102), +(2, '2024-01-24 16:02:45', '2024-01-24 16:11:52', 1, 1.1, 1, 'N', 263, 141, 1, 10, 0, 0.5, 2.1, 0, 1, 16.1), +(2, '2024-01-24 15:19:51', '2024-01-24 15:30:56', 1, 0.77, 1, 'N', 162, 161, 1, 10.7, 0, 0.5, 2.94, 0, 1, 17.64), +(2, '2024-01-24 15:32:10', '2024-01-24 15:39:06', 1, 0.85, 1, 'N', 161, 170, 1, 7.9, 0, 0.5, 2.98, 0, 1, 14.88), +(2, '2024-01-24 15:44:04', '2024-01-24 15:56:43', 2, 1.07, 1, 'N', 170, 163, 1, 12.1, 0, 0.5, 3.22, 0, 1, 19.32), +(2, '2024-01-24 15:57:39', '2024-01-24 16:02:55', 1, 0.54, 1, 'N', 161, 237, 1, 6.5, 0, 0.5, 2.1, 0, 1, 12.6), +(1, '2024-01-24 15:04:50', '2024-01-24 15:25:58', 2, 2.9, 1, 'N', 161, 246, 1, 21.9, 2.5, 0.5, 5.15, 0, 1, 31.05), +(2, '2024-01-24 15:27:35', '2024-01-24 15:50:28', 1, 2.11, 1, 'N', 164, 79, 1, 20.5, 0, 0.5, 4.9, 0, 1, 29.4), +(2, '2024-01-24 15:13:53', '2024-01-24 15:55:09', 3, 5.62, 1, 'N', 161, 261, 1, 38, 0, 0.5, 8.4, 0, 1, 50.4), +(1, '2024-01-24 15:29:37', '2024-01-24 15:50:25', 1, 2.2, 1, 'N', 237, 230, 1, 18.4, 2.5, 0.5, 5.55, 0, 1, 27.95), +(1, '2024-01-24 15:34:29', '2024-01-24 15:45:41', 1, 2, 1, 'N', 142, 151, 1, 12.1, 2.5, 0.5, 3.22, 0, 1, 19.32), +(1, '2024-01-24 15:54:16', '2024-01-24 16:04:40', 2, 1.6, 1, 'N', 238, 143, 1, 10.7, 5, 0.5, 3.4, 0, 1, 20.6), +(2, '2024-01-24 15:05:20', '2024-01-24 15:16:38', 1, 1.27, 1, 'N', 142, 230, 2, 11.4, 0, 0.5, 0, 0, 1, 15.4), +(2, '2024-01-24 15:21:05', '2024-01-24 16:36:49', 1, 7.49, 1, 'N', 163, 181, 1, 61.8, 0, 0.5, 21.82, 6.94, 1, 94.56), +(2, '2024-01-24 15:13:19', '2024-01-24 15:28:32', 1, 2.51, 1, 'N', 143, 236, 1, 16.3, 0, 0.5, 4.06, 0, 1, 24.36), +(2, '2024-01-24 15:38:01', '2024-01-24 15:49:52', 1, 1.83, 1, 'N', 239, 262, 1, 12.8, 0, 0.5, 4.2, 0, 1, 21), +(2, '2024-01-24 15:09:19', '2024-01-24 15:26:41', 1, 2.42, 1, 'N', 238, 237, 1, 17, 0, 0.5, 4.2, 0, 1, 25.2), +(2, '2024-01-24 15:30:22', '2024-01-24 15:45:27', 1, 2.25, 1, 'N', 237, 233, 1, 15.6, 0, 0.5, 3.92, 0, 1, 23.52), +(1, '2024-01-24 15:57:50', '2024-01-24 16:45:02', 0, 15, 1, 'N', 138, 265, 2, 60.4, 9.25, 0.5, 0, 6.94, 1, 78.09), +(2, '2024-01-24 15:41:46', '2024-01-24 15:50:08', 1, 0.8, 1, 'N', 161, 100, 1, 8.6, 0, 0.5, 2.52, 0, 1, 15.12), +(2, '2024-01-24 15:54:22', '2024-01-24 15:59:06', 1, 0.5, 1, 'N', 100, 164, 2, 6.5, 0, 0.5, 0, 0, 1, 10.5), +(2, '2024-01-24 15:25:27', '2024-01-24 15:34:11', 2, 1.09, 1, 'N', 164, 234, 1, 9.3, 0, 0.5, 3.99, 0, 1, 17.29), +(2, '2024-01-24 15:14:18', '2024-01-24 15:22:17', 1, 0.78, 1, 'N', 234, 249, 1, 8.6, 0, 0.5, 2.52, 0, 1, 15.12), +(2, '2024-01-24 15:33:41', '2024-01-24 15:47:12', 1, 1.54, 1, 'N', 113, 231, 1, 12.8, 0, 0.5, 5.04, 0, 1, 21.84), +(2, '2024-01-24 15:53:15', '2024-01-24 16:04:11', 1, 1.63, 1, 'N', 125, 68, 1, 12.1, 0, 0.5, 2.42, 0, 1, 18.52), +(1, '2024-01-24 15:13:03', '2024-01-24 15:23:58', 1, 1.4, 1, 'N', 142, 161, 1, 10, 2.5, 0.5, 2.8, 0, 1, 16.8), +(1, '2024-01-24 15:31:49', '2024-01-24 15:46:47', 1, 1.8, 1, 'N', 161, 68, 1, 12.8, 2.5, 0.5, 3.36, 0, 1, 20.16), +(1, '2024-01-24 15:48:50', '2024-01-24 16:06:14', 1, 1.1, 1, 'N', 68, 246, 1, 12.1, 2.5, 0.5, 2, 0, 1, 18.1), +(2, '2024-01-24 15:17:46', '2024-01-24 15:28:19', 1, 1.02, 1, 'N', 236, 236, 1, 10.7, 0, 0.5, 3.67, 0, 1, 18.37), +(2, '2024-01-24 15:30:25', '2024-01-24 15:38:09', 1, 0.84, 1, 'N', 236, 141, 1, 8.6, 0, 0.5, 2.52, 0, 1, 15.12), +(2, '2024-01-24 15:47:13', '2024-01-24 15:50:30', 1, 0.54, 1, 'N', 237, 162, 1, 5.8, 0, 0.5, 2.45, 0, 1, 12.25), +(1, '2024-01-24 15:04:49', '2024-01-24 15:29:05', 1, 6.6, 1, 'N', 132, 134, 1, 27.5, 1.75, 0.5, 0, 0, 1, 30.75), +(1, '2024-01-24 15:52:43', '2024-01-24 16:48:43', 1, 16.3, 2, 'N', 132, 230, 1, 70, 4.25, 0.5, 15.15, 0, 1, 90.9), +(1, '2024-01-24 15:10:42', '2024-01-24 16:07:13', 1, 16.9, 2, 'N', 162, 132, 1, 70, 2.5, 0.5, 16.15, 6.94, 1, 97.09), +(1, '2024-01-24 15:24:26', '2024-01-24 15:53:43', 1, 3.1, 1, 'N', 236, 164, 2, 25.4, 2.5, 0.5, 0, 0, 1, 29.4), +(1, '2024-01-24 15:55:46', '2024-01-24 16:02:04', 1, 0.8, 1, 'N', 164, 107, 1, 7.9, 2.5, 0.5, 2.35, 0, 1, 14.25), +(1, '2024-01-24 15:57:50', '2024-01-24 16:21:27', 1, 2.9, 1, 'N', 75, 143, 1, 21.9, 5, 0.5, 5.65, 0, 1, 34.05), +(2, '2024-01-24 15:56:42', '2024-01-24 16:01:57', 1, 0.73, 1, 'N', 237, 162, 2, 7.2, 0, 0.5, 0, 0, 1, 11.2), +(2, '2024-01-24 15:02:26', '2024-01-24 15:14:20', 1, 1.41, 1, 'N', 151, 41, 2, 12.1, 0, 0.5, 0, 0, 1, 13.6), +(2, '2024-01-24 15:43:11', '2024-01-24 15:52:26', 1, 2.03, 1, 'N', 75, 239, 1, 12.1, 0, 0.5, 3.22, 0, 1, 19.32), +(1, '2024-01-24 15:09:57', '2024-01-24 15:17:06', 1, 0.9, 1, 'N', 186, 234, 1, 8.6, 2.5, 0.5, 1.5, 0, 1, 14.1), +(1, '2024-01-24 15:15:44', '2024-01-24 16:03:27', 1, 5.2, 1, 'N', 234, 41, 2, 40.8, 2.5, 0.5, 0, 0, 1, 44.8), +(2, '2024-01-24 15:03:30', '2024-01-24 15:15:18', 1, 1.74, 1, 'N', 142, 162, 1, 12.8, 0, 0.5, 3, 0, 1, 19.8), +(2, '2024-01-24 15:16:18', '2024-01-24 15:26:54', 1, 1.02, 1, 'N', 162, 230, 1, 10.7, 0, 0.5, 2.94, 0, 1, 17.64), +(1, '2024-01-24 15:09:12', '2024-01-24 15:26:06', 1, 2.5, 1, 'N', 163, 43, 2, 15.6, 2.5, 0.5, 0, 0, 1, 19.6), +(1, '2024-01-24 15:36:01', '2024-01-24 16:09:08', 1, 3.4, 1, 'N', 238, 164, 1, 26.8, 2.5, 0.5, 3.08, 0, 1, 33.88), +(1, '2024-01-24 15:01:40', '2024-01-24 15:30:58', 1, 4, 1, 'N', 231, 181, 1, 23.3, 2.5, 0.5, 6.85, 0, 1, 34.15), +(1, '2024-01-24 15:44:58', '2024-01-24 16:02:01', 1, 1, 1, 'N', 97, 33, 2, 13.5, 0, 0.5, 0, 0, 1, 15), +(1, '2024-01-24 15:08:08', '2024-01-24 15:19:26', 1, 1.1, 1, 'N', 262, 75, 2, 10.7, 2.5, 0.5, 0, 0, 1, 14.7), +(1, '2024-01-24 15:24:26', '2024-01-24 15:51:30', 1, 2.8, 1, 'N', 75, 48, 1, 21.9, 2.5, 0.5, 5.2, 0, 1, 31.1), +(1, '2024-01-24 15:05:32', '2024-01-24 16:11:42', 1, 8.1, 1, 'N', 186, 85, 2, 49.2, 2.5, 0.5, 0, 0, 1, 53.2), +(1, '2024-01-24 15:16:02', '2024-01-24 15:25:14', 1, 0.5, 1, 'N', 162, 161, 1, 9.3, 2.5, 0.5, 2.65, 0, 1, 15.95), +(1, '2024-01-24 15:29:34', '2024-01-24 15:34:45', 1, 0.3, 1, 'N', 161, 162, 2, 6.5, 2.5, 0.5, 0, 0, 1, 10.5), +(1, '2024-01-24 15:56:23', '2024-01-24 16:12:18', 1, 1.4, 1, 'N', 48, 164, 1, 14.9, 2.5, 0.5, 3.75, 0, 1, 22.65), +(1, '2024-01-24 15:22:06', '2024-01-24 15:46:23', 1, 4.4, 1, 'N', 68, 238, 1, 26.1, 2.5, 0.5, 7.5, 0, 1, 37.6), +(2, '2024-01-24 15:28:46', '2024-01-24 15:43:33', 1, 1.49, 1, 'N', 113, 186, 1, 13.5, 0, 0.5, 3.5, 0, 1, 21), +(2, '2024-01-24 15:49:11', '2024-01-24 16:03:14', 1, 1.49, 1, 'N', 90, 161, 1, 13.5, 0, 0.5, 3.5, 0, 1, 21), +(1, '2024-01-24 15:09:45', '2024-01-24 15:43:41', 1, 2.6, 1, 'N', 158, 170, 1, 28.2, 2.5, 0.5, 6.4, 0, 1, 38.6), +(2, '2024-01-24 15:10:12', '2024-01-24 15:30:12', 1, 2.64, 1, 'N', 186, 141, 1, 19.1, 0, 0.5, 2, 0, 1, 25.1), +(2, '2024-01-24 15:08:02', '2024-01-24 15:20:36', 1, 1.59, 1, 'N', 142, 161, 1, 13.5, 0, 0.5, 3.5, 0, 1, 21), +(2, '2024-01-24 15:54:25', '2024-01-24 16:25:45', 1, 3.55, 1, 'N', 236, 234, 1, 27.5, 0, 0.5, 6.3, 0, 1, 37.8), +(2, '2024-01-24 15:09:55', '2024-01-24 15:22:14', 1, 1.85, 1, 'N', 236, 143, 1, 13.5, 0, 0.5, 2, 0, 1, 19.5), +(2, '2024-01-24 15:33:37', '2024-01-24 15:39:20', 2, 0.59, 1, 'N', 238, 238, 1, 7.2, 0, 0.5, 2.24, 0, 1, 13.44), +(2, '2024-01-24 15:58:14', '2024-01-24 16:02:46', 2, 0.42, 1, 'N', 239, 142, 1, 5.8, 0, 0.5, 1.96, 0, 1, 11.76), +(2, '2024-01-24 15:05:34', '2024-01-24 15:51:33', 1, 11.54, 1, 'N', 138, 142, 1, 52, 5, 0.5, 13.94, 6.94, 1, 83.63), +(2, '2024-01-24 15:19:22', '2024-01-24 15:28:49', 1, 1.38, 1, 'N', 230, 143, 1, 10.7, 0, 0.5, 1.47, 0, 1, 16.17), +(2, '2024-01-24 15:22:30', '2024-01-24 15:47:17', 1, 3.6, 1, 'N', 163, 74, 2, 22.6, 0, 0.5, 0, 0, 1, 26.6), +(1, '2024-01-24 15:51:41', '2024-01-24 15:54:17', 1, 0.3, 1, 'N', 249, 90, 1, 4.4, 5, 0.5, 2, 0, 1, 12.9), +(2, '2024-01-24 15:02:26', '2024-01-24 15:07:59', 1, 0.66, 1, 'N', 161, 163, 1, 7.2, 0, 0.5, 2.24, 0, 1, 13.44), +(2, '2024-01-24 15:09:01', '2024-01-24 15:25:34', 1, 1.38, 1, 'N', 163, 236, 1, 14.9, 0, 0.5, 1, 0, 1, 19.9), +(1, '2024-01-24 15:06:58', '2024-01-24 15:24:35', 1, 1.4, 1, 'N', 236, 161, 1, 14.9, 2.5, 0.5, 3.8, 0, 1, 22.7), +(1, '2024-01-24 15:39:09', '2024-01-24 16:03:25', 1, 2.5, 1, 'N', 233, 68, 1, 19.8, 2.5, 0.5, 4.75, 0, 1, 28.55), +(2, '2024-01-24 15:21:47', '2024-01-24 15:55:15', 1, 8.65, 1, 'N', 70, 230, 2, 40.8, 5, 0.5, 0, 6.94, 1, 58.49), +(2, '2024-01-24 15:32:46', '2024-01-24 16:01:04', 1, 2.16, 1, 'N', 113, 79, 1, 23.3, 0, 0.5, 8.19, 0, 1, 35.49), +(2, '2024-01-24 15:37:00', '2024-01-24 16:01:28', 1, 4.56, 1, 'N', 261, 170, 1, 25.4, 0, 0.5, 5.88, 0, 1, 35.28); + + +# test explain heap scan +query T +EXPLAIN SELECT COUNT(*) FROM nyc_trips WHERE tip_amount <> 0 +---- +Aggregate (cost=16.89..16.91 rows=1 width=8) + -> Seq Scan on nyc_trips (cost=0.00..15.75 rows=458 width=0) + Filter: (tip_amount <> '0'::double precision) diff --git a/tests/sqllogictests/test_files/scan.slt b/tests/sqllogictests/test_files/scan.slt new file mode 100644 index 00000000..c6022b8b --- /dev/null +++ b/tests/sqllogictests/test_files/scan.slt @@ -0,0 +1,46 @@ +# Copyright (c) 2023-2024 Retake, Inc. +# +# This file is part of ParadeDB - Postgres for Search and Analytics +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +####### +# Load the pg_analytics extension +####### +statement ok +DROP EXTENSION IF EXISTS pg_analytics CASCADE; + +statement ok +CREATE EXTENSION pg_analytics; + +####### +# Load the FDW for Parquet +####### + +statement ok +CREATE FOREIGN DATA WRAPPER parquet_wrapper +HANDLER parquet_fdw_handler VALIDATOR parquet_fdw_validator; + +statement ok +CREATE SERVER parquet_server FOREIGN DATA WRAPPER parquet_wrapper; + +statement ok +CREATE FOREIGN TABLE trips () +SERVER parquet_server +OPTIONS (files 's3://paradedb-benchmarks/yellow_tripdata_2024-01.parquet'); + +query IIR +SELECT vendorid, passenger_count, trip_distance FROM trips LIMIT 1; +---- +2 1 1.72 diff --git a/tests/tests/datetime.rs b/tests/tests/datetime.rs index 0e14a35d..1977c436 100644 --- a/tests/tests/datetime.rs +++ b/tests/tests/datetime.rs @@ -17,8 +17,6 @@ mod fixtures; -use crate::fixtures::arrow::primitive_setup_fdw_local_file_listing; -use crate::fixtures::db::Query; use crate::fixtures::duckdb_conn; use crate::fixtures::tables::duckdb_types::DuckdbTypesTable; use crate::fixtures::tables::nyc_trips::NycTripsTable; @@ -28,6 +26,8 @@ use crate::fixtures::{ use anyhow::Result; use chrono::NaiveDateTime; use datafusion::parquet::arrow::ArrowWriter; +use fixtures::arrow::primitive_setup_fdw_local_file_listing; +use paradedb_sqllogictest::engine::Query; use rstest::*; use sqlx::types::BigDecimal; use sqlx::PgConnection; diff --git a/tests/tests/explain.rs b/tests/tests/explain.rs index 64b3bc25..4aacdef3 100644 --- a/tests/tests/explain.rs +++ b/tests/tests/explain.rs @@ -17,9 +17,10 @@ mod fixtures; -use crate::fixtures::db::Query; use crate::fixtures::{conn, s3, S3}; use anyhow::Result; + +use paradedb_sqllogictest::engine::Query; use rstest::*; use sqlx::PgConnection; @@ -56,20 +57,6 @@ async fn test_explain_fdw(#[future(awt)] s3: S3, mut conn: PgConnection) -> Resu Ok(()) } -#[rstest] -async fn test_explain_heap(mut conn: PgConnection) -> Result<()> { - NycTripsTable::setup().execute(&mut conn); - - let explain: Vec<(String,)> = - "EXPLAIN SELECT COUNT(*) FROM nyc_trips WHERE tip_amount <> 0".fetch(&mut conn); - - assert!(explain[0].0.contains("Aggregate")); - assert!(explain[1].0.contains("Seq Scan on nyc_trips")); - assert!(explain[2].0.contains("Filter")); - - Ok(()) -} - #[rstest] #[ignore = "EXPLAIN not fully working"] async fn test_explain_federated(#[future(awt)] s3: S3, mut conn: PgConnection) -> Result<()> { diff --git a/tests/tests/fixtures/mod.rs b/tests/tests/fixtures/mod.rs index 0e1da4cb..ee6a3f95 100644 --- a/tests/tests/fixtures/mod.rs +++ b/tests/tests/fixtures/mod.rs @@ -16,7 +16,6 @@ // along with this program. If not, see . pub mod arrow; -pub mod db; pub mod tables; use anyhow::Result; @@ -32,6 +31,7 @@ use datafusion::{ parquet::arrow::ArrowWriter, }; use futures::future::{BoxFuture, FutureExt}; +use paradedb_sqllogictest::engine::Db; use rstest::*; use serde::Serialize; use serde_arrow::schema::{SchemaLike, TracingOptions}; @@ -48,7 +48,6 @@ use testcontainers_modules::{ testcontainers::{runners::AsyncRunner, RunnableImage}, }; -use crate::fixtures::db::*; use crate::fixtures::tables::nyc_trips::NycTripsTable; #[fixture] diff --git a/tests/tests/json.rs b/tests/tests/json.rs index 82646ef1..151c4f11 100644 --- a/tests/tests/json.rs +++ b/tests/tests/json.rs @@ -21,6 +21,8 @@ use anyhow::Result; use datafusion::arrow::array::{LargeStringArray, StringArray}; use datafusion::arrow::datatypes::{DataType, Field, Schema}; use datafusion::{arrow::record_batch::RecordBatch, parquet::arrow::ArrowWriter}; +use fixtures::arrow::{primitive_create_foreign_data_wrapper, primitive_create_server}; +use paradedb_sqllogictest::engine::Query; use rstest::*; use serde_json::json; use sqlx::types::{Json, JsonValue}; @@ -29,8 +31,6 @@ use std::fs::File; use std::sync::Arc; use tempfile::TempDir; -use crate::fixtures::arrow::{primitive_create_foreign_data_wrapper, primitive_create_server}; -use crate::fixtures::db::Query; use crate::fixtures::{conn, tempdir}; pub fn json_string_record_batch() -> Result { diff --git a/tests/tests/scan.rs b/tests/tests/scan.rs index 425ced84..53a40057 100644 --- a/tests/tests/scan.rs +++ b/tests/tests/scan.rs @@ -24,12 +24,12 @@ use crate::fixtures::arrow::{ primitive_setup_fdw_local_file_listing, primitive_setup_fdw_s3_delta, primitive_setup_fdw_s3_listing, setup_parquet_wrapper_and_server, }; -use crate::fixtures::db::Query; use crate::fixtures::{conn, duckdb_conn, s3, tempdir, S3}; use anyhow::Result; use datafusion::parquet::arrow::ArrowWriter; use deltalake::operations::create::CreateBuilder; use deltalake::writer::{DeltaWriter, RecordBatchWriter}; +use paradedb_sqllogictest::engine::Query; use rstest::*; use sqlx::postgres::types::PgInterval; use sqlx::types::{BigDecimal, Json, Uuid}; diff --git a/tests/tests/settings.rs b/tests/tests/settings.rs index 6bb8c197..4f83101a 100644 --- a/tests/tests/settings.rs +++ b/tests/tests/settings.rs @@ -1,8 +1,8 @@ mod fixtures; use crate::fixtures::conn; -use crate::fixtures::db::Query; use anyhow::Result; +use paradedb_sqllogictest::engine::Query; use rstest::*; use sqlx::PgConnection; diff --git a/tests/tests/spatial.rs b/tests/tests/spatial.rs index e0d58bde..e97c0b71 100644 --- a/tests/tests/spatial.rs +++ b/tests/tests/spatial.rs @@ -19,13 +19,15 @@ mod fixtures; -use crate::fixtures::{arrow::primitive_setup_fdw_local_file_spatial, conn, db::Query, tempdir}; +use crate::fixtures::{conn, tempdir}; use anyhow::Result; use datafusion::arrow::array::*; use datafusion::arrow::datatypes::{DataType, Field, Schema}; use datafusion::arrow::record_batch::RecordBatch; use datafusion::common::cast::as_binary_array; +use fixtures::arrow::primitive_setup_fdw_local_file_spatial; use geojson::{Feature, GeoJson, Geometry, Value}; +use paradedb_sqllogictest::engine::Query; use rstest::rstest; use sqlx::PgConnection; diff --git a/tests/tests/table_config.rs b/tests/tests/table_config.rs index 531944c4..ae774554 100644 --- a/tests/tests/table_config.rs +++ b/tests/tests/table_config.rs @@ -21,10 +21,10 @@ use crate::fixtures::arrow::{ primitive_record_batch, primitive_setup_fdw_local_file_listing, record_batch_with_casing, setup_local_file_listing_with_casing, }; -use crate::fixtures::db::Query; use crate::fixtures::{conn, tempdir}; use anyhow::Result; use datafusion::parquet::arrow::ArrowWriter; +use paradedb_sqllogictest::engine::Query; use rstest::*; use sqlx::PgConnection; use std::fs::File;