Skip to content

Commit de10c23

Browse files
authored
fix(cubesql): Functions without arguments alias as plain function name (#9338)
1 parent 6ea1817 commit de10c23

17 files changed

+74
-76
lines changed

packages/cubejs-backend-native/Cargo.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cubenativeutils/Cargo.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cubesql/Cargo.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cubesql/cubesql/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage = "https://cube.dev"
1010

1111
[dependencies]
1212
arc-swap = "1"
13-
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "dcf3e4aa26fd112043ef26fa4a78db5dbd443c86", default-features = false, features = [
13+
datafusion = { git = 'https://github.com/cube-js/arrow-datafusion.git', rev = "1a612fc26f762f3837ecf26df2e83ba38f11a8a2", default-features = false, features = [
1414
"regex_expressions",
1515
"unicode_expressions",
1616
] }

rust/cubesql/cubesql/src/compile/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ mod tests {
11041104

11051105
assert_eq!(
11061106
logical_plan,
1107-
"Projection: CAST(utctimestamp() AS current_timestamp() AS Timestamp(Nanosecond, None)) AS COL\
1107+
"Projection: CAST(utctimestamp() AS current_timestamp AS Timestamp(Nanosecond, None)) AS COL\
11081108
\n EmptyRelation",
11091109
);
11101110
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
source: cubesql/src/compile/mod.rs
3-
assertion_line: 11756
4-
expression: "execute_query(\"SELECT current_timestamp::date = current_date\".to_string(),\n DatabaseProtocol::PostgreSQL).await?"
3+
expression: "execute_query(\"SELECT current_timestamp::date = current_date\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
54
---
6-
+-----------------------------------------------------+
7-
| CAST(current_timestamp() AS Date32) = currentdate() |
8-
+-----------------------------------------------------+
9-
| true |
10-
+-----------------------------------------------------+
5+
+-------------------------------------------------+
6+
| CAST(current_timestamp AS Date32) = currentdate |
7+
+-------------------------------------------------+
8+
| true |
9+
+-------------------------------------------------+
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
source: cubesql/src/compile/mod.rs
3-
expression: "execute_query(\"SELECT current_schema()\".to_string(),\n DatabaseProtocol::PostgreSQL).await?"
3+
expression: "execute_query(\"SELECT current_schema()\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
44
---
5-
+------------------+
6-
| current_schema() |
7-
+------------------+
8-
| public |
9-
+------------------+
5+
+----------------+
6+
| current_schema |
7+
+----------------+
8+
| public |
9+
+----------------+
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
source: cubesql/src/compile/mod.rs
3-
expression: "execute_query(\"SELECT localtimestamp = current_timestamp\".to_string(),\n DatabaseProtocol::PostgreSQL).await?"
3+
expression: "execute_query(\"SELECT localtimestamp = current_timestamp\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
44
---
5-
+----------------------------------------+
6-
| localtimestamp() = current_timestamp() |
7-
+----------------------------------------+
8-
| true |
9-
+----------------------------------------+
5+
+------------------------------------+
6+
| localtimestamp = current_timestamp |
7+
+------------------------------------+
8+
| true |
9+
+------------------------------------+

rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__pg_catalog_udf_search_path.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source: cubesql/src/compile/mod.rs
33
expression: "execute_query(\"SELECT version() UNION ALL SELECT pg_catalog.version();\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
44
---
55
+-----------------------------------+
6-
| version() |
6+
| version |
77
+-----------------------------------+
88
| PostgreSQL 14.2 on x86_64-cubesql |
99
| PostgreSQL 14.2 on x86_64-cubesql |

rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__quicksight_sql_implementation_info.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
source: cubesql/src/compile/mod.rs
3-
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?"
3+
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?"
44
---
55
+-----------------+-----------------------------------+
6-
| character_value | version() |
6+
| character_value | version |
77
+-----------------+-----------------------------------+
88
| PostgreSQL | PostgreSQL 14.2 on x86_64-cubesql |
99
| 14.02.0000) | PostgreSQL 14.2 on x86_64-cubesql |
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
source: cubesql/src/compile/mod.rs
3-
assertion_line: 7198
4-
expression: "execute_queries_with_flags(vec![\"SET user = 'good_user'\".to_string(),\n \"select current_user\".to_string()],\n DatabaseProtocol::PostgreSQL).await?.0"
3+
expression: "execute_queries_with_flags(vec![\"SET user = 'good_user'\".to_string(),\n\"select current_user\".to_string()], DatabaseProtocol::PostgreSQL).await? .0"
54
---
6-
+----------------+
7-
| current_user() |
8-
+----------------+
9-
| good_user |
10-
+----------------+
5+
+--------------+
6+
| current_user |
7+
+--------------+
8+
| good_user |
9+
+--------------+

rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__datagrip_introspection.snap

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
source: cubesql/src/compile/test/test_introspection.rs
33
expression: "execute_query(\"select current_database(), current_schema(), current_user;\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
44
---
5-
+--------------------+------------------+----------------+
6-
| current_database() | current_schema() | current_user() |
7-
+--------------------+------------------+----------------+
8-
| cubedb | public | ovr |
9-
+--------------------+------------------+----------------+
5+
+------------------+----------------+--------------+
6+
| current_database | current_schema | current_user |
7+
+------------------+----------------+--------------+
8+
| cubedb | public | ovr |
9+
+------------------+----------------+--------------+

rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__dbeaver_introspection_init.snap

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
source: cubesql/src/compile/test/test_introspection.rs
33
expression: "execute_query(\"SELECT current_schema(), session_user;\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
44
---
5-
+------------------+----------------+
6-
| current_schema() | session_user() |
7-
+------------------+----------------+
8-
| public | ovr |
9-
+------------------+----------------+
5+
+----------------+--------------+
6+
| current_schema | session_user |
7+
+----------------+--------------+
8+
| public | ovr |
9+
+----------------+--------------+

rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__zoho_inet_server_addr.snap

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
source: cubesql/src/compile/test/test_introspection.rs
33
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?"
44
---
5-
+------------------+---------------------------------------------------------+--------------------+
6-
| pg_backend_pid() | coalesce(CAST(inet_server_addr() AS Utf8),Utf8("addr")) | current_database() |
7-
+------------------+---------------------------------------------------------+--------------------+
8-
| 1 | 127.0.0.1/32 | cubedb |
9-
+------------------+---------------------------------------------------------+--------------------+
5+
+----------------+-------------------------------------------------------+------------------+
6+
| pg_backend_pid | coalesce(CAST(inet_server_addr AS Utf8),Utf8("addr")) | current_database |
7+
+----------------+-------------------------------------------------------+------------------+
8+
| 1 | 127.0.0.1/32 | cubedb |
9+
+----------------+-------------------------------------------------------+------------------+

rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_udfs__pg_backend_pid.snap

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
source: cubesql/src/compile/test/test_udfs.rs
33
expression: "execute_query(\"select pg_backend_pid();\".to_string(),\nDatabaseProtocol::PostgreSQL).await?"
44
---
5-
+------------------+
6-
| pg_backend_pid() |
7-
+------------------+
8-
| 1 |
9-
+------------------+
5+
+----------------+
6+
| pg_backend_pid |
7+
+----------------+
8+
| 1 |
9+
+----------------+

rust/cubesqlplanner/Cargo.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/cubesqlplanner/cubesqlplanner/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

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

0 commit comments

Comments
 (0)