-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cubesql): Coerce empty subquery result to
NULL
- Loading branch information
1 parent
c49c55a
commit e59d2fb
Showing
5 changed files
with
51 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 15 additions & 5 deletions
20
rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__superset_subquery.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
--- | ||
source: cubesql/src/compile/mod.rs | ||
assertion_line: 5341 | ||
expression: "execute_query(\"SELECT a.attname, pg_catalog.format_type(a.atttypid, a.atttypmod), (SELECT format_type(d.adbin, d.adrelid) FROM pg_catalog.pg_attrdef d WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef) AS DEFAULT, a.attnotnull, a.attnum, a.attrelid as table_oid, pgd.description as comment, a.attgenerated as generated FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_description pgd ON ( pgd.objoid = a.attrelid AND pgd.objsubid = a.attnum) WHERE a.attrelid = 13449 AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum;\".to_string(),\n DatabaseProtocol::PostgreSQL).await?" | ||
expression: "execute_query(\"\n SELECT\n a.attname,\n pg_catalog.format_type(a.atttypid, a.atttypmod),\n (\n SELECT pg_catalog.pg_get_expr(d.adbin, d.adrelid)\n FROM pg_catalog.pg_attrdef d\n WHERE\n d.adrelid = a.attrelid AND\n d.adnum = a.attnum AND\n a.atthasdef\n ) AS DEFAULT,\n a.attnotnull,\n a.attnum,\n a.attrelid as table_oid,\n pgd.description as comment,\n a.attgenerated as generated\n FROM pg_catalog.pg_attribute a\n LEFT JOIN pg_catalog.pg_description pgd ON (\n pgd.objoid = a.attrelid AND\n pgd.objsubid = a.attnum\n )\n WHERE\n a.attrelid = 18000\n AND a.attnum > 0\n AND NOT a.attisdropped\n ORDER BY a.attnum\n ;\n \".to_string(),\n DatabaseProtocol::PostgreSQL).await?" | ||
--- | ||
++ | ||
++ | ||
++ | ||
+--------------------+------------------------------------------------+---------+------------+--------+-----------+---------+-----------+ | ||
| attname | pg_catalog.format_type(a.atttypid,a.atttypmod) | DEFAULT | attnotnull | attnum | table_oid | comment | generated | | ||
+--------------------+------------------------------------------------+---------+------------+--------+-----------+---------+-----------+ | ||
| count | bigint | NULL | true | 1 | 18000 | NULL | | | ||
| maxPrice | numeric | NULL | true | 2 | 18000 | NULL | | | ||
| minPrice | numeric | NULL | true | 3 | 18000 | NULL | | | ||
| avgPrice | numeric | NULL | true | 4 | 18000 | NULL | | | ||
| order_date | timestamp without time zone | NULL | false | 5 | 18000 | NULL | | | ||
| customer_gender | text | NULL | false | 6 | 18000 | NULL | | | ||
| taxful_total_price | numeric | NULL | false | 7 | 18000 | NULL | | | ||
| has_subscription | boolean | NULL | false | 8 | 18000 | NULL | | | ||
| is_male | boolean | NULL | true | 9 | 18000 | NULL | | | ||
| is_female | boolean | NULL | true | 10 | 18000 | NULL | | | ||
+--------------------+------------------------------------------------+---------+------------+--------+-----------+---------+-----------+ |