Skip to content

fix(bigquery): preserve UNNEST offset alias ownership when cloning - #6746

Open
wozhenbang2004 wants to merge 2 commits into
alibaba:masterfrom
wozhenbang2004:fix/bigquery-unnest-offset-clone
Open

wozhenbang2004 wants to merge 2 commits into
alibaba:masterfrom
wozhenbang2004:fix/bigquery-unnest-offset-clone

Conversation

@wozhenbang2004

Copy link
Copy Markdown

Cloning a BigQuery UNNEST(...) table source with a WITH OFFSET AS alias currently reuses the alias node. The clone's setter then changes that node's parent, leaving the original table source with a child owned by the clone.

Clone the offset expression before attaching it, as the method already does for the UNNEST items and columns. The regression parses a BigQuery query, clones its table source, and verifies that both ASTs retain their own alias and still render the same SQL.

Tested with mvn -pl core test (4,374 tests, one existing skip). The new test fails on the unpatched base and passes with the fix.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants