refactor: Define CTE-related SQL nodes for emitter#2495
Open
TrevorBergeron wants to merge 17 commits intomainfrom
Open
refactor: Define CTE-related SQL nodes for emitter#2495TrevorBergeron wants to merge 17 commits intomainfrom
TrevorBergeron wants to merge 17 commits intomainfrom
Conversation
chelsea-lin
requested changes
Mar 6, 2026
Contributor
chelsea-lin
left a comment
There was a problem hiding this comment.
It would be great if you can check all generated SQL are executable in the bigframes-dev project.
| INNER JOIN `bfcte_1` | ||
| ON COALESCE(CAST(`bfcol_1` AS STRING), '0') = COALESCE(CAST(`bfcol_5` AS STRING), '0') | ||
| AND COALESCE(CAST(`bfcol_1` AS STRING), '1') = COALESCE(CAST(`bfcol_5` AS STRING), '1') | ||
| ), `bfcte_3` AS ( |
Contributor
There was a problem hiding this comment.
Can you please double check why this SQL is longer? Both bfcte_2 and bfcte_3 are not useful.
| STRUCT(COALESCE(`bfcol_3`, 0) AS `bfpart1_0`, COALESCE(`bfcol_3`, 1) AS `bfpart2_0`) IN ( | ||
| ( | ||
| SELECT | ||
| STRUCT(COALESCE(`bfcol_4`, 0) AS `bfpart1_0`, COALESCE(`bfcol_4`, 1) AS `bfpart2_0`) |
Contributor
There was a problem hiding this comment.
This query has a syntax error: Unrecognized name: bfcol_4
| FROM ( | ||
| SELECT | ||
| *, | ||
| STRUCT(COALESCE(`bfcol_3`, 0) AS `bfpart1_0`, COALESCE(`bfcol_3`, 1) AS `bfpart2_0`) IN ( |
Contributor
There was a problem hiding this comment.
The bfpart1_0 and bfpart2_0 looks redundancy. bfpart_0 and bfpart_1 would be better. However, these are local alias so that it may not need to generate a global UID. If so, we can use bfpart1/bfpart or other more readable variable naming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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> 🦕