Commit ce5fd50
authored
fix: emit bracketed inline array syntax for scalar subquery expressions (#17716)
Fixes a SQLGlot transpilation bug in BigQuery array generation where
single-element arrays containing scalar subqueries wrapped in
expressions (e.g., `COALESCE(CAST(...))` or `ROUND(...)`) produced
invalid BigQuery SQL syntax `ARRAY(COALESCE(...))`, causing BigQuery
`400 Syntax error: Unexpected identifier "COALESCE"` errors on
`.cache()`.
Verified at:
before: screen/9AmutJHVDJuafwm
after: screen/u7aW9tTLB8ybUFW
Fixes #<534824500> 🦕1 parent 2c3c213 commit ce5fd50
3 files changed
Lines changed: 31 additions & 1 deletion
File tree
- packages/bigframes
- tests/unit/core/compile/sqlglot/expressions
- snapshots/test_array_ops/test_to_array_with_subquery_expression
- third_party/bigframes_vendored/sqlglot/dialects
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1236 | 1236 | | |
1237 | 1237 | | |
1238 | 1238 | | |
1239 | | - | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
1240 | 1247 | | |
1241 | 1248 | | |
1242 | 1249 | | |
| |||
0 commit comments