Conversation
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.
What
Two normalizations move from a hand-written recursive walk into the generic
clear_locationpass, which visits every node whatever its parent:WithClause.locationis now cleared like the other location fields.INNER JOIN ... ON TRUE/CROSS JOINequivalence is applied wherever aJoinExprappears.normalize_join_exprand its 80 lines of per-parent recursion are deleted.Why
normalize_join_exprenumerated the parents it knew how to descend through:SelectStmt,RangeSubselect,ViewStmt,DeleteStmt,SubLink.Any other parent hid the join from normalization, and the round-trip guard then reported a false difference - the printer spells a
CROSS JOINasINNER JOIN ON TRUE, so the two ASTs must compare equal for the statement to be formattable at all.CREATE TABLE ... AS SELECTis exactly such a parent.Both of these statements were refused before this PR and format correctly after it:
Putting both rules in the generic pass removes the class of bug rather than adding
CreateTableAsStmtto a list that will be incomplete again next time.Tests
Two new fixtures with snapshots at widths 80 and 100.
normalize_coverage.rsloses the entry for the deleted function.