Skip to content

Commit b37e6f9

Browse files
committed
fix(bigframes): qualify column references in from_table to avoid ambiguity
1 parent ddd1798 commit b37e6f9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/bigframes/bigframes/core/compile/sqlglot/sqlglot_ir.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ def from_table(
214214
if not columns and not sql_predicate:
215215
return cls.from_expr(expr=table_expr, uid_gen=uid_gen)
216216

217-
select_items: list[sge.Identifier | sge.Star] = (
218-
[sql.identifier(col) for col in columns] if columns else [sge.Star()]
217+
select_items: list[sge.Expression] = (
218+
[sge.Column(this=sql.identifier(col), table=sql.identifier(table_alias)) for col in columns]
219+
if columns
220+
else [sge.Star()]
219221
)
220222
select_expr = sge.Select().select(*select_items).from_(table_expr)
221223

0 commit comments

Comments
 (0)