Skip to content

Commit 920ff4a

Browse files
fix table select, update snapshots
1 parent 27180da commit 920ff4a

File tree

261 files changed

+353
-1888
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+353
-1888
lines changed

bigframes/core/compile/sqlglot/compiler.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ def _compile_node(
142142

143143
@_compile_node.register
144144
def compile_sql_select(node: sql_nodes.SqlSelectNode, child: ir.SQLGlotIR):
145-
sqlglot_ir = child
146145
ordering_cols = tuple(
147146
sge.Ordered(
148147
this=expression_compiler.expression_compiler.compile_expression(
@@ -161,7 +160,6 @@ def compile_sql_select(node: sql_nodes.SqlSelectNode, child: ir.SQLGlotIR):
161160
)
162161
for cdef in node.selections
163162
)
164-
sqlglot_ir = sqlglot_ir.select(projected_cols)
165163

166164
sge_predicates = tuple(
167165
expression_compiler.expression_compiler.compile_expression(expression)

bigframes/core/compile/sqlglot/sqlglot_ir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def select(
173173
),
174174
)
175175
else:
176-
new_expr = self.expr
176+
new_expr = sge.Select().from_(self.expr)
177177

178178
if len(sorting) > 0:
179179
new_expr = new_expr.order_by(*sorting)
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
1-
WITH `bfcte_0` AS (
2-
SELECT
3-
`bool_col`,
4-
`bytes_col`,
5-
`date_col`,
6-
`datetime_col`,
7-
`duration_col`,
8-
`float64_col`,
9-
`geography_col`,
10-
`int64_col`,
11-
`int64_too`,
12-
`numeric_col`,
13-
`rowindex`,
14-
`rowindex_2`,
15-
`string_col`,
16-
`time_col`,
17-
`timestamp_col`
18-
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
19-
)
201
SELECT
212
ROW_NUMBER() OVER () - 1 AS `row_number`
22-
FROM `bfcte_0`
3+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
WITH `bfcte_0` AS (
2-
SELECT
3-
`int64_col`
4-
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
5-
)
61
SELECT
72
ROW_NUMBER() OVER (ORDER BY `int64_col` ASC NULLS LAST) - 1 AS `row_number`
8-
FROM `bfcte_0`
3+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
WITH `bfcte_0` AS (
2-
SELECT
3-
`bool_col`
4-
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
5-
)
61
SELECT
72
COALESCE(
83
LOGICAL_AND(`bool_col`) OVER (
@@ -11,4 +6,4 @@ SELECT
116
),
127
TRUE
138
) AS `agg_bool`
14-
FROM `bfcte_0`
9+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
WITH `bfcte_0` AS (
2-
SELECT
3-
`int64_col`
4-
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
5-
)
61
SELECT
72
ANY_VALUE(`int64_col`) OVER (
83
ORDER BY `int64_col` DESC
94
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
105
) AS `agg_int64`
11-
FROM `bfcte_0`
6+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
WITH `bfcte_0` AS (
2-
SELECT
3-
`int64_col`,
4-
`string_col`
5-
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
6-
)
71
SELECT
82
ANY_VALUE(`int64_col`) OVER (
93
PARTITION BY `string_col`
104
ORDER BY `int64_col` ASC NULLS LAST
115
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
126
) AS `agg_int64`
13-
FROM `bfcte_0`
7+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
WITH `bfcte_0` AS (
2-
SELECT
3-
`bool_col`
4-
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
5-
)
61
SELECT
72
COALESCE(
83
LOGICAL_OR(`bool_col`) OVER (
@@ -11,4 +6,4 @@ SELECT
116
),
127
FALSE
138
) AS `agg_bool`
14-
FROM `bfcte_0`
9+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
WITH `bfcte_0` AS (
2-
SELECT
3-
`int64_col`
4-
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
5-
)
61
SELECT
72
COUNT(`int64_col`) OVER (
83
ORDER BY `int64_col` ASC NULLS LAST
94
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
105
) AS `agg_int64`
11-
FROM `bfcte_0`
6+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
WITH `bfcte_0` AS (
2-
SELECT
3-
`int64_col`,
4-
`string_col`
5-
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
6-
)
71
SELECT
82
COUNT(`int64_col`) OVER (
93
PARTITION BY `string_col`
104
ORDER BY `int64_col` DESC
115
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
126
) AS `agg_int64`
13-
FROM `bfcte_0`
7+
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`

0 commit comments

Comments
 (0)