fix(bigframes): Fix bugs compiling ambiguous ids and in subqueries#16617
fix(bigframes): Fix bugs compiling ambiguous ids and in subqueries#16617TrevorBergeron wants to merge 6 commits intomainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces several updates, including adding a fillna(False) to isin operations, refactoring BigQuery query generation to use explicit table aliasing (_bf_source), and adjusting the SQL parser to handle table aliases before time travel clauses. Feedback suggests qualifying the wildcard selector in BigQuery queries for consistency and warns that the parser change might cause regressions for SQL dialects that expect aliases after table samples.
| select_clause = "SELECT " + ", ".join(f"`{column}`" for column in columns) | ||
| select_clause = "SELECT " + ", ".join(f"`_bf_source`.`{column}`" for column in columns) | ||
| else: | ||
| select_clause = "SELECT *" |
There was a problem hiding this comment.
| alias = self._parse_table_alias( | ||
| alias_tokens=alias_tokens or self.TABLE_ALIAS_TOKENS | ||
| ) | ||
| if alias: | ||
| this.set("alias", alias) |
There was a problem hiding this comment.
Moving the alias parsing to the top of _parse_table correctly addresses BigQuery's syntax requirements (where the alias precedes the FOR SYSTEM_TIME AS OF clause). However, this change unconditionally parses the alias before the table sample, which may break dialects that set ALIAS_POST_TABLESAMPLE = True. Since this is a vendored parser, if it's intended to support multiple dialects, consider making this move conditional on the dialect's settings or ensuring that the alias can still be parsed after the sample if needed.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕