diff --git a/ibis-server/tests/conftest.py b/ibis-server/tests/conftest.py index bc60a822d..8332f040e 100644 --- a/ibis-server/tests/conftest.py +++ b/ibis-server/tests/conftest.py @@ -11,7 +11,7 @@ def file_path(path: str) -> str: return os.path.join(os.path.dirname(__file__), path) -DATAFUSION_FUNCTION_COUNT = 271 +DATAFUSION_FUNCTION_COUNT = 273 @pytest.fixture(scope="session") diff --git a/wren-core-py/Cargo.lock b/wren-core-py/Cargo.lock index 8e83fe547..e59fd9c3a 100644 --- a/wren-core-py/Cargo.lock +++ b/wren-core-py/Cargo.lock @@ -140,9 +140,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "arrow" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf3437355979f1e93ba84ba108c38be5767713051f3c8ffbf07c094e2e61f9f" +checksum = "dc208515aa0151028e464cc94a692156e945ce5126abd3537bb7fd6ba2143ed1" dependencies = [ "arrow-arith", "arrow-array", @@ -161,24 +161,23 @@ dependencies = [ [[package]] name = "arrow-arith" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31dce77d2985522288edae7206bffd5fc4996491841dda01a13a58415867e681" +checksum = "e07e726e2b3f7816a85c6a45b6ec118eeeabf0b2a8c208122ad949437181f49a" dependencies = [ "arrow-array", "arrow-buffer", "arrow-data", "arrow-schema", "chrono", - "half", "num", ] [[package]] name = "arrow-array" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d45fe6d3faed0435b7313e59a02583b14c6c6339fa7729e94c32a20af319a79" +checksum = "a2262eba4f16c78496adfd559a29fe4b24df6088efc9985a873d58e92be022d5" dependencies = [ "ahash", "arrow-buffer", @@ -193,9 +192,9 @@ dependencies = [ [[package]] name = "arrow-buffer" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b02656a35cc103f28084bc80a0159668e0a680d919cef127bd7e0aaccb06ec1" +checksum = "4e899dade2c3b7f5642eb8366cfd898958bcca099cde6dfea543c7e8d3ad88d4" dependencies = [ "bytes", "half", @@ -204,9 +203,9 @@ dependencies = [ [[package]] name = "arrow-cast" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c73c6233c5b5d635a56f6010e6eb1ab9e30e94707db21cea03da317f67d84cf3" +checksum = "4103d88c5b441525ed4ac23153be7458494c2b0c9a11115848fdb9b81f6f886a" dependencies = [ "arrow-array", "arrow-buffer", @@ -225,28 +224,25 @@ dependencies = [ [[package]] name = "arrow-csv" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec222848d70fea5a32af9c3602b08f5d740d5e2d33fbd76bf6fd88759b5b13a7" +checksum = "43d3cb0914486a3cae19a5cad2598e44e225d53157926d0ada03c20521191a65" dependencies = [ "arrow-array", - "arrow-buffer", "arrow-cast", - "arrow-data", "arrow-schema", "chrono", "csv", "csv-core", "lazy_static", - "lexical-core", "regex", ] [[package]] name = "arrow-data" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f2861ffa86f107b8ab577d86cff7c7a490243eabe961ba1e1af4f27542bb79" +checksum = "0a329fb064477c9ec5f0870d2f5130966f91055c7c5bce2b3a084f116bc28c3b" dependencies = [ "arrow-buffer", "arrow-schema", @@ -256,13 +252,12 @@ dependencies = [ [[package]] name = "arrow-ipc" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0270dc511f11bb5fa98a25020ad51a99ca5b08d8a8dfbd17503bb9dba0388f0b" +checksum = "ddecdeab02491b1ce88885986e25002a3da34dd349f682c7cfe67bab7cc17b86" dependencies = [ "arrow-array", "arrow-buffer", - "arrow-cast", "arrow-data", "arrow-schema", "flatbuffers", @@ -271,9 +266,9 @@ dependencies = [ [[package]] name = "arrow-json" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eff38eeb8a971ad3a4caf62c5d57f0cff8a48b64a55e3207c4fd696a9234aad" +checksum = "d03b9340013413eb84868682ace00a1098c81a5ebc96d279f7ebf9a4cac3c0fd" dependencies = [ "arrow-array", "arrow-buffer", @@ -291,26 +286,23 @@ dependencies = [ [[package]] name = "arrow-ord" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f202a879d287099139ff0d121e7f55ae5e0efe634b8cf2106ebc27a8715dee" +checksum = "f841bfcc1997ef6ac48ee0305c4dfceb1f7c786fe31e67c1186edf775e1f1160" dependencies = [ "arrow-array", "arrow-buffer", "arrow-data", "arrow-schema", "arrow-select", - "half", - "num", ] [[package]] name = "arrow-row" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f936954991c360ba762dff23f5dda16300774fafd722353d9683abd97630ae" +checksum = "1eeb55b0a0a83851aa01f2ca5ee5648f607e8506ba6802577afdda9d75cdedcd" dependencies = [ - "ahash", "arrow-array", "arrow-buffer", "arrow-data", @@ -320,15 +312,15 @@ dependencies = [ [[package]] name = "arrow-schema" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9579b9d8bce47aa41389fe344f2c6758279983b7c0ebb4013e283e3e91bb450e" +checksum = "85934a9d0261e0fa5d4e2a5295107d743b543a6e0484a835d4b8db2da15306f9" [[package]] name = "arrow-select" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7471ba126d0b0aaa24b50a36bc6c25e4e74869a1fd1a5553357027a0b1c8d1f1" +checksum = "7e2932aece2d0c869dd2125feb9bd1709ef5c445daa3838ac4112dcfa0fda52c" dependencies = [ "ahash", "arrow-array", @@ -340,9 +332,9 @@ dependencies = [ [[package]] name = "arrow-string" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72993b01cb62507b06f1fb49648d7286c8989ecfabdb7b77a750fcb54410731b" +checksum = "912e38bd6a7a7714c1d9b61df80315685553b7455e8a6045c27531d8ecd5b458" dependencies = [ "arrow-array", "arrow-buffer", @@ -455,9 +447,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.5" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ee0c1824c4dea5b5f81736aff91bae041d2c07ee1192bec91054e10e3e601e" +checksum = "675f87afced0413c9bb02843499dbbd3882a237645883f71a2b59644a6d2f753" dependencies = [ "arrayref", "arrayvec", @@ -510,9 +502,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bzip2" @@ -526,22 +518,20 @@ dependencies = [ [[package]] name = "bzip2" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bafdbf26611df8c14810e268ddceda071c297570a5fb360ceddf617fe417ef58" +checksum = "49ecfb22d906f800d4fe833b6282cf4dc1c298f5057ca0b5445e5c209735ca47" dependencies = [ "bzip2-sys", - "libc", ] [[package]] name = "bzip2-sys" -version = "0.1.11+1.0.8" +version = "0.1.13+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" dependencies = [ "cc", - "libc", "pkg-config", ] @@ -757,29 +747,31 @@ dependencies = [ [[package]] name = "datafusion" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46b879c1aa3a85ecbfa376704f0fe4bfebae1a44a5d35faa4466bf85469b6a0e" dependencies = [ "arrow", - "arrow-array", "arrow-ipc", "arrow-schema", - "async-compression", "async-trait", "bytes", - "bzip2 0.5.0", + "bzip2 0.5.2", "chrono", - "dashmap", "datafusion-catalog", + "datafusion-catalog-listing", "datafusion-common", "datafusion-common-runtime", + "datafusion-datasource", "datafusion-execution", "datafusion-expr", + "datafusion-expr-common", "datafusion-functions", "datafusion-functions-aggregate", "datafusion-functions-nested", "datafusion-functions-table", "datafusion-functions-window", + "datafusion-macros", "datafusion-optimizer", "datafusion-physical-expr", "datafusion-physical-expr-common", @@ -788,8 +780,7 @@ dependencies = [ "datafusion-sql", "flate2", "futures", - "glob", - "itertools", + "itertools 0.14.0", "log", "object_store", "parking_lot", @@ -799,7 +790,6 @@ dependencies = [ "sqlparser", "tempfile", "tokio", - "tokio-util", "url", "uuid", "xz2", @@ -808,28 +798,56 @@ dependencies = [ [[package]] name = "datafusion-catalog" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e42f516243fe30137f2b7d5712611286baf8d1d758a46157bada7c35fdf38df" dependencies = [ - "arrow-schema", + "arrow", "async-trait", + "dashmap", "datafusion-common", "datafusion-execution", "datafusion-expr", "datafusion-physical-plan", + "datafusion-sql", + "futures", + "itertools 0.14.0", + "log", "parking_lot", ] +[[package]] +name = "datafusion-catalog-listing" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e495290c231d617f0a940860a885cb2f4c3efe46c1983c30d3fa12faf1ccb208" +dependencies = [ + "arrow", + "async-trait", + "datafusion-catalog", + "datafusion-common", + "datafusion-datasource", + "datafusion-execution", + "datafusion-expr", + "datafusion-physical-expr", + "datafusion-physical-expr-common", + "datafusion-physical-plan", + "futures", + "log", + "object_store", + "tokio", +] + [[package]] name = "datafusion-common" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af67ddc82e1c8e6843c326ca13aa20e5420cce9f886b4e1ee39ea43defae3145" dependencies = [ "ahash", "arrow", - "arrow-array", - "arrow-buffer", - "arrow-schema", + "arrow-ipc", + "base64", "half", "hashbrown 0.14.5", "indexmap 2.7.1", @@ -846,22 +864,59 @@ dependencies = [ [[package]] name = "datafusion-common-runtime" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36ee9403a2ec39183437825d232f556a5dee89f13f6fd78f8c7f8f999489e4ca" dependencies = [ "log", "tokio", ] +[[package]] +name = "datafusion-datasource" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8c8b7568b638dd309bcc1cdeb66776f233b110d44bdc6fd67ef1919f9ec9803" +dependencies = [ + "arrow", + "async-compression", + "async-trait", + "bytes", + "bzip2 0.5.2", + "chrono", + "datafusion-catalog", + "datafusion-common", + "datafusion-common-runtime", + "datafusion-execution", + "datafusion-expr", + "datafusion-physical-expr", + "datafusion-physical-expr-common", + "datafusion-physical-plan", + "flate2", + "futures", + "glob", + "itertools 0.14.0", + "log", + "object_store", + "rand", + "tokio", + "tokio-util", + "url", + "xz2", + "zstd", +] + [[package]] name = "datafusion-doc" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8612c81304578a2e2b82d31caf8173312cb086a7a23a23556b9fff3ac7c18221" [[package]] name = "datafusion-execution" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3591e6d4900e57bad7f861f14f5c763f716da76553b0d037ec91c192c876f09c" dependencies = [ "arrow", "dashmap", @@ -878,8 +933,9 @@ dependencies = [ [[package]] name = "datafusion-expr" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033d0f6198d177f50a7721d80db141af15dd12f45ad6dce34e2cdbb6538e39d" dependencies = [ "arrow", "chrono", @@ -898,18 +954,22 @@ dependencies = [ [[package]] name = "datafusion-expr-common" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56def48a7dfb9f92aa18e18dfdffaca79b5383f03c59bb0107959c1698634557" dependencies = [ "arrow", "datafusion-common", - "itertools", + "indexmap 2.7.1", + "itertools 0.14.0", + "paste", ] [[package]] name = "datafusion-functions" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a79b703b42b0aac97485b84c6810c78114b0974a75a33514840ba0bbe0de38f" dependencies = [ "arrow", "arrow-buffer", @@ -923,9 +983,8 @@ dependencies = [ "datafusion-expr", "datafusion-expr-common", "datafusion-macros", - "hashbrown 0.14.5", "hex", - "itertools", + "itertools 0.14.0", "log", "md-5", "rand", @@ -937,12 +996,12 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdad20375e85365ed262b5583955c308840efc6ff9271ff463cf86789adfb686" dependencies = [ "ahash", "arrow", - "arrow-schema", "datafusion-common", "datafusion-doc", "datafusion-execution", @@ -958,8 +1017,9 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate-common" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff73249ee3cdc81ad04317d3b4231fc02a8c03a3a1b4b13953244e6443f6b498" dependencies = [ "ahash", "arrow", @@ -970,29 +1030,30 @@ dependencies = [ [[package]] name = "datafusion-functions-nested" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20dcd70c58f17b7ce937866e43c75293a3250aadc1db830ad6d502967aaffb40" dependencies = [ "arrow", - "arrow-array", - "arrow-buffer", "arrow-ord", - "arrow-schema", "datafusion-common", + "datafusion-doc", "datafusion-execution", "datafusion-expr", "datafusion-functions", "datafusion-functions-aggregate", + "datafusion-macros", "datafusion-physical-expr-common", - "itertools", + "itertools 0.14.0", "log", "paste", ] [[package]] name = "datafusion-functions-table" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac12628c3e43461118e95d5772f729e1cc39db883d8ee52e4b80038b0f614bbf" dependencies = [ "arrow", "async-trait", @@ -1006,8 +1067,9 @@ dependencies = [ [[package]] name = "datafusion-functions-window" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03eb449555c7cc03bb61d43d90edef70d070d34bc4a0d8f7e358d157232f3220" dependencies = [ "datafusion-common", "datafusion-doc", @@ -1022,8 +1084,9 @@ dependencies = [ [[package]] name = "datafusion-functions-window-common" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a0c7606e568ee6a15d33a2532eb0d18e7769bb88af55f6b70be4db9fd937d18" dependencies = [ "datafusion-common", "datafusion-physical-expr-common", @@ -1031,17 +1094,20 @@ dependencies = [ [[package]] name = "datafusion-macros" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64030e805d3d257e3012e4378500d4ac90b1ebacd03f1110e8ec927b77f09486" dependencies = [ + "datafusion-expr", "quote", "syn", ] [[package]] name = "datafusion-optimizer" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6af7bdae7565aa7a4cb1deb7fe18d89c63c5d93b5203b473ca1dbe02a1cd3d" dependencies = [ "arrow", "chrono", @@ -1049,7 +1115,7 @@ dependencies = [ "datafusion-expr", "datafusion-physical-expr", "indexmap 2.7.1", - "itertools", + "itertools 0.14.0", "log", "recursive", "regex", @@ -1058,14 +1124,12 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f68601feda90c255c9023a881e833efca9d7539bab0565ac1355b0249326e91" dependencies = [ "ahash", "arrow", - "arrow-array", - "arrow-buffer", - "arrow-schema", "datafusion-common", "datafusion-expr", "datafusion-expr-common", @@ -1074,50 +1138,53 @@ dependencies = [ "half", "hashbrown 0.14.5", "indexmap 2.7.1", - "itertools", + "itertools 0.14.0", "log", "paste", - "petgraph 0.6.5", + "petgraph", ] [[package]] name = "datafusion-physical-expr-common" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00c1a08b00d340ca3bc1cd2f094ecaeaf6f099a2980e11255976660fa0409182" dependencies = [ "ahash", "arrow", "datafusion-common", "datafusion-expr-common", "hashbrown 0.14.5", - "itertools", + "itertools 0.14.0", ] [[package]] name = "datafusion-physical-optimizer" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd34f3438cf9629ea0e3425027582334fb6671a05ee43671ca3c47896b75dda" dependencies = [ "arrow", "datafusion-common", "datafusion-execution", + "datafusion-expr", "datafusion-expr-common", "datafusion-physical-expr", + "datafusion-physical-expr-common", "datafusion-physical-plan", - "itertools", + "itertools 0.14.0", "log", "recursive", ] [[package]] name = "datafusion-physical-plan" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7624484ada341d30ef465eae61f760e779f080c621bbc3dc0335a75fa78e8dec" dependencies = [ "ahash", "arrow", - "arrow-array", - "arrow-buffer", "arrow-ord", "arrow-schema", "async-trait", @@ -1133,7 +1200,7 @@ dependencies = [ "half", "hashbrown 0.14.5", "indexmap 2.7.1", - "itertools", + "itertools 0.14.0", "log", "parking_lot", "pin-project-lite", @@ -1142,12 +1209,11 @@ dependencies = [ [[package]] name = "datafusion-sql" -version = "44.0.0" -source = "git+https://github.com/goldmedal/datafusion.git?branch=wren%2Ffoward-to-compund-access#56a96ab5b5de4f8e31cc4d95d95481afccc3897c" +version = "46.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e717736a394ed92d9dcf2d74439c655474dd39aa65a064a6bae697b6d20e5fe" dependencies = [ "arrow", - "arrow-array", - "arrow-schema", "bigdecimal", "datafusion-common", "datafusion-expr", @@ -1241,12 +1307,6 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "fixedbitset" version = "0.5.7" @@ -1265,9 +1325,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" dependencies = [ "crc32fast", "miniz_oxide", @@ -1696,6 +1756,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.14" @@ -1793,9 +1862,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.169" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "libm" @@ -1878,9 +1947,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] @@ -1985,7 +2054,7 @@ dependencies = [ "chrono", "futures", "humantime", - "itertools", + "itertools 0.13.0", "parking_lot", "percent-encoding", "snafu", @@ -2035,9 +2104,9 @@ dependencies = [ [[package]] name = "parquet" -version = "53.4.0" +version = "54.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8957c0c95a6a1804f3e51a18f69df29be53856a8c5768cc9b6d00fcafcd2917c" +checksum = "f88838dca3b84d41444a0341b19f347e8098a3898b0f21536654b8b799e11abd" dependencies = [ "ahash", "arrow-array", @@ -2061,6 +2130,7 @@ dependencies = [ "object_store", "paste", "seq-macro", + "simdutf8", "snap", "thrift", "tokio", @@ -2090,23 +2160,13 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "petgraph" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" -dependencies = [ - "fixedbitset 0.4.2", - "indexmap 2.7.1", -] - [[package]] name = "petgraph" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ - "fixedbitset 0.5.7", + "fixedbitset", "indexmap 2.7.1", ] @@ -2117,7 +2177,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c164f0ab4e02b69ff6172de80d9c1a31a9dd21c15c7b728b632442a19c9fd96" dependencies = [ "base64", - "petgraph 0.7.1", + "petgraph", ] [[package]] @@ -2566,6 +2626,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + [[package]] name = "siphasher" version = "1.0.1" @@ -2616,8 +2682,9 @@ checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "sqlparser" -version = "0.53.0" -source = "git+https://github.com/apache/datafusion-sqlparser-rs.git?rev=6cbcfda74618e9d42caf4875b135288be1594cf0#6cbcfda74618e9d42caf4875b135288be1594cf0" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66e3b7374ad4a6af849b08b3e7a6eda0edbd82f0fd59b57e22671bf16979899" dependencies = [ "log", "recursive", @@ -2627,7 +2694,8 @@ dependencies = [ [[package]] name = "sqlparser_derive" version = "0.3.0" -source = "git+https://github.com/apache/datafusion-sqlparser-rs.git?rev=6cbcfda74618e9d42caf4875b135288be1594cf0#6cbcfda74618e9d42caf4875b135288be1594cf0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da5fc6819faabb412da764b99d3b713bb55083c11e7e0c00144d386cd6a1939c" dependencies = [ "proc-macro2", "quote", @@ -2968,11 +3036,13 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.12.1" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" +checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.3.1", + "js-sys", + "wasm-bindgen", ] [[package]] @@ -3193,7 +3263,7 @@ dependencies = [ "env_logger", "log", "parking_lot", - "petgraph 0.7.1", + "petgraph", "petgraph-evcxr", "regex", "serde", diff --git a/wren-core-py/tests/test_modeling_core.py b/wren-core-py/tests/test_modeling_core.py index 0bd85f808..d86880d90 100644 --- a/wren-core-py/tests/test_modeling_core.py +++ b/wren-core-py/tests/test_modeling_core.py @@ -106,7 +106,7 @@ def test_read_function_list(): path = "tests/functions.csv" session_context = SessionContext(manifest_str, path) functions = session_context.get_available_functions() - assert len(functions) == 273 + assert len(functions) == 275 rewritten_sql = session_context.transform_sql( "SELECT add_two(c_custkey) FROM my_catalog.my_schema.customer" @@ -118,7 +118,7 @@ def test_read_function_list(): session_context = SessionContext(manifest_str, None) functions = session_context.get_available_functions() - assert len(functions) == 271 + assert len(functions) == 273 def test_get_available_functions(): diff --git a/wren-core/Cargo.toml b/wren-core/Cargo.toml index 0ba351ff0..655cfc468 100644 --- a/wren-core/Cargo.toml +++ b/wren-core/Cargo.toml @@ -15,7 +15,7 @@ version = "0.1.0" [workspace.dependencies] async-trait = "0.1.80" # We require the latest sqlparser-rs to support the latest SQL syntax -datafusion = { git = "https://github.com/goldmedal/datafusion.git", branch = "wren/foward-to-compund-access" } +datafusion = { version = "46.0.0" } env_logger = "0.11.3" hashbrown = "0.15.2" log = { version = "0.4.14" } diff --git a/wren-core/core/src/logical_plan/analyze/model_anlayze.rs b/wren-core/core/src/logical_plan/analyze/model_anlayze.rs index 294047331..7b2ddec51 100644 --- a/wren-core/core/src/logical_plan/analyze/model_anlayze.rs +++ b/wren-core/core/src/logical_plan/analyze/model_anlayze.rs @@ -2,9 +2,8 @@ use crate::logical_plan::analyze::plan::ModelPlanNode; use crate::logical_plan::utils::{belong_to_mdl, expr_to_columns}; use crate::mdl::utils::quoted; use crate::mdl::{AnalyzedWrenMDL, Dataset, SessionStateRef}; -use datafusion::catalog_common::TableReference; use datafusion::common::tree_node::{Transformed, TransformedResult, TreeNode}; -use datafusion::common::{internal_err, plan_err, Column, DFSchemaRef, Result}; +use datafusion::common::{internal_err, plan_err, Column, DFSchemaRef, Result, Spans}; use datafusion::config::ConfigOptions; use datafusion::error::DataFusionError; use datafusion::logical_expr::expr::Alias; @@ -14,6 +13,7 @@ use datafusion::logical_expr::{ Window, }; use datafusion::optimizer::AnalyzerRule; +use datafusion::sql::TableReference; use std::cell::{RefCell, RefMut}; use std::collections::{HashMap, HashSet, VecDeque}; use std::fmt::Debug; @@ -255,6 +255,7 @@ impl ModelAnalyzeRule { Expr::Column(Column { relation: Some(relation), name, + .. }) => { // only collect the required column if the relation belongs to the mdl if belong_to_mdl( @@ -661,7 +662,7 @@ impl ModelAnalyzeRule { schema: DFSchemaRef, ) -> Result> { match expr { - Expr::Column(Column { relation, name }) => { + Expr::Column(Column { relation, name, .. }) => { if let Some(relation) = relation { Ok(self.rewrite_column_qualifier(relation, name, alias_model)) } else { @@ -725,6 +726,7 @@ impl ModelAnalyzeRule { Transformed::no(Expr::Column(Column { relation: Some(relation), name, + spans: Spans::new(), })) } } diff --git a/wren-core/core/src/logical_plan/analyze/plan.rs b/wren-core/core/src/logical_plan/analyze/plan.rs index 27988c7a0..87dab9f99 100644 --- a/wren-core/core/src/logical_plan/analyze/plan.rs +++ b/wren-core/core/src/logical_plan/analyze/plan.rs @@ -291,6 +291,8 @@ impl ModelPlanNodeBuilder { if required_fields.is_empty() { source_required_fields.insert( 0, + // TODO: remove deprecated wildcard + #[allow(deprecated)] Expr::Wildcard { qualifier: None, options: Box::new(WildcardOptions::default()), @@ -740,6 +742,8 @@ impl ModelSourceNode { let mut required_exprs_buffer = BTreeSet::new(); let mut fields_buffer = BTreeSet::new(); for expr in required_exprs.iter() { + // TODO: remove deprecated wildcard + #[allow(deprecated)] if let Expr::Wildcard { qualifier, .. } = expr { let model = if let Some(model) = qualifier { let Some(model) = diff --git a/wren-core/core/src/logical_plan/utils.rs b/wren-core/core/src/logical_plan/utils.rs index 27b82dae3..5568298bb 100644 --- a/wren-core/core/src/logical_plan/utils.rs +++ b/wren-core/core/src/logical_plan/utils.rs @@ -6,7 +6,6 @@ use crate::mdl::{Dataset, SessionStateRef}; use datafusion::arrow::datatypes::{ DataType, Field, IntervalUnit, Schema, SchemaBuilder, SchemaRef, TimeUnit, }; -use datafusion::catalog_common::TableReference; use datafusion::common::plan_err; use datafusion::common::tree_node::{ Transformed, TransformedResult, TreeNode, TreeNodeRecursion, @@ -18,6 +17,7 @@ use datafusion::logical_expr::sqlparser::dialect::GenericDialect; use datafusion::logical_expr::{builder::LogicalTableSource, Expr, TableSource}; use datafusion::sql::sqlparser::ast; use datafusion::sql::sqlparser::parser::Parser; +use datafusion::sql::TableReference; use log::debug; use petgraph::dot::{Config, Dot}; use petgraph::Graph; @@ -256,6 +256,8 @@ pub fn expr_to_columns( accum: &mut HashSet, ) -> Result<()> { expr.apply(|expr| { + // TODO: remove deprecated wildcard + #[allow(deprecated)] match expr { Expr::Column(qc) => { accum.insert(qc.clone()); diff --git a/wren-core/core/src/mdl/context.rs b/wren-core/core/src/mdl/context.rs index 2798d859f..81b0f4be3 100644 --- a/wren-core/core/src/mdl/context.rs +++ b/wren-core/core/src/mdl/context.rs @@ -11,14 +11,13 @@ use crate::mdl::manifest::Model; use crate::mdl::{AnalyzedWrenMDL, SessionStateRef, WrenMDL}; use async_trait::async_trait; use datafusion::arrow::datatypes::SchemaRef; -use datafusion::catalog::Session; -use datafusion::catalog_common::memory::{MemoryCatalogProvider, MemorySchemaProvider}; +use datafusion::catalog::memory::MemoryCatalogProvider; +use datafusion::catalog::{MemorySchemaProvider, Session}; use datafusion::catalog_common::CatalogProvider; use datafusion::common::Result; use datafusion::datasource::{TableProvider, TableType, ViewTable}; use datafusion::execution::session_state::SessionStateBuilder; use datafusion::logical_expr::Expr; -use datafusion::optimizer::analyzer::count_wildcard_rule::CountWildcardRule; use datafusion::optimizer::analyzer::expand_wildcard_rule::ExpandWildcardRule; use datafusion::optimizer::analyzer::inline_table_scan::InlineTableScan; use datafusion::optimizer::analyzer::type_coercion::TypeCoercion; @@ -111,7 +110,6 @@ fn analyze_rule_for_local_runtime( Arc::new(ExpandWildcardRule::new()), // [Expr::Wildcard] should be expanded before [TypeCoercion] Arc::new(TypeCoercion::new()), - Arc::new(CountWildcardRule::new()), ] } diff --git a/wren-core/core/src/mdl/dialect/utils.rs b/wren-core/core/src/mdl/dialect/utils.rs index 5c74a5d81..0a6d47d5d 100644 --- a/wren-core/core/src/mdl/dialect/utils.rs +++ b/wren-core/core/src/mdl/dialect/utils.rs @@ -29,6 +29,8 @@ pub(crate) fn function_args_to_sql( ) -> Result> { args.iter() .map(|e| { + // TODO: remove deprecated wildcard + #[allow(deprecated)] if matches!( e, Expr::Wildcard { diff --git a/wren-core/core/src/mdl/lineage.rs b/wren-core/core/src/mdl/lineage.rs index 5b368c8b1..6b62f228c 100644 --- a/wren-core/core/src/mdl/lineage.rs +++ b/wren-core/core/src/mdl/lineage.rs @@ -321,7 +321,7 @@ fn get_dataset_link_revers_if_need( #[cfg(test)] mod test { - use datafusion::common::Column; + use datafusion::common::{Column, Spans}; use datafusion::error::Result; use datafusion::sql::TableReference; use std::collections::HashSet; @@ -409,7 +409,8 @@ mod test { assert_eq!(a1_concat_b1.len(), 2); assert!(a1_concat_b1.contains(&Column { relation: Some(TableReference::full("wrenai", "public", "a")), - name: "b.b1".to_string() + name: "b.b1".to_string(), + spans: Spans::new(), })); let a1_concat_c1 = lineage @@ -419,7 +420,8 @@ mod test { assert_eq!(a1_concat_c1.len(), 2); assert!(a1_concat_c1.contains(&Column { relation: Some(TableReference::full("wrenai", "public", "a")), - name: "b.c.c1".to_string() + name: "b.c.c1".to_string(), + spans: Spans::new(), })); Ok(()) } diff --git a/wren-core/core/src/mdl/mod.rs b/wren-core/core/src/mdl/mod.rs index b85d4ed6a..f669a2fd6 100644 --- a/wren-core/core/src/mdl/mod.rs +++ b/wren-core/core/src/mdl/mod.rs @@ -560,13 +560,13 @@ mod test { sql, ) .await?; - let expected = "SELECT profile.totalcost FROM (SELECT totalcost.totalcost FROM \ + let expected = "SELECT \"profile\".totalcost FROM (SELECT totalcost.totalcost FROM \ (SELECT __relation__2.p_custkey AS p_custkey, sum(CAST(__relation__2.o_totalprice AS BIGINT)) AS totalcost FROM \ (SELECT __relation__1.c_custkey, orders.o_custkey, orders.o_totalprice, __relation__1.p_custkey FROM \ (SELECT __source.o_custkey AS o_custkey, __source.o_totalprice AS o_totalprice FROM orders AS __source) AS orders RIGHT JOIN \ - (SELECT customer.c_custkey, profile.p_custkey FROM (SELECT __source.c_custkey AS c_custkey FROM customer AS __source) AS customer RIGHT JOIN \ - (SELECT __source.p_custkey AS p_custkey FROM profile AS __source) AS profile ON customer.c_custkey = profile.p_custkey) AS __relation__1 \ - ON orders.o_custkey = __relation__1.c_custkey) AS __relation__2 GROUP BY __relation__2.p_custkey) AS totalcost) AS profile"; + (SELECT customer.c_custkey, \"profile\".p_custkey FROM (SELECT __source.c_custkey AS c_custkey FROM customer AS __source) AS customer RIGHT JOIN \ + (SELECT __source.p_custkey AS p_custkey FROM \"profile\" AS __source) AS \"profile\" ON customer.c_custkey = \"profile\".p_custkey) AS __relation__1 \ + ON orders.o_custkey = __relation__1.c_custkey) AS __relation__2 GROUP BY __relation__2.p_custkey) AS totalcost) AS \"profile\""; assert_eq!(result, expected); let sql = "select totalcost from profile where p_sex = 'M'"; @@ -578,16 +578,16 @@ mod test { ) .await?; assert_eq!(result, - "SELECT profile.totalcost FROM (SELECT __relation__1.p_sex, __relation__1.totalcost FROM \ - (SELECT totalcost.p_custkey, profile.p_sex, totalcost.totalcost FROM (SELECT __relation__2.p_custkey AS p_custkey, \ + "SELECT \"profile\".totalcost FROM (SELECT __relation__1.p_sex, __relation__1.totalcost FROM \ + (SELECT totalcost.p_custkey, \"profile\".p_sex, totalcost.totalcost FROM (SELECT __relation__2.p_custkey AS p_custkey, \ sum(CAST(__relation__2.o_totalprice AS BIGINT)) AS totalcost FROM (SELECT __relation__1.c_custkey, orders.o_custkey, \ orders.o_totalprice, __relation__1.p_custkey FROM (SELECT __source.o_custkey AS o_custkey, __source.o_totalprice AS o_totalprice \ - FROM orders AS __source) AS orders RIGHT JOIN (SELECT customer.c_custkey, profile.p_custkey FROM \ + FROM orders AS __source) AS orders RIGHT JOIN (SELECT customer.c_custkey, \"profile\".p_custkey FROM \ (SELECT __source.c_custkey AS c_custkey FROM customer AS __source) AS customer RIGHT JOIN \ - (SELECT __source.p_custkey AS p_custkey FROM profile AS __source) AS profile ON customer.c_custkey = profile.p_custkey) AS __relation__1 \ + (SELECT __source.p_custkey AS p_custkey FROM \"profile\" AS __source) AS \"profile\" ON customer.c_custkey = \"profile\".p_custkey) AS __relation__1 \ ON orders.o_custkey = __relation__1.c_custkey) AS __relation__2 GROUP BY __relation__2.p_custkey) AS totalcost RIGHT JOIN \ - (SELECT __source.p_custkey AS p_custkey, __source.p_sex AS p_sex FROM profile AS __source) AS profile \ - ON totalcost.p_custkey = profile.p_custkey) AS __relation__1) AS profile WHERE profile.p_sex = 'M'"); + (SELECT __source.p_custkey AS p_custkey, __source.p_sex AS p_sex FROM \"profile\" AS __source) AS \"profile\" \ + ON totalcost.p_custkey = \"profile\".p_custkey) AS __relation__1) AS \"profile\" WHERE \"profile\".p_sex = 'M'"); Ok(()) } @@ -618,7 +618,7 @@ mod test { assert_eq!(actual, "SELECT \"Customer\".\"Custkey\", \"Customer\".\"Name\" FROM \ (SELECT __source.\"Custkey\" AS \"Custkey\", __source.\"Name\" AS \"Name\" FROM \ - datafusion.public.customer AS __source) AS \"Customer\""); + datafusion.\"public\".customer AS __source) AS \"Customer\""); Ok(()) } @@ -655,7 +655,7 @@ mod test { ) .await?; assert_eq!(actual, "SELECT add_two(\"Customer\".\"Custkey\") FROM (SELECT \"Customer\".\"Custkey\" \ - FROM (SELECT __source.\"Custkey\" AS \"Custkey\" FROM datafusion.public.customer AS __source) AS \"Customer\") AS \"Customer\""); + FROM (SELECT __source.\"Custkey\" AS \"Custkey\" FROM datafusion.\"public\".customer AS __source) AS \"Customer\") AS \"Customer\""); let actual = transform_sql_with_ctx( &ctx, @@ -665,7 +665,7 @@ mod test { ) .await?; assert_eq!(actual, "SELECT median(\"Customer\".\"Custkey\") FROM (SELECT \"Customer\".\"Custkey\", \"Customer\".\"Name\" \ - FROM (SELECT __source.\"Custkey\" AS \"Custkey\", __source.\"Name\" AS \"Name\" FROM datafusion.public.customer AS __source) AS \"Customer\") AS \"Customer\" \ + FROM (SELECT __source.\"Custkey\" AS \"Custkey\", __source.\"Name\" AS \"Name\" FROM datafusion.\"public\".customer AS __source) AS \"Customer\") AS \"Customer\" \ GROUP BY \"Customer\".\"Name\""); // TODO: support window functions analysis @@ -925,7 +925,9 @@ mod test { let sql = "select count(*) from (select 1)"; let actual = transform_sql_with_ctx(&ctx, Arc::clone(&analyzed_mdl), &[], sql).await?; - assert_eq!(actual, "SELECT count(*) FROM (SELECT 1)"); + // TODO: BigQuery doesn't support the alias include invalid characters (e.g. `*`, `()`). + // We should remove the invalid characters for the alias. + assert_eq!(actual, "SELECT count(1) AS \"count(*)\" FROM (SELECT 1)"); Ok(()) } @@ -1062,7 +1064,9 @@ mod test { ) .await?; assert_eq!(actual, - "SELECT count(*) FROM (SELECT artist.cast_timestamptz FROM \ + // TODO: BigQuery doesn't support the alias include invalid characters (e.g. `*`, `()`). + // We should remove the invalid characters for the alias. + "SELECT count(1) AS \"count(*)\" FROM (SELECT artist.cast_timestamptz FROM \ (SELECT CAST(__source.\"出道時間\" AS TIMESTAMP WITH TIME ZONE) AS cast_timestamptz \ FROM artist AS __source) AS artist) AS artist WHERE CAST(artist.cast_timestamptz AS TIMESTAMP) > CAST('2011-01-01 21:00:00' AS TIMESTAMP)"); Ok(()) @@ -1148,7 +1152,7 @@ mod test { "SELECT CAST(timestamp_table.timestamp_col AS TIMESTAMP WITH TIME ZONE) = timestamp_table.timestamptz_col \ FROM (SELECT timestamp_table.timestamp_col, timestamp_table.timestamptz_col FROM \ (SELECT __source.timestamp_col AS timestamp_col, __source.timestamptz_col AS timestamptz_col \ - FROM datafusion.public.timestamp_table AS __source) AS timestamp_table) AS timestamp_table"); + FROM datafusion.\"public\".timestamp_table AS __source) AS timestamp_table) AS timestamp_table"); let sql = r#"select timestamptz_col > cast('2011-01-01 18:00:00' as TIMESTAMP WITH TIME ZONE) from wren.test.timestamp_table"#; let actual = transform_sql_with_ctx( @@ -1160,7 +1164,7 @@ mod test { .await?; // assert the simplified literal will be casted to the timestamp tz assert_eq!(actual, - "SELECT timestamp_table.timestamptz_col > CAST(CAST('2011-01-01 18:00:00' AS TIMESTAMP) AS TIMESTAMP WITH TIME ZONE) FROM (SELECT timestamp_table.timestamptz_col FROM (SELECT __source.timestamptz_col AS timestamptz_col FROM datafusion.public.timestamp_table AS __source) AS timestamp_table) AS timestamp_table" + "SELECT timestamp_table.timestamptz_col > CAST(CAST('2011-01-01 18:00:00' AS TIMESTAMP) AS TIMESTAMP WITH TIME ZONE) FROM (SELECT timestamp_table.timestamptz_col FROM (SELECT __source.timestamptz_col AS timestamptz_col FROM datafusion.\"public\".timestamp_table AS __source) AS timestamp_table) AS timestamp_table" ); let sql = r#"select timestamptz_col > '2011-01-01 18:00:00' from wren.test.timestamp_table"#; @@ -1175,7 +1179,7 @@ mod test { assert_eq!(actual, "SELECT timestamp_table.timestamptz_col > CAST('2011-01-01 18:00:00' AS TIMESTAMP WITH TIME ZONE) \ FROM (SELECT timestamp_table.timestamptz_col FROM (SELECT __source.timestamptz_col AS timestamptz_col \ - FROM datafusion.public.timestamp_table AS __source) AS timestamp_table) AS timestamp_table"); + FROM datafusion.\"public\".timestamp_table AS __source) AS timestamp_table) AS timestamp_table"); let sql = r#"select timestamp_col > cast('2011-01-01 18:00:00' as TIMESTAMP WITH TIME ZONE) from wren.test.timestamp_table"#; let actual = transform_sql_with_ctx( @@ -1189,7 +1193,7 @@ mod test { assert_eq!(actual, "SELECT timestamp_table.timestamp_col > CAST('2011-01-01 18:00:00' AS TIMESTAMP) \ FROM (SELECT timestamp_table.timestamp_col FROM (SELECT __source.timestamp_col AS timestamp_col \ - FROM datafusion.public.timestamp_table AS __source) AS timestamp_table) AS timestamp_table"); + FROM datafusion.\"public\".timestamp_table AS __source) AS timestamp_table) AS timestamp_table"); } Ok(()) } diff --git a/wren-core/sqllogictest/test_files/tpch/q22.slt.part b/wren-core/sqllogictest/test_files/tpch/q22.slt.part index 171b22b50..96e679c37 100644 --- a/wren-core/sqllogictest/test_files/tpch/q22.slt.part +++ b/wren-core/sqllogictest/test_files/tpch/q22.slt.part @@ -16,12 +16,7 @@ # specific language governing permissions and limitations # under the License. -# TODO: -#External error: query failed: DataFusion error: ModelAnalyzeRule -#caused by -#Schema error: No field named customer.c_phone. - -query TIR +query ?IR select cntrycode, count(*) as numcust,