Skip to content

Commit 74b2470

Browse files
fix as_select star logic
1 parent ce9fbb9 commit 74b2470

File tree

10 files changed

+14
-18
lines changed

10 files changed

+14
-18
lines changed

bigframes/core/compile/sqlglot/sqlglot_ir.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -507,11 +507,7 @@ def _as_select(self) -> sge.Select:
507507
if isinstance(self.expr, sge.Select):
508508
return self.expr
509509
else: # table or cte
510-
return (
511-
sge.Select()
512-
.select(sge.Column(this=sge.Star(), table=self.expr))
513-
.from_(self.expr)
514-
)
510+
return sge.Select().select(sge.Star()).from_(self.expr)
515511

516512
def _as_subquery(self) -> sge.Subquery:
517513
return self._as_select().subquery()

tests/unit/core/compile/sqlglot/snapshots/test_compile_concat/test_compile_concat/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ WITH `bfcte_0` AS (
1414
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` AS `bft_0`
1515
), `bfcte_2` AS (
1616
SELECT
17-
`bfcte_0`.*
17+
*
1818
FROM `bfcte_0`
1919
)
2020
SELECT

tests/unit/core/compile/sqlglot/snapshots/test_compile_concat/test_compile_concat_filter_sorted/out.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ WITH `bfcte_0` AS (
2424
`bool_col`
2525
), `bfcte_4` AS (
2626
SELECT
27-
`bfcte_0`.*
27+
*
2828
FROM `bfcte_0`
2929
), `bfcte_5` AS (
3030
SELECT
31-
`bfcte_2`.*
31+
*
3232
FROM `bfcte_2`
3333
)
3434
SELECT

tests/unit/core/compile/sqlglot/snapshots/test_compile_fromrange/test_compile_fromrange/out.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ WITH `bfcte_0` AS (
3232
)
3333
), `bfcte_4` AS (
3434
SELECT
35-
`bfcte_0`.*
35+
*
3636
FROM `bfcte_0`
3737
), `bfcte_5` AS (
3838
SELECT
@@ -44,7 +44,7 @@ WITH `bfcte_0` AS (
4444
)
4545
), `bfcte_6` AS (
4646
SELECT
47-
`bfcte_2`.*
47+
*
4848
FROM `bfcte_2`
4949
)
5050
SELECT

tests/unit/core/compile/sqlglot/snapshots/test_compile_join/test_compile_join_w_on/bool_col/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ WITH `bfcte_0` AS (
1010
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` AS `bft_0`
1111
), `bfcte_2` AS (
1212
SELECT
13-
`bfcte_0`.*
13+
*
1414
FROM `bfcte_0`
1515
)
1616
SELECT

tests/unit/core/compile/sqlglot/snapshots/test_compile_join/test_compile_join_w_on/float64_col/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ WITH `bfcte_0` AS (
1010
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` AS `bft_0`
1111
), `bfcte_2` AS (
1212
SELECT
13-
`bfcte_0`.*
13+
*
1414
FROM `bfcte_0`
1515
)
1616
SELECT

tests/unit/core/compile/sqlglot/snapshots/test_compile_join/test_compile_join_w_on/int64_col/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ WITH `bfcte_0` AS (
1010
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` AS `bft_0`
1111
), `bfcte_2` AS (
1212
SELECT
13-
`bfcte_0`.*
13+
*
1414
FROM `bfcte_0`
1515
)
1616
SELECT

tests/unit/core/compile/sqlglot/snapshots/test_compile_join/test_compile_join_w_on/numeric_col/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ WITH `bfcte_0` AS (
1010
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` AS `bft_0`
1111
), `bfcte_2` AS (
1212
SELECT
13-
`bfcte_0`.*
13+
*
1414
FROM `bfcte_0`
1515
)
1616
SELECT

tests/unit/core/compile/sqlglot/snapshots/test_compile_join/test_compile_join_w_on/string_col/out.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ WITH `bfcte_0` AS (
1010
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` AS `bft_0`
1111
), `bfcte_2` AS (
1212
SELECT
13-
`bfcte_0`.*
13+
*
1414
FROM `bfcte_0`
1515
), `bfcte_3` AS (
1616
SELECT
17-
`bfcte_1`.*
17+
*
1818
FROM `bfcte_1`
1919
)
2020
SELECT

tests/unit/core/compile/sqlglot/snapshots/test_compile_join/test_compile_join_w_on/time_col/out.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ WITH `bfcte_0` AS (
1010
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types` AS `bft_0`
1111
), `bfcte_2` AS (
1212
SELECT
13-
`bfcte_0`.*
13+
*
1414
FROM `bfcte_0`
1515
), `bfcte_3` AS (
1616
SELECT
17-
`bfcte_1`.*
17+
*
1818
FROM `bfcte_1`
1919
)
2020
SELECT

0 commit comments

Comments
 (0)