Skip to content

Commit 920f89f

Browse files
committed
select some columns
1 parent 801da07 commit 920f89f

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
`int64_col` AS `bfcol_0`,
4-
`rowindex` AS `bfcol_1`
3+
`int64_col` AS `bfcol_0`
54
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
65
), `bfcte_1` AS (
76
SELECT
87
*,
9-
DENSE_RANK() OVER (ORDER BY `bfcol_0` IS NULL ASC NULLS LAST, `bfcol_0` ASC NULLS LAST) AS `bfcol_4`
8+
DENSE_RANK() OVER (ORDER BY `bfcol_0` IS NULL ASC NULLS LAST, `bfcol_0` ASC NULLS LAST) AS `bfcol_1`
109
FROM `bfcte_0`
1110
)
1211
SELECT
13-
`bfcol_1` AS `bfuid_col_1`,
14-
`bfcol_0` AS `int64_col`,
15-
`bfcol_4` AS `agg_int64`
12+
`bfcol_1` AS `agg_int64`
1613
FROM `bfcte_1`
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
`int64_col` AS `bfcol_0`,
4-
`rowindex` AS `bfcol_1`
3+
`int64_col` AS `bfcol_0`
54
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
65
), `bfcte_1` AS (
76
SELECT
87
*,
9-
RANK() OVER (ORDER BY `bfcol_0` IS NULL ASC NULLS LAST, `bfcol_0` ASC NULLS LAST) AS `bfcol_4`
8+
RANK() OVER (ORDER BY `bfcol_0` IS NULL ASC NULLS LAST, `bfcol_0` ASC NULLS LAST) AS `bfcol_1`
109
FROM `bfcte_0`
1110
)
1211
SELECT
13-
`bfcol_1` AS `bfuid_col_1`,
14-
`bfcol_0` AS `int64_col`,
15-
`bfcol_4` AS `agg_int64`
12+
`bfcol_1` AS `agg_int64`
1613
FROM `bfcte_1`

tests/unit/core/compile/sqlglot/aggregations/test_unary_compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def _apply_unary_window_op(
5757
window_spec=window_spec,
5858
output_name=identifiers.ColumnId(new_name),
5959
)
60-
result = array_value.ArrayValue(win_node)
60+
result = array_value.ArrayValue(win_node).select_columns([new_name])
6161

6262
sql = result.session._executor.to_sql(result, enable_cache=False)
6363
return sql

0 commit comments

Comments
 (0)