Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cubesql): Functions without arguments alias as plain function name #9338

Merged
merged 1 commit into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/cubejs-backend-native/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions rust/cubenativeutils/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions rust/cubesql/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/cubesql/cubesql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage = "https://cube.dev"

[dependencies]
arc-swap = "1"
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "dcf3e4aa26fd112043ef26fa4a78db5dbd443c86", default-features = false, features = [
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "1a612fc26f762f3837ecf26df2e83ba38f11a8a2", default-features = false, features = [
"regex_expressions",
"unicode_expressions",
] }
Expand Down
2 changes: 1 addition & 1 deletion rust/cubesql/cubesql/src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ mod tests {

assert_eq!(
logical_plan,
"Projection: CAST(utctimestamp() AS current_timestamp() AS Timestamp(Nanosecond, None)) AS COL\
"Projection: CAST(utctimestamp() AS current_timestamp AS Timestamp(Nanosecond, None)) AS COL\
\n EmptyRelation",
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
source: cubesql/src/compile/mod.rs
assertion_line: 11756
expression: "execute_query(\"SELECT current_timestamp::date = current_date\".to_string(),\n DatabaseProtocol::PostgreSQL).await?"
expression: "execute_query(\"SELECT current_timestamp::date = current_date\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
---
+-----------------------------------------------------+
| CAST(current_timestamp() AS Date32) = currentdate() |
+-----------------------------------------------------+
| true |
+-----------------------------------------------------+
+-------------------------------------------------+
| CAST(current_timestamp AS Date32) = currentdate |
+-------------------------------------------------+
| true |
+-------------------------------------------------+
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
source: cubesql/src/compile/mod.rs
expression: "execute_query(\"SELECT current_schema()\".to_string(),\n DatabaseProtocol::PostgreSQL).await?"
expression: "execute_query(\"SELECT current_schema()\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
---
+------------------+
| current_schema() |
+------------------+
| public |
+------------------+
+----------------+
| current_schema |
+----------------+
| public |
+----------------+
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
source: cubesql/src/compile/mod.rs
expression: "execute_query(\"SELECT localtimestamp = current_timestamp\".to_string(),\n DatabaseProtocol::PostgreSQL).await?"
expression: "execute_query(\"SELECT localtimestamp = current_timestamp\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
---
+----------------------------------------+
| localtimestamp() = current_timestamp() |
+----------------------------------------+
| true |
+----------------------------------------+
+------------------------------------+
| localtimestamp = current_timestamp |
+------------------------------------+
| true |
+------------------------------------+
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source: cubesql/src/compile/mod.rs
expression: "execute_query(\"SELECT version() UNION ALL SELECT pg_catalog.version();\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
---
+-----------------------------------+
| version() |
| version |
+-----------------------------------+
| PostgreSQL 14.2 on x86_64-cubesql |
| PostgreSQL 14.2 on x86_64-cubesql |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
source: cubesql/src/compile/mod.rs
expression: "execute_query(r#\"\n SELECT character_value, version() \n FROM INFORMATION_SCHEMA.SQL_IMPLEMENTATION_INFO\n WHERE implementation_info_id IN ('17','18')\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?"
expression: "execute_query(r#\"\n SELECT character_value, version()\n FROM INFORMATION_SCHEMA.SQL_IMPLEMENTATION_INFO\n WHERE implementation_info_id IN ('17','18')\n \"#.to_string(),\nDatabaseProtocol::PostgreSQL).await?"
---
+-----------------+-----------------------------------+
| character_value | version() |
| character_value | version |
+-----------------+-----------------------------------+
| PostgreSQL | PostgreSQL 14.2 on x86_64-cubesql |
| 14.02.0000) | PostgreSQL 14.2 on x86_64-cubesql |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
source: cubesql/src/compile/mod.rs
assertion_line: 7198
expression: "execute_queries_with_flags(vec![\"SET user = 'good_user'\".to_string(),\n \"select current_user\".to_string()],\n DatabaseProtocol::PostgreSQL).await?.0"
expression: "execute_queries_with_flags(vec![\"SET user = 'good_user'\".to_string(),\n\"select current_user\".to_string()], DatabaseProtocol::PostgreSQL).await? .0"
---
+----------------+
| current_user() |
+----------------+
| good_user |
+----------------+
+--------------+
| current_user |
+--------------+
| good_user |
+--------------+
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
source: cubesql/src/compile/test/test_introspection.rs
expression: "execute_query(\"select current_database(), current_schema(), current_user;\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
---
+--------------------+------------------+----------------+
| current_database() | current_schema() | current_user() |
+--------------------+------------------+----------------+
| cubedb | public | ovr |
+--------------------+------------------+----------------+
+------------------+----------------+--------------+
| current_database | current_schema | current_user |
+------------------+----------------+--------------+
| cubedb | public | ovr |
+------------------+----------------+--------------+
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
source: cubesql/src/compile/test/test_introspection.rs
expression: "execute_query(\"SELECT current_schema(), session_user;\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
---
+------------------+----------------+
| current_schema() | session_user() |
+------------------+----------------+
| public | ovr |
+------------------+----------------+
+----------------+--------------+
| current_schema | session_user |
+----------------+--------------+
| public | ovr |
+----------------+--------------+
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
source: cubesql/src/compile/test/test_introspection.rs
expression: "execute_query(\"\n select\n pg_backend_pid(),\n coalesce(cast(inet_server_addr() as text ),'addr'),\n current_database()\n ;\".to_string(),\nDatabaseProtocol::PostgreSQL,).await?"
---
+------------------+---------------------------------------------------------+--------------------+
| pg_backend_pid() | coalesce(CAST(inet_server_addr() AS Utf8),Utf8("addr")) | current_database() |
+------------------+---------------------------------------------------------+--------------------+
| 1 | 127.0.0.1/32 | cubedb |
+------------------+---------------------------------------------------------+--------------------+
+----------------+-------------------------------------------------------+------------------+
| pg_backend_pid | coalesce(CAST(inet_server_addr AS Utf8),Utf8("addr")) | current_database |
+----------------+-------------------------------------------------------+------------------+
| 1 | 127.0.0.1/32 | cubedb |
+----------------+-------------------------------------------------------+------------------+
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
source: cubesql/src/compile/test/test_udfs.rs
expression: "execute_query(\"select pg_backend_pid();\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
---
+------------------+
| pg_backend_pid() |
+------------------+
| 1 |
+------------------+
+----------------+
| pg_backend_pid |
+----------------+
| 1 |
+----------------+
12 changes: 6 additions & 6 deletions rust/cubesqlplanner/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/cubesqlplanner/cubesqlplanner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "dcf3e4aa26fd112043ef26fa4a78db5dbd443c86", default-features = false, features = ["regex_expressions", "unicode_expressions"] }
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "1a612fc26f762f3837ecf26df2e83ba38f11a8a2", default-features = false, features = ["regex_expressions", "unicode_expressions"] }
tokio = { version = "^1.35", features = ["full", "rt", "tracing"] }
itertools = "0.10.2"
cubeclient = { path = "../../cubesql/cubeclient" }
Expand Down
Loading