diff --git a/packages/cubejs-backend-native/Cargo.lock b/packages/cubejs-backend-native/Cargo.lock index 084df3f674f57..29ac8873f243c 100644 --- a/packages/cubejs-backend-native/Cargo.lock +++ b/packages/cubejs-backend-native/Cargo.lock @@ -714,7 +714,7 @@ dependencies = [ [[package]] name = "cube-ext" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "arrow", "chrono", @@ -884,7 +884,7 @@ checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "datafusion" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow", @@ -917,7 +917,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "arrow", "ordered-float 2.10.1", @@ -928,7 +928,7 @@ dependencies = [ [[package]] name = "datafusion-data-access" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "async-trait", "chrono", @@ -941,7 +941,7 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow", @@ -952,7 +952,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow", diff --git a/rust/cubenativeutils/Cargo.lock b/rust/cubenativeutils/Cargo.lock index da0ec4fc67bf1..3ee1a78750ab9 100644 --- a/rust/cubenativeutils/Cargo.lock +++ b/rust/cubenativeutils/Cargo.lock @@ -623,7 +623,7 @@ dependencies = [ [[package]] name = "cube-ext" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "arrow", "chrono", @@ -715,7 +715,7 @@ dependencies = [ [[package]] name = "datafusion" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow", @@ -748,7 +748,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "arrow", "ordered-float 2.10.1", @@ -759,7 +759,7 @@ dependencies = [ [[package]] name = "datafusion-data-access" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "async-trait", "chrono", @@ -772,7 +772,7 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow", @@ -783,7 +783,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow", diff --git a/rust/cubesql/Cargo.lock b/rust/cubesql/Cargo.lock index 0b0920439a124..810919a15c1e3 100644 --- a/rust/cubesql/Cargo.lock +++ b/rust/cubesql/Cargo.lock @@ -722,7 +722,7 @@ dependencies = [ [[package]] name = "cube-ext" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "arrow", "chrono", @@ -846,7 +846,7 @@ dependencies = [ [[package]] name = "datafusion" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow", @@ -879,7 +879,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "arrow", "ordered-float 2.10.0", @@ -890,7 +890,7 @@ dependencies = [ [[package]] name = "datafusion-data-access" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "async-trait", "chrono", @@ -903,7 +903,7 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow", @@ -914,7 +914,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow", diff --git a/rust/cubesql/cubesql/Cargo.toml b/rust/cubesql/cubesql/Cargo.toml index 0aa50717a18f8..4c14f59e877df 100644 --- a/rust/cubesql/cubesql/Cargo.toml +++ b/rust/cubesql/cubesql/Cargo.toml @@ -10,7 +10,7 @@ homepage = "https://cube.dev" [dependencies] arc-swap = "1" -datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c", default-features = false, features = [ +datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "edbe6a8b62c1cc9f1feb0be83f089f155c662298", default-features = false, features = [ "regex_expressions", "unicode_expressions", ] } diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_df_execution__numeric_math_scalar.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_df_execution__numeric_math_scalar.snap new file mode 100644 index 0000000000000..bfac7dee8efb0 --- /dev/null +++ b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_df_execution__numeric_math_scalar.snap @@ -0,0 +1,10 @@ +--- +source: cubesql/src/compile/test/test_df_execution.rs +expression: "execute_query(query.to_string(), DatabaseProtocol::PostgreSQL).await.unwrap()" +--- ++--------------+ +| m | ++--------------+ +| 1.0000000000 | +| 1.5000000000 | ++--------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/test_df_execution.rs b/rust/cubesql/cubesql/src/compile/test/test_df_execution.rs index aa3a04abb00ae..2420a09b2fe73 100644 --- a/rust/cubesql/cubesql/src/compile/test/test_df_execution.rs +++ b/rust/cubesql/cubesql/src/compile/test/test_df_execution.rs @@ -129,3 +129,27 @@ async fn test_date_part_interval() { .unwrap() ); } + +#[tokio::test] +async fn test_numeric_math_scalar() { + init_testing_logger(); + + // language=PostgreSQL + let query = r#" + SELECT + a % 2::numeric AS m + FROM ( + SELECT + 5::numeric AS a + UNION ALL + SELECT + 3.5::numeric AS a + ) AS t + "#; + + insta::assert_snapshot!( + execute_query(query.to_string(), DatabaseProtocol::PostgreSQL) + .await + .unwrap() + ); +} diff --git a/rust/cubesqlplanner/Cargo.lock b/rust/cubesqlplanner/Cargo.lock index b3d62dbda3b4d..33383aae171a6 100644 --- a/rust/cubesqlplanner/Cargo.lock +++ b/rust/cubesqlplanner/Cargo.lock @@ -664,7 +664,7 @@ dependencies = [ [[package]] name = "cube-ext" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "arrow", "chrono", @@ -777,7 +777,7 @@ dependencies = [ [[package]] name = "datafusion" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow", @@ -810,7 +810,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "arrow", "ordered-float 2.10.1", @@ -821,7 +821,7 @@ dependencies = [ [[package]] name = "datafusion-data-access" version = "1.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "async-trait", "chrono", @@ -834,7 +834,7 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow", @@ -845,7 +845,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "7.0.0" -source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c#96c5f1747e47d2d3a9b32f10484a4d8ff75cf45c" +source = "git+https://github.com/cube-js/arrow-datafusion.git?rev=edbe6a8b62c1cc9f1feb0be83f089f155c662298#edbe6a8b62c1cc9f1feb0be83f089f155c662298" dependencies = [ "ahash 0.7.8", "arrow",