From d226c0a9722f31eeb6d2e91b7aa9218e3604f96f Mon Sep 17 00:00:00 2001 From: Marko Grujic Date: Wed, 13 Sep 2023 21:08:55 +0200 Subject: [PATCH] DataFusion 31 and Arrow 46 upgrade Also fix the toolchain to stable in workflows. --- .github/workflows/benchmark.yml | 2 +- .github/workflows/ci.yml | 4 +- .github/workflows/docs.yml | 2 +- .github/workflows/release.yml | 18 +- Cargo.lock | 389 ++++++++++----------- Cargo.toml | 3 +- connectorx-python/Cargo.toml | 4 +- connectorx/Cargo.toml | 8 +- connectorx/examples/batch_test.rs | 2 +- connectorx/src/constants.rs | 2 +- connectorx/src/sources/bigquery/mod.rs | 11 +- connectorx/src/sources/mssql/typesystem.rs | 4 +- connectorx/src/sources/mysql/mod.rs | 2 +- connectorx/src/sources/oracle/mod.rs | 10 +- connectorx/src/sources/postgres/mod.rs | 10 +- connectorx/src/sources/sqlite/mod.rs | 2 +- connectorx/src/sql.rs | 97 +++-- connectorx/tests/test_mssql.rs | 10 +- connectorx/tests/test_postgres.rs | 4 +- 19 files changed, 285 insertions(+), 299 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 51af80f445..ebd950d657 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -26,7 +26,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.71.1 + toolchain: stable components: rustfmt default: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43cb6d7037..a425409efc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,7 @@ jobs: # - name: Install Rust # uses: actions-rs/toolchain@v1 # with: - # toolchain: 1.71.1 + # toolchain: stable # components: rustfmt # default: true @@ -191,7 +191,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.71.1 + toolchain: stable components: rustfmt default: true diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 74cda1cd16..d475ee9ccc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,7 +14,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.71.1 + toolchain: stable components: rustfmt default: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14ebee5e96..3d7564dd7a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: - toolchain: 1.71.1 + toolchain: stable components: rustfmt target: aarch64-unknown-linux-gnu default: true @@ -44,7 +44,7 @@ jobs: - uses: PyO3/maturin-action@v1 with: - rust-toolchain: 1.71.1 + rust-toolchain: stable maturin-version: v0.14.15 command: build args: -m connectorx-python/Cargo.toml -i python --release --manylinux 2_28 --features integrated-auth-gssapi @@ -58,7 +58,7 @@ jobs: # rebuild the wheel to incorporate j4rs dependencies - uses: PyO3/maturin-action@v1 with: - rust-toolchain: 1.71.1 + rust-toolchain: stable maturin-version: v0.14.15 command: build args: -m connectorx-python/Cargo.toml -i python --release --manylinux 2_28 --features integrated-auth-gssapi @@ -101,7 +101,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: - toolchain: 1.71.1 + toolchain: stable components: rustfmt default: true @@ -117,7 +117,7 @@ jobs: - uses: PyO3/maturin-action@v1 with: - rust-toolchain: 1.71.1 + rust-toolchain: stable maturin-version: v0.14.15 command: build args: -m connectorx-python/Cargo.toml -i python --release ${{ matrix.features }} @@ -131,7 +131,7 @@ jobs: # rebuild the wheel to incorporate j4rs dependencies - uses: PyO3/maturin-action@v1 with: - rust-toolchain: 1.71.1 + rust-toolchain: stable maturin-version: v0.14.15 command: build args: -m connectorx-python/Cargo.toml -i python --release ${{ matrix.features }} @@ -161,7 +161,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: - toolchain: 1.71.1 + toolchain: stable components: rustfmt target: aarch64-apple-darwin default: true @@ -178,7 +178,7 @@ jobs: - uses: PyO3/maturin-action@v1 with: - rust-toolchain: 1.71.1 + rust-toolchain: stable maturin-version: v0.14.15 command: build args: -m connectorx-python/Cargo.toml --target aarch64-apple-darwin -i python --release --features integrated-auth-gssapi @@ -192,7 +192,7 @@ jobs: # rebuild the wheel to incorporate j4rs dependencies - uses: PyO3/maturin-action@v1 with: - rust-toolchain: 1.71.1 + rust-toolchain: stable maturin-version: v0.14.15 command: build args: -m connectorx-python/Cargo.toml --target aarch64-apple-darwin -i python --release --features integrated-auth-gssapi diff --git a/Cargo.lock b/Cargo.lock index f02ccfa67f..45ea8c88c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,9 +130,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "arrow" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6619cab21a0cdd8c9b9f1d9e09bfaa9b1974e5ef809a6566aef0b998caf38ace" +checksum = "04a8801ebb147ad240b2d978d3ab9f73c9ccd4557ba6a03e7800496770ed10e0" dependencies = [ "ahash 0.8.3", "arrow-arith", @@ -152,9 +152,9 @@ dependencies = [ [[package]] name = "arrow-arith" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0dc95485623a76e00929bda8caa40c1f838190952365c4f43a7b9ae86d03e94" +checksum = "895263144bd4a69751cbe6a34a53f26626e19770b313a9fa792c415cd0e78f11" dependencies = [ "arrow-array", "arrow-buffer", @@ -167,9 +167,9 @@ dependencies = [ [[package]] name = "arrow-array" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3267847f53d3042473cfd2c769afd8d74a6d7d201fc3a34f5cb84c0282ef47a7" +checksum = "226fdc6c3a4ae154a74c24091d36a90b514f0ed7112f5b8322c1d8f354d8e20d" dependencies = [ "ahash 0.8.3", "arrow-buffer", @@ -178,25 +178,26 @@ dependencies = [ "chrono", "chrono-tz", "half 2.3.1", - "hashbrown 0.13.2", + "hashbrown 0.14.0", "num", ] [[package]] name = "arrow-buffer" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f66553e66e120ac4b21570368ee9ebf35ff3f5399f872b0667699e145678f5" +checksum = "fc4843af4dd679c2f35b69c572874da8fde33be53eb549a5fb128e7a4b763510" dependencies = [ + "bytes", "half 2.3.1", "num", ] [[package]] name = "arrow-cast" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e6f3579dbf0d97c683d451b2550062b0f0e62a3169bf74238b5f59f44ad6d8" +checksum = "35e8b9990733a9b635f656efda3c9b8308c7a19695c9ec2c7046dd154f9b144b" dependencies = [ "arrow-array", "arrow-buffer", @@ -204,16 +205,17 @@ dependencies = [ "arrow-schema", "arrow-select", "chrono", - "comfy-table 6.2.0", + "comfy-table", + "half 2.3.1", "lexical-core", "num", ] [[package]] name = "arrow-csv" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373579c4c1a8f5307d3125b7a89c700fcf8caf85821c77eb4baab3855ae0aba5" +checksum = "646fbb4e11dd0afb8083e883f53117713b8caadb4413b3c9e63e3f535da3683c" dependencies = [ "arrow-array", "arrow-buffer", @@ -230,9 +232,9 @@ dependencies = [ [[package]] name = "arrow-data" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61bc8df9912cca6642665fdf989d6fa0de2570f18a7f709bcf59d29de96d2097" +checksum = "da900f31ff01a0a84da0572209be72b2b6f980f3ea58803635de47913191c188" dependencies = [ "arrow-buffer", "arrow-schema", @@ -252,9 +254,9 @@ dependencies = [ [[package]] name = "arrow-ipc" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0105dcf5f91daa7182d87b713ee0b32b3bfc88e0c48e7dc3e9d6f1277a07d1ae" +checksum = "2707a8d7ee2d345d045283ece3ae43416175873483e5d96319c929da542a0b1f" dependencies = [ "arrow-array", "arrow-buffer", @@ -266,9 +268,9 @@ dependencies = [ [[package]] name = "arrow-json" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73134fb5b5ec8770f8cbb214c2c487b2d350081e403ca4eeeb6f8f5e19846ac" +checksum = "5d1b91a63c356d14eedc778b76d66a88f35ac8498426bb0799a769a49a74a8b4" dependencies = [ "arrow-array", "arrow-buffer", @@ -277,7 +279,7 @@ dependencies = [ "arrow-schema", "chrono", "half 2.3.1", - "indexmap 1.9.3", + "indexmap 2.0.0", "lexical-core", "num", "serde", @@ -286,9 +288,9 @@ dependencies = [ [[package]] name = "arrow-ord" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89f25bc66e18d4c2aa1fe2f9bb03e2269da60e636213210385ae41a107f9965a" +checksum = "584325c91293abbca7aaaabf8da9fe303245d641f5f4a18a6058dc68009c7ebf" dependencies = [ "arrow-array", "arrow-buffer", @@ -301,9 +303,9 @@ dependencies = [ [[package]] name = "arrow-row" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1095ff85ea4f5ff02d17b30b089de31b51a50be01c6b674f0a0509ab771232f1" +checksum = "0e32afc1329f7b372463b21c6ca502b07cf237e1ed420d87706c1770bb0ebd38" dependencies = [ "ahash 0.8.3", "arrow-array", @@ -311,23 +313,23 @@ dependencies = [ "arrow-data", "arrow-schema", "half 2.3.1", - "hashbrown 0.13.2", + "hashbrown 0.14.0", ] [[package]] name = "arrow-schema" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25187bbef474151a2e4ddec67b9e34bda5cbfba292dc571392fa3a1f71ff5a82" +checksum = "b104f5daa730f00fde22adc03a12aa5a2ae9ccbbf99cbd53d284119ddc90e03d" dependencies = [ "bitflags 2.4.0", ] [[package]] name = "arrow-select" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd0d4ee884aec3aa05e41478e3cd312bf609de9babb5d187a43fb45931da4da4" +checksum = "73b3ca55356d1eae07cf48808d8c462cea674393ae6ad1e0b120f40b422eb2b4" dependencies = [ "arrow-array", "arrow-buffer", @@ -338,15 +340,16 @@ dependencies = [ [[package]] name = "arrow-string" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d71c3ffe4c07e66ce8fdc6aed5b00e0e60c5144911879b10546f5b72d8fa1c" +checksum = "af1433ce02590cae68da0a18ed3a3ed868ffac2c6f24c533ddd2067f7ee04b4a" dependencies = [ "arrow-array", "arrow-buffer", "arrow-data", "arrow-schema", "arrow-select", + "num", "regex", "regex-syntax 0.7.5", ] @@ -393,9 +396,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d495b6dc0184693324491a5ac05f559acc97bf937ab31d7a1c33dd0016be6d2b" +checksum = "bb42b2197bf15ccb092b62c74515dbd8b86d0effd934795f6687c93b6e679a2c" dependencies = [ "bzip2", "flate2", @@ -490,7 +493,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -501,7 +504,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -566,9 +569,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.3" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "bb8" @@ -805,7 +808,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -816,9 +819,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bzip2" @@ -880,16 +883,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.29" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87d9d13be47a5b7c3907137f1290b0459a7f80efb26be8c52afb11963bccb02" +checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", "windows-targets", ] @@ -951,17 +953,6 @@ dependencies = [ "cc", ] -[[package]] -name = "comfy-table" -version = "6.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e959d788268e3bf9d35ace83e81b124190378e4c91c9067524675e33394b8ba" -dependencies = [ - "strum", - "strum_macros 0.24.3", - "unicode-width", -] - [[package]] name = "comfy-table" version = "7.0.1" @@ -969,7 +960,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ab77dbd8adecaf3f0db40581631b995f312a8a5ae3aa9993188bb8f23d83a5b" dependencies = [ "crossterm", - "strum", + "strum 0.24.1", "strum_macros 0.24.3", "unicode-width", ] @@ -1013,7 +1004,7 @@ dependencies = [ "gcp-bigquery-client", "hex", "iai", - "itertools", + "itertools 0.10.5", "j4rs", "log", "mysql_common", @@ -1039,7 +1030,7 @@ dependencies = [ "rust_decimal", "rust_decimal_macros", "serde_json", - "sqlparser 0.11.0", + "sqlparser 0.37.0", "thiserror", "tiberius", "tokio", @@ -1141,7 +1132,7 @@ dependencies = [ "clap", "criterion-plot", "csv", - "itertools", + "itertools 0.10.5", "lazy_static", "num-traits", "oorandom", @@ -1163,7 +1154,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" dependencies = [ "cast", - "itertools", + "itertools 0.10.5", ] [[package]] @@ -1345,9 +1336,9 @@ dependencies = [ [[package]] name = "datafusion" -version = "26.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9992c267436551d40b52d65289b144712e7b0ebdc62c8c859fd1574e5f73efbb" +checksum = "6a4e4fc25698a14c90b34dda647ba10a5a966dc04b036d22e77fb1048663375d" dependencies = [ "ahash 0.8.3", "arrow", @@ -1364,15 +1355,14 @@ dependencies = [ "datafusion-expr", "datafusion-optimizer", "datafusion-physical-expr", - "datafusion-row", "datafusion-sql", "flate2", "futures", "glob", - "hashbrown 0.13.2", - "indexmap 1.9.3", - "itertools", - "lazy_static", + "half 2.3.1", + "hashbrown 0.14.0", + "indexmap 2.0.0", + "itertools 0.11.0", "log", "num_cpus", "object_store", @@ -1381,11 +1371,9 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rand 0.8.5", - "smallvec", - "sqlparser 0.34.0", + "sqlparser 0.37.0", "tempfile", "tokio", - "tokio-stream", "tokio-util 0.7.8", "url", "uuid 1.4.1", @@ -1395,29 +1383,40 @@ dependencies = [ [[package]] name = "datafusion-common" -version = "26.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3be97f7a7c720cdbb71e9eeabf814fa6ad8102b9022390f6cac74d3b4af6392" +checksum = "c23ad0229ea4a85bf76b236d8e75edf539881fdb02ce4e2394f9a76de6055206" dependencies = [ "arrow", "arrow-array", + "async-compression", + "bytes", + "bzip2", "chrono", + "flate2", + "futures", "num_cpus", "object_store", "parquet", - "sqlparser 0.34.0", + "sqlparser 0.37.0", + "tokio", + "tokio-util 0.7.8", + "xz2", + "zstd", ] [[package]] name = "datafusion-execution" -version = "26.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77c4b14b809b0e4c5bb101b6834504f06cdbb0d3c643400c61d0d844b33264e" +checksum = "9b37d2fc1a213baf34e0a57c85b8e6648f1a95152798fd6738163ee96c19203f" dependencies = [ + "arrow", "dashmap", "datafusion-common", "datafusion-expr", - "hashbrown 0.13.2", + "futures", + "hashbrown 0.14.0", "log", "object_store", "parking_lot 0.12.1", @@ -1428,24 +1427,23 @@ dependencies = [ [[package]] name = "datafusion-expr" -version = "26.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ec7409bd45cf4fae6395d7d1024c8a97e543cadc88363e405d2aad5330e5e7" +checksum = "d6ea9844395f537730a145e5d87f61fecd37c2bc9d54e1dc89b35590d867345d" dependencies = [ "ahash 0.8.3", "arrow", "datafusion-common", - "lazy_static", - "sqlparser 0.34.0", - "strum", - "strum_macros 0.24.3", + "sqlparser 0.37.0", + "strum 0.25.0", + "strum_macros 0.25.2", ] [[package]] name = "datafusion-optimizer" -version = "26.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b537c93f87989c212db92a448a0f5eb4f0995e27199bb7687ae94f8b64a7a8" +checksum = "c8a30e0f79c5d59ba14d3d70f2500e87e0ff70236ad5e47f9444428f054fd2be" dependencies = [ "arrow", "async-trait", @@ -1453,35 +1451,36 @@ dependencies = [ "datafusion-common", "datafusion-expr", "datafusion-physical-expr", - "hashbrown 0.13.2", - "itertools", + "hashbrown 0.14.0", + "itertools 0.11.0", "log", "regex-syntax 0.7.5", ] [[package]] name = "datafusion-physical-expr" -version = "26.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60ee3f53340fdef36ee54d9e12d446ae2718b1d0196ac581f791d34808ec876" +checksum = "766c567082c9bbdcb784feec8fe40c7049cedaeb3a18d54f563f75fe0dc1932c" dependencies = [ "ahash 0.8.3", "arrow", "arrow-array", "arrow-buffer", "arrow-schema", + "base64 0.21.4", "blake2", "blake3", "chrono", "datafusion-common", "datafusion-expr", - "datafusion-row", "half 2.3.1", - "hashbrown 0.13.2", - "indexmap 1.9.3", - "itertools", - "lazy_static", + "hashbrown 0.14.0", + "hex", + "indexmap 2.0.0", + "itertools 0.11.0", "libc", + "log", "md-5", "paste", "petgraph", @@ -1492,30 +1491,18 @@ dependencies = [ "uuid 1.4.1", ] -[[package]] -name = "datafusion-row" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58fc64058aa3bcb00077a0d19474a0d584d31dec8c7ac3406868f485f659af9" -dependencies = [ - "arrow", - "datafusion-common", - "paste", - "rand 0.8.5", -] - [[package]] name = "datafusion-sql" -version = "26.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1531f0314151a34bf6c0a83c7261525688b7c729876f53e7896b8f4ca8f57d07" +checksum = "811fd084cf2d78aa0c76b74320977c7084ad0383690612528b580795764b4dd0" dependencies = [ "arrow", "arrow-schema", "datafusion-common", "datafusion-expr", "log", - "sqlparser 0.34.0", + "sqlparser 0.37.0", ] [[package]] @@ -1544,7 +1531,7 @@ checksum = "9abcad25e9720609ccb3dcdb795d845e37d8ce34183330a9f48b03a1a71c8e21" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -1684,7 +1671,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -1704,7 +1691,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -1897,7 +1884,7 @@ checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e" dependencies = [ "frunk_proc_macro_helpers", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -1909,7 +1896,7 @@ dependencies = [ "frunk_core", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -1921,7 +1908,7 @@ dependencies = [ "frunk_core", "frunk_proc_macro_helpers", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -1992,7 +1979,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -2039,7 +2026,7 @@ dependencies = [ "serde", "serde_json", "thiserror", - "time 0.3.28", + "time", "tokio", "tokio-stream", "url", @@ -2134,15 +2121,6 @@ version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74721d007512d0cb3338cd20f0654ac913920061a4c4d0d8708edb3f2a698c0c" -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash 0.7.6", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -2174,11 +2152,11 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.7.0" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.11.2", + "hashbrown 0.14.0", ] [[package]] @@ -2424,7 +2402,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5305557fa27b460072ae15ce07617e999f5879f14d376c8449f0bfb9f9d8e91e" dependencies = [ "derive_utils", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -2442,6 +2420,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -2591,9 +2578,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libgssapi" @@ -2635,9 +2622,9 @@ checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libsqlite3-sys" -version = "0.24.2" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "898745e570c7d0453cc1fbc4a701eb6c662ed54e8fec8b7d14be137ebeeb9d14" +checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" dependencies = [ "cc", "pkg-config", @@ -2657,9 +2644,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] name = "lock_api" @@ -2896,7 +2883,7 @@ dependencies = [ "smallvec", "subprocess", "thiserror", - "time 0.3.28", + "time", "uuid 1.4.1", ] @@ -3097,15 +3084,16 @@ dependencies = [ [[package]] name = "object_store" -version = "0.5.6" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec9cd6ca25e796a49fa242876d1c4de36a24a6da5258e9f0bc062dbf5e81c53b" +checksum = "d359e231e5451f4f9fa889d56e3ce34f8724f1a61db2107739359717cf2bbf08" dependencies = [ "async-trait", "bytes", "chrono", "futures", - "itertools", + "humantime", + "itertools 0.10.5", "parking_lot 0.12.1", "percent-encoding", "snafu", @@ -3150,7 +3138,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -3288,9 +3276,9 @@ dependencies = [ [[package]] name = "parquet" -version = "40.0.0" +version = "46.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6a656fcc17e641657c955742c689732684e096f790ff30865d9f8dcc39f7c4a" +checksum = "1ad2cba786ae07da4d73371a88b9e0f9d3ffac1a9badc83922e0e15814f5c5fa" dependencies = [ "ahash 0.8.3", "arrow-array", @@ -3300,13 +3288,13 @@ dependencies = [ "arrow-ipc", "arrow-schema", "arrow-select", - "base64 0.21.3", + "base64 0.21.4", "brotli", "bytes", "chrono", "flate2", "futures", - "hashbrown 0.13.2", + "hashbrown 0.14.0", "lz4", "num", "num-bigint", @@ -3500,7 +3488,7 @@ dependencies = [ "arrow2", "bitflags 2.4.0", "chrono", - "comfy-table 7.0.1", + "comfy-table", "either", "hashbrown 0.14.0", "indexmap 2.0.0", @@ -3754,7 +3742,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ - "base64 0.21.3", + "base64 0.21.4", "byteorder", "bytes", "fallible-iterator", @@ -3828,9 +3816,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -3916,12 +3904,13 @@ dependencies = [ [[package]] name = "r2d2_sqlite" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fdc8e4da70586127893be32b7adf21326a4c6b1aba907611edf467d13ffe895" +checksum = "99f31323d6161385f385046738df520e0e8694fa74852d35891fc0be08348ddc" dependencies = [ "r2d2", "rusqlite", + "uuid 1.4.1", ] [[package]] @@ -4118,7 +4107,7 @@ version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "base64 0.21.3", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -4205,17 +4194,16 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85127183a999f7db96d1a976a309eebbfb6ea3b0b400ddd8340190129de6eb7a" +checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "chrono", "fallible-iterator", "fallible-streaming-iterator", "hashlink", "libsqlite3-sys", - "memchr", "smallvec", ] @@ -4269,9 +4257,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.11" +version = "0.38.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" +checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" dependencies = [ "bitflags 2.4.0", "errno", @@ -4331,14 +4319,14 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.3", + "base64 0.21.4", ] [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" dependencies = [ "ring", "untrusted", @@ -4473,14 +4461,14 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" dependencies = [ "itoa", "ryu", @@ -4635,9 +4623,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys", @@ -4651,32 +4639,23 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "sqlparser" -version = "0.11.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10e1ce16b71375ad72d28d111131069ce0d5f8603f4f86d8acd3456b41b57a51" +checksum = "2eaa1e88e78d2c2460d78b7dc3f0c08dbb606ab4222f9aff36f420d36e307d87" dependencies = [ "log", ] [[package]] name = "sqlparser" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3706eefb17039056234df6b566b0014f303f867f2656108334a55b8096f59" +checksum = "37ae05a8250b968a3f7db93155a84d68b2e6cea1583949af5ca5b5170c76c075" dependencies = [ "log", "sqlparser_derive", ] -[[package]] -name = "sqlparser" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eaa1e88e78d2c2460d78b7dc3f0c08dbb606ab4222f9aff36f420d36e307d87" -dependencies = [ - "log", -] - [[package]] name = "sqlparser_derive" version = "0.1.1" @@ -4740,8 +4719,14 @@ name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" dependencies = [ - "strum_macros 0.24.3", + "strum_macros 0.25.2", ] [[package]] @@ -4767,7 +4752,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -4822,9 +4807,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.31" +version = "2.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" dependencies = [ "proc-macro2", "quote", @@ -4905,7 +4890,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -4951,17 +4936,6 @@ dependencies = [ "winauth", ] -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - [[package]] name = "time" version = "0.3.28" @@ -5039,7 +5013,7 @@ dependencies = [ "num_cpus", "parking_lot 0.12.1", "pin-project-lite", - "socket2 0.5.3", + "socket2 0.5.4", "tokio-macros", "windows-sys", ] @@ -5052,7 +5026,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -5097,7 +5071,7 @@ dependencies = [ "postgres-protocol", "postgres-types", "rand 0.8.5", - "socket2 0.5.3", + "socket2 0.5.4", "tokio", "tokio-util 0.7.8", "whoami", @@ -5200,7 +5174,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -5243,9 +5217,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -5308,6 +5282,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ "getrandom 0.2.10", + "rand 0.8.5", ] [[package]] @@ -5353,12 +5328,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -5619,9 +5588,9 @@ dependencies = [ [[package]] name = "xxhash-rust" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735a71d46c4d68d71d4b24d03fdc2b98e38cea81730595801db779c04fe80d70" +checksum = "9828b178da53440fa9c766a3d2f73f7cf5d0ac1fe3980c1e5018d899fd19e07b" [[package]] name = "xz2" @@ -5645,7 +5614,7 @@ dependencies = [ "http", "hyper", "hyper-rustls 0.23.2", - "itertools", + "itertools 0.10.5", "log", "percent-encoding", "rustls 0.20.9", @@ -5653,7 +5622,7 @@ dependencies = [ "seahash", "serde", "serde_json", - "time 0.3.28", + "time", "tokio", "tower-service", "url", diff --git a/Cargo.toml b/Cargo.toml index 2b62598fd8..0bbd4998ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,12 @@ [workspace] default-members = ["connectorx"] members = ["connectorx", "connectorx-cpp"] +resolver = "2" [profile.release] debug = true lto = true [workspace.dependencies] -arrow = {version = "40", features = ["prettyprint", "ffi"]} +arrow = {version = "46", features = ["prettyprint", "ffi"]} arrow2 = {version = "0.17", default-features = false} diff --git a/connectorx-python/Cargo.toml b/connectorx-python/Cargo.toml index 4056e922c8..0b010af1df 100644 --- a/connectorx-python/Cargo.toml +++ b/connectorx-python/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" [dependencies] anyhow = "1" -arrow = { version = "40" } +arrow = { version = "46" } arrow2 = {version = "0.17", default-features = false} bitfield = "0.13" bytes = "1.4" @@ -36,7 +36,7 @@ pyo3 = {version = "0.15", default-features = false, features = ["macros"]} pyo3-built = "0.4" rust_decimal = {version = "1", features = ["db-postgres"]} serde_json = "1" -sqlparser = "0.11" +sqlparser = "0.37" thiserror = "1" tokio = {version = "1", features = ["rt", "rt-multi-thread", "net"]} tokio-util = "0.6" diff --git a/connectorx/Cargo.toml b/connectorx/Cargo.toml index 9957c1fa1b..d8ddb25ea3 100644 --- a/connectorx/Cargo.toml +++ b/connectorx/Cargo.toml @@ -15,7 +15,7 @@ fehler = "1" itertools = "0.10" log = "0.4" rayon = "1" -sqlparser = "0.11" +sqlparser = "0.37" thiserror = "1" url = "2" owning_ref = "0.4" @@ -45,9 +45,9 @@ r2d2 = {version = "0.8", optional = true} r2d2-oracle = {version = "0.5.0", features = ["chrono"], optional = true} r2d2_mysql = {version = "23", optional = true} r2d2_postgres = {version = "0.18.1", optional = true} -r2d2_sqlite = {version = "0.20.0", optional = true} +r2d2_sqlite = {version = "0.22.0", optional = true} regex = {version = "1", optional = true} -rusqlite = {version = "0.27.0", features = ["column_decltype", "chrono", "bundled"], optional = true} +rusqlite = {version = "0.29.0", features = ["column_decltype", "chrono", "bundled"], optional = true} rust_decimal = {version = "1", features = ["db-postgres"], optional = true} rust_decimal_macros = {version = "1", optional = true} tiberius = {version = "0.5", features = ["rust_decimal", "chrono", "integrated-auth-gssapi"], optional = true} @@ -56,7 +56,7 @@ tokio-util = {version = "0.6", optional = true} urlencoding = {version = "2.1", optional = true} uuid = {version = "0.8", optional = true} j4rs = {version = "0.15", optional = true} -datafusion = {version = "26", optional = true} +datafusion = {version = "31", optional = true} [lib] crate-type = ["cdylib", "rlib"] diff --git a/connectorx/examples/batch_test.rs b/connectorx/examples/batch_test.rs index 3e8a59f8bc..aa8bb1611f 100644 --- a/connectorx/examples/batch_test.rs +++ b/connectorx/examples/batch_test.rs @@ -48,7 +48,7 @@ fn main() { let mut num_rows = 0; let mut num_batches = 0; - while let Some(record_batch) = batch_iter.next() { + for record_batch in batch_iter { let record_batch = record_batch; println!("got 1 batch, with {} rows", record_batch.num_rows()); num_rows += record_batch.num_rows(); diff --git a/connectorx/src/constants.rs b/connectorx/src/constants.rs index c711f1c1b6..b65cca47d1 100644 --- a/connectorx/src/constants.rs +++ b/connectorx/src/constants.rs @@ -16,7 +16,7 @@ pub const RECORD_BATCH_SIZE: usize = 64 * KILO; pub const DB_BUFFER_SIZE: usize = 32; #[cfg(any(feature = "src_oracle"))] -pub const ORACLE_ARRAY_SIZE: u32 = (1 * KILO) as u32; +pub const ORACLE_ARRAY_SIZE: u32 = KILO as u32; #[cfg(all(not(debug_assertions), feature = "federation"))] pub const J4RS_BASE_PATH: &str = "../target/release"; diff --git a/connectorx/src/sources/bigquery/mod.rs b/connectorx/src/sources/bigquery/mod.rs index c291e27464..d7bbe3d521 100644 --- a/connectorx/src/sources/bigquery/mod.rs +++ b/connectorx/src/sources/bigquery/mod.rs @@ -36,11 +36,11 @@ impl Dialect for BigQueryDialect { } fn is_identifier_start(&self, ch: char) -> bool { - ('a'..='z').contains(&ch) || ('A'..='Z').contains(&ch) || ch == '_' || ch == '-' + ch.is_ascii_lowercase() || ch.is_ascii_uppercase() || ch == '_' || ch == '-' } fn is_identifier_part(&self, ch: char) -> bool { - self.is_identifier_start(ch) || ('0'..='9').contains(&ch) + self.is_identifier_start(ch) || ch.is_ascii_digit() } } @@ -232,7 +232,7 @@ impl SourcePartition for BigQuerySourcePartition { } #[throws(BigQuerySourceError)] - fn parser<'a>(&'a mut self) -> Self::Parser<'a> { + fn parser(&mut self) -> Self::Parser<'_> { let job = self.client.job(); let qry = self.rt.block_on(job.query( self.project_id.as_str(), @@ -1136,10 +1136,7 @@ impl<'r, 'a> Produce<'r, Option>> for BigQuerySourceParser { * 1e9) as i64; let secs = timestamp_ns / 1000000000; let nsecs = (timestamp_ns % 1000000000) as u32; - match NaiveDateTime::from_timestamp_opt(secs, nsecs) { - Some(ndt) => Some(DateTime::::from_naive_utc_and_offset(ndt, Utc)), - None => None, - } + NaiveDateTime::from_timestamp_opt(secs, nsecs).map(|ndt| DateTime::::from_naive_utc_and_offset(ndt, Utc)) } } } diff --git a/connectorx/src/sources/mssql/typesystem.rs b/connectorx/src/sources/mssql/typesystem.rs index 03bd95dc91..2da6aa427a 100644 --- a/connectorx/src/sources/mssql/typesystem.rs +++ b/connectorx/src/sources/mssql/typesystem.rs @@ -112,7 +112,7 @@ impl<'a> FromSql<'a> for IntN { ColumnData::U8(Some(d)) => Ok(Some(IntN(*d as i64))), ColumnData::I16(Some(d)) => Ok(Some(IntN(*d as i64))), ColumnData::I32(Some(d)) => Ok(Some(IntN(*d as i64))), - ColumnData::I64(Some(d)) => Ok(Some(IntN(*d as i64))), + ColumnData::I64(Some(d)) => Ok(Some(IntN(*d))), v => Err(tiberius::error::Error::Conversion( format!("cannot interpret {:?} as a intn value", v).into(), )), @@ -126,7 +126,7 @@ impl<'a> FromSql<'a> for FloatN { match value { ColumnData::F32(None) | ColumnData::F64(None) => Ok(None), ColumnData::F32(Some(d)) => Ok(Some(FloatN(*d as f64))), - ColumnData::F64(Some(d)) => Ok(Some(FloatN(*d as f64))), + ColumnData::F64(Some(d)) => Ok(Some(FloatN(*d))), v => Err(tiberius::error::Error::Conversion( format!("cannot interpret {:?} as a floatn value", v).into(), )), diff --git a/connectorx/src/sources/mysql/mod.rs b/connectorx/src/sources/mysql/mod.rs index 4c82619d17..5b3d039609 100644 --- a/connectorx/src/sources/mysql/mod.rs +++ b/connectorx/src/sources/mysql/mod.rs @@ -98,7 +98,7 @@ where let mut conn = self.pool.get()?; let first_query = &self.queries[0]; - match conn.prep(&*first_query) { + match conn.prep(first_query) { Ok(stmt) => { let (names, types) = stmt .columns() diff --git a/connectorx/src/sources/oracle/mod.rs b/connectorx/src/sources/oracle/mod.rs index af5faf503a..07d4c3337c 100644 --- a/connectorx/src/sources/oracle/mod.rs +++ b/connectorx/src/sources/oracle/mod.rs @@ -34,13 +34,13 @@ pub struct OracleDialect {} // implementation copy from AnsiDialect impl Dialect for OracleDialect { fn is_identifier_start(&self, ch: char) -> bool { - ('a'..='z').contains(&ch) || ('A'..='Z').contains(&ch) + ch.is_ascii_lowercase() || ch.is_ascii_uppercase() } fn is_identifier_part(&self, ch: char) -> bool { - ('a'..='z').contains(&ch) - || ('A'..='Z').contains(&ch) - || ('0'..='9').contains(&ch) + ch.is_ascii_lowercase() + || ch.is_ascii_uppercase() + || ch.is_ascii_digit() || ch == '_' } } @@ -264,7 +264,7 @@ impl<'a> OracleTextSourceParser<'a> { .build()?; let rows: OwningHandle>, DummyBox>> = OwningHandle::new_with_fn(Box::new(stmt), |stmt: *const Statement<'a>| unsafe { - DummyBox((&mut *(stmt as *mut Statement<'_>)).query(&[]).unwrap()) + DummyBox((*(stmt as *mut Statement<'_>)).query(&[]).unwrap()) }); Self { diff --git a/connectorx/src/sources/postgres/mod.rs b/connectorx/src/sources/postgres/mod.rs index e83a57fb89..bf8892e641 100644 --- a/connectorx/src/sources/postgres/mod.rs +++ b/connectorx/src/sources/postgres/mod.rs @@ -167,7 +167,7 @@ where self.names = names; self.schema = pg_types .iter() - .map(|t| PostgresTypeSystem::from(t)) + .map(PostgresTypeSystem::from) .collect(); self.pg_schema = self .schema @@ -718,7 +718,7 @@ impl<'r, 'a> Produce<'r, Vec> for PostgresCSVSourceParser<'a> { "{}" => vec![], _ if s.len() < 3 => throw!(ConnectorXError::cannot_produce::(Some(s.into()))), s => s[1..s.len() - 1] - .split(",") + .split(',') .map(|v| match v { "t" => Ok(true), "f" => Ok(false), @@ -742,7 +742,7 @@ impl<'r, 'a> Produce<'r, Option>> for PostgresCSVSourceParser<'a> { _ if s.len() < 3 => throw!(ConnectorXError::cannot_produce::(Some(s.into()))), s => Some( s[1..s.len() - 1] - .split(",") + .split(',') .map(|v| match v { "t" => Ok(true), "f" => Ok(false), @@ -1409,7 +1409,7 @@ impl<'r> Produce<'r, Vec> for PostgresSimpleSourceParser { "" => throw!(anyhow!("Cannot parse NULL in non-NULL column.")), "{}" => vec![], _ => rem_first_and_last(s) - .split(",") + .split(',') .map(|token| match token { "t" => Ok(true), "f" => Ok(false), @@ -1445,7 +1445,7 @@ impl<'r> Produce<'r, Option>> for PostgresSimpleSourceParser { "{}" => Some(vec![]), _ => Some( rem_first_and_last(s) - .split(",") + .split(',') .map(|token| match token { "t" => Ok(true), "f" => Ok(false), diff --git a/connectorx/src/sources/sqlite/mod.rs b/connectorx/src/sources/sqlite/mod.rs index 3b11ac56de..6187a54e3b 100644 --- a/connectorx/src/sources/sqlite/mod.rs +++ b/connectorx/src/sources/sqlite/mod.rs @@ -265,7 +265,7 @@ impl<'a> SQLiteSourcePartitionParser<'a> { // keeps its address static on the heap, thus the borrow of MyRows keeps valid. let rows: OwningHandle>, DummyBox>> = OwningHandle::new_with_fn(Box::new(stmt), |stmt: *const Statement<'a>| unsafe { - DummyBox((&mut *(stmt as *mut Statement<'_>)).query([]).unwrap()) + DummyBox((*(stmt as *mut Statement<'_>)).query([]).unwrap()) }); Self { rows, diff --git a/connectorx/src/sql.rs b/connectorx/src/sql.rs index 4173076442..cd22c06f42 100644 --- a/connectorx/src/sql.rs +++ b/connectorx/src/sql.rs @@ -4,8 +4,9 @@ use crate::sources::oracle::OracleDialect; use fehler::{throw, throws}; use log::{debug, trace, warn}; use sqlparser::ast::{ - BinaryOperator, Expr, Function, FunctionArg, Ident, ObjectName, Query, Select, SelectItem, - SetExpr, Statement, TableAlias, TableFactor, TableWithJoins, Value, + BinaryOperator, Expr, Function, FunctionArg, FunctionArgExpr, Ident, ObjectName, Query, Select, + SelectItem, SetExpr, Statement, TableAlias, TableFactor, TableWithJoins, Value, + WildcardAdditionalOptions, }; use sqlparser::dialect::Dialect; use sqlparser::parser::Parser; @@ -118,8 +119,9 @@ fn wrap_query( }; Statement::Query(Box::new(Query { with, - body: SetExpr::Select(Box::new(Select { - distinct: false, + locks: vec![], + body: Box::new(SetExpr::Select(Box::new(Select { + distinct: None, top: None, projection, from: vec![TableWithJoins { @@ -137,7 +139,10 @@ fn wrap_query( distribute_by: vec![], sort_by: vec![], having: None, - })), + into: None, + named_window: vec![], + qualify: None, + }))), order_by: vec![], limit: None, offset: None, @@ -164,7 +169,7 @@ trait QueryExt { impl QueryExt for Query { fn as_select_mut(&mut self) -> Option<&mut Select> { - match self.body { + match *self.body { SetExpr::Select(ref mut select) => Some(select), _ => None, } @@ -198,9 +203,11 @@ pub fn count_query(sql: &CXQuery, dialect: &T) -> CXQuery { @@ -393,7 +400,7 @@ pub fn single_col_partition_query( ast_part = wrap_query( &mut query, - vec![SelectItem::Wildcard], + vec![SelectItem::Wildcard(WildcardAdditionalOptions::default())], Some(selection), table_alias, ); @@ -417,16 +424,18 @@ pub fn get_partition_range_query(sql: &str, col: &str, dialect: &T) #[allow(unused_mut)] let mut table_alias = RANGE_TMP_TAB_NAME; #[allow(unused_mut)] - let mut args = vec![FunctionArg::Unnamed(Expr::CompoundIdentifier(vec![ - Ident { - value: RANGE_TMP_TAB_NAME.to_string(), - quote_style: None, - }, - Ident { - value: col.to_string(), - quote_style: None, - }, - ]))]; + let mut args = vec![FunctionArg::Unnamed(FunctionArgExpr::Expr( + Expr::CompoundIdentifier(vec![ + Ident { + value: RANGE_TMP_TAB_NAME.to_string(), + quote_style: None, + }, + Ident { + value: col.to_string(), + quote_style: None, + }, + ]), + ))]; // HACK: Some dialect (e.g. Oracle) does not support "AS" for alias #[cfg(feature = "src_oracle")] @@ -463,6 +472,8 @@ pub fn get_partition_range_query(sql: &str, col: &str, dialect: &T) args: args.clone(), over: None, distinct: false, + order_by: vec![], + special: false, })), SelectItem::UnnamedExpr(Expr::Function(Function { name: ObjectName(vec![Ident { @@ -472,6 +483,8 @@ pub fn get_partition_range_query(sql: &str, col: &str, dialect: &T) args, over: None, distinct: false, + order_by: vec![], + special: false, })), ]; ast_range = wrap_query(&mut query, projection, None, table_alias); @@ -519,36 +532,44 @@ pub fn get_partition_range_query_sep( value: "min".to_string(), quote_style: None, }]), - args: vec![FunctionArg::Unnamed(Expr::CompoundIdentifier(vec![ - Ident { - value: RANGE_TMP_TAB_NAME.to_string(), - quote_style: None, - }, - Ident { - value: col.to_string(), - quote_style: None, - }, - ]))], + args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr( + Expr::CompoundIdentifier(vec![ + Ident { + value: RANGE_TMP_TAB_NAME.to_string(), + quote_style: None, + }, + Ident { + value: col.to_string(), + quote_style: None, + }, + ]), + ))], over: None, distinct: false, + order_by: vec![], + special: false, }))]; let max_proj = vec![SelectItem::UnnamedExpr(Expr::Function(Function { name: ObjectName(vec![Ident { value: "max".to_string(), quote_style: None, }]), - args: vec![FunctionArg::Unnamed(Expr::CompoundIdentifier(vec![ - Ident { - value: RANGE_TMP_TAB_NAME.into(), - quote_style: None, - }, - Ident { - value: col.into(), - quote_style: None, - }, - ]))], + args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr( + Expr::CompoundIdentifier(vec![ + Ident { + value: RANGE_TMP_TAB_NAME.into(), + quote_style: None, + }, + Ident { + value: col.into(), + quote_style: None, + }, + ]), + ))], over: None, distinct: false, + order_by: vec![], + special: false, }))]; ast_range_min = wrap_query(&mut query.clone(), min_proj, None, RANGE_TMP_TAB_NAME); ast_range_max = wrap_query(&mut query, max_proj, None, RANGE_TMP_TAB_NAME); diff --git a/connectorx/tests/test_mssql.rs b/connectorx/tests/test_mssql.rs index 724682a68d..ba241af186 100644 --- a/connectorx/tests/test_mssql.rs +++ b/connectorx/tests/test_mssql.rs @@ -112,7 +112,7 @@ pub fn verify_arrow_results(result: Vec) { .as_any() .downcast_ref::() .unwrap() - .eq(&Float64Array::from(vec![None, Some(3.1 as f64)]))); + .eq(&Float64Array::from(vec![None, Some(3.1_f64)]))); assert!(rb .column(4) @@ -154,10 +154,10 @@ pub fn verify_arrow_results(result: Vec) { .downcast_ref::() .unwrap() .eq(&Float64Array::from(vec![ - Some(2.2 as f64), - Some(3 as f64), - Some(7.8 as f64), - Some(-10 as f64), + Some(2.2_f64), + Some(3_f64), + Some(7.8_f64), + Some(-10_f64), ]))); assert!(rb diff --git a/connectorx/tests/test_postgres.rs b/connectorx/tests/test_postgres.rs index df4850be02..2beb6f14fa 100644 --- a/connectorx/tests/test_postgres.rs +++ b/connectorx/tests/test_postgres.rs @@ -190,9 +190,7 @@ fn test_postgres_agg() { builder, &mut destination, &queries, - Some(format!( - "SELECT test_bool, SUM(test_float) FROM test_table GROUP BY test_bool" - )), + Some("SELECT test_bool, SUM(test_float) FROM test_table GROUP BY test_bool".to_string()), ); dispatcher.run().expect("run dispatcher");