From de47f5605b56b056e2008bf4d8c88bee66207eb5 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 29 Aug 2022 15:10:00 -0400 Subject: [PATCH] chore: Update datafusion (with new sqlparser release) - option 1 (#5433) * chore: Update datafusion pin * chore: Update now that user is a reserved word * chore: Update cargo.lock * fix: update query for user function Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- Cargo.lock | 28 ++++++++++++------------ datafusion/Cargo.toml | 4 ++-- query_tests/cases/in/basic.expected | 4 ++-- query_tests/cases/in/basic.sql | 4 ++-- query_tests/cases/in/timestamps.expected | 2 +- query_tests/cases/in/timestamps.sql | 4 ++-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2c6fd1854..a3abe4e38e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -999,7 +999,7 @@ dependencies = [ [[package]] name = "datafusion" version = "11.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=929eb6d860fb60ba994b24397ad3c3eb7d839cdf#929eb6d860fb60ba994b24397ad3c3eb7d839cdf" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=3df9f8002cf14939a82e5182bab553ee5bf6e37b#3df9f8002cf14939a82e5182bab553ee5bf6e37b" dependencies = [ "ahash 0.8.0", "arrow", @@ -1027,7 +1027,7 @@ dependencies = [ "pin-project-lite", "rand", "smallvec", - "sqlparser 0.20.0", + "sqlparser 0.21.0", "tempfile", "tokio", "tokio-stream", @@ -1038,31 +1038,31 @@ dependencies = [ [[package]] name = "datafusion-common" version = "11.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=929eb6d860fb60ba994b24397ad3c3eb7d839cdf#929eb6d860fb60ba994b24397ad3c3eb7d839cdf" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=3df9f8002cf14939a82e5182bab553ee5bf6e37b#3df9f8002cf14939a82e5182bab553ee5bf6e37b" dependencies = [ "arrow", "object_store", "ordered-float 3.0.0", "parquet", "serde_json", - "sqlparser 0.20.0", + "sqlparser 0.21.0", ] [[package]] name = "datafusion-expr" version = "11.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=929eb6d860fb60ba994b24397ad3c3eb7d839cdf#929eb6d860fb60ba994b24397ad3c3eb7d839cdf" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=3df9f8002cf14939a82e5182bab553ee5bf6e37b#3df9f8002cf14939a82e5182bab553ee5bf6e37b" dependencies = [ "ahash 0.8.0", "arrow", "datafusion-common", - "sqlparser 0.20.0", + "sqlparser 0.21.0", ] [[package]] name = "datafusion-optimizer" version = "11.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=929eb6d860fb60ba994b24397ad3c3eb7d839cdf#929eb6d860fb60ba994b24397ad3c3eb7d839cdf" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=3df9f8002cf14939a82e5182bab553ee5bf6e37b#3df9f8002cf14939a82e5182bab553ee5bf6e37b" dependencies = [ "arrow", "async-trait", @@ -1077,7 +1077,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "11.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=929eb6d860fb60ba994b24397ad3c3eb7d839cdf#929eb6d860fb60ba994b24397ad3c3eb7d839cdf" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=3df9f8002cf14939a82e5182bab553ee5bf6e37b#3df9f8002cf14939a82e5182bab553ee5bf6e37b" dependencies = [ "ahash 0.8.0", "arrow", @@ -1101,7 +1101,7 @@ dependencies = [ [[package]] name = "datafusion-proto" version = "11.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=929eb6d860fb60ba994b24397ad3c3eb7d839cdf#929eb6d860fb60ba994b24397ad3c3eb7d839cdf" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=3df9f8002cf14939a82e5182bab553ee5bf6e37b#3df9f8002cf14939a82e5182bab553ee5bf6e37b" dependencies = [ "arrow", "datafusion 11.0.0", @@ -1114,7 +1114,7 @@ dependencies = [ [[package]] name = "datafusion-row" version = "11.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=929eb6d860fb60ba994b24397ad3c3eb7d839cdf#929eb6d860fb60ba994b24397ad3c3eb7d839cdf" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=3df9f8002cf14939a82e5182bab553ee5bf6e37b#3df9f8002cf14939a82e5182bab553ee5bf6e37b" dependencies = [ "arrow", "datafusion-common", @@ -1125,14 +1125,14 @@ dependencies = [ [[package]] name = "datafusion-sql" version = "11.0.0" -source = "git+https://github.com/apache/arrow-datafusion.git?rev=929eb6d860fb60ba994b24397ad3c3eb7d839cdf#929eb6d860fb60ba994b24397ad3c3eb7d839cdf" +source = "git+https://github.com/apache/arrow-datafusion.git?rev=3df9f8002cf14939a82e5182bab553ee5bf6e37b#3df9f8002cf14939a82e5182bab553ee5bf6e37b" dependencies = [ "ahash 0.8.0", "arrow", "datafusion-common", "datafusion-expr", "hashbrown", - "sqlparser 0.20.0", + "sqlparser 0.21.0", "tokio", ] @@ -4627,9 +4627,9 @@ dependencies = [ [[package]] name = "sqlparser" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c67d4d5de027da1da5a4ed4623f09ab5131d808364279a5f5abee5de9b8db3" +checksum = "06f81e3ef3e44bcec9b9a349555f93178d2a427c2bb3e9611c50180085ad07a9" dependencies = [ "log", ] diff --git a/datafusion/Cargo.toml b/datafusion/Cargo.toml index 9c1b5ff160..8e4083013f 100644 --- a/datafusion/Cargo.toml +++ b/datafusion/Cargo.toml @@ -9,6 +9,6 @@ description = "Re-exports datafusion at a specific version" # Rename to workaround doctest bug # Turn off optional datafusion features (e.g. don't get support for crypto functions or avro) -upstream = { git = "https://github.com/apache/arrow-datafusion.git", rev="929eb6d860fb60ba994b24397ad3c3eb7d839cdf", default-features = false, package = "datafusion" } -datafusion-proto = { git = "https://github.com/apache/arrow-datafusion.git", rev="929eb6d860fb60ba994b24397ad3c3eb7d839cdf" } +upstream = { git = "https://github.com/apache/arrow-datafusion.git", rev="3df9f8002cf14939a82e5182bab553ee5bf6e37b", default-features = false, package = "datafusion" } +datafusion-proto = { git = "https://github.com/apache/arrow-datafusion.git", rev="3df9f8002cf14939a82e5182bab553ee5bf6e37b" } workspace-hack = { path = "../workspace-hack"} diff --git a/query_tests/cases/in/basic.expected b/query_tests/cases/in/basic.expected index 1e8f0ba584..ceb093cb76 100644 --- a/query_tests/cases/in/basic.expected +++ b/query_tests/cases/in/basic.expected @@ -12,7 +12,7 @@ +-----------------+ | west | +-----------------+ --- SQL: SELECT user, region from cpu; +-- SQL: SELECT "user", region from cpu; +------+--------+ | user | region | +------+--------+ @@ -25,7 +25,7 @@ +--------+--------------------------------+------+ | west | 1970-01-01T00:00:00.000000150Z | 21 | +--------+--------------------------------+------+ --- SQL: SELECT user, region from cpu where time > to_timestamp('1970-01-01T00:00:00.000000120+00:00'); +-- SQL: SELECT "user", region from cpu where time > to_timestamp('1970-01-01T00:00:00.000000120+00:00'); +------+--------+ | user | region | +------+--------+ diff --git a/query_tests/cases/in/basic.sql b/query_tests/cases/in/basic.sql index 86597567e0..a307231a48 100644 --- a/query_tests/cases/in/basic.sql +++ b/query_tests/cases/in/basic.sql @@ -8,14 +8,14 @@ SELECT min(region) from cpu; -- projection -- expect that to get a subset of the columns and in the order specified -SELECT user, region from cpu; +SELECT "user", region from cpu; -- predicate on CPU SELECT * from cpu where time > to_timestamp('1970-01-01T00:00:00.000000120+00:00'); -- projection and predicate -- expect that to get a subset of the columns and in the order specified -SELECT user, region from cpu where time > to_timestamp('1970-01-01T00:00:00.000000120+00:00'); +SELECT "user", region from cpu where time > to_timestamp('1970-01-01T00:00:00.000000120+00:00'); -- basic grouping SELECT count(*) from cpu group by region; diff --git a/query_tests/cases/in/timestamps.expected b/query_tests/cases/in/timestamps.expected index 359db84785..1bb8eff5f2 100644 --- a/query_tests/cases/in/timestamps.expected +++ b/query_tests/cases/in/timestamps.expected @@ -24,7 +24,7 @@ +--------+----------------------+------+ | west | 2021-07-20T19:30:30Z | 21 | +--------+----------------------+------+ --- SQL: SELECT * FROM cpu where cast(time as bigint) > 10 order by region, time, user; +-- SQL: SELECT * FROM cpu where cast(time as bigint) > 10 order by region, time, "user"; +--------+----------------------+------+ | region | time | user | +--------+----------------------+------+ diff --git a/query_tests/cases/in/timestamps.sql b/query_tests/cases/in/timestamps.sql index b9e2fe8319..22b5c4fa68 100644 --- a/query_tests/cases/in/timestamps.sql +++ b/query_tests/cases/in/timestamps.sql @@ -11,5 +11,5 @@ SELECT * FROM cpu WHERE time > to_timestamp('2021-07-20T19:28:50Z'); SELECT * FROM cpu WHERE CAST(time AS BIGINT) > CAST(to_timestamp('2021-07-20T19:28:50Z') AS BIGINT); -- work aroound for case time > 10 order by region, time, user; - SELECT * FROM cpu where cast(time as bigint) > 10 order by region, time, user; - -- this query does not work: SELECT * FROM cpu where time > 10 \ No newline at end of file + SELECT * FROM cpu where cast(time as bigint) > 10 order by region, time, "user"; + -- this query does not work: SELECT * FROM cpu where time > 10