-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Fix field resolution for FORK #128193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fix field resolution for FORK #128193
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5a64c9b
Fix field resolution for FORK
ioanatia c4a25d3
Merge branch 'main' into fork_field_names
ioanatia af3b955
Merge branch 'main' into fork_field_names
ioanatia 4d23bc0
Fix field resolution when one FORK branch is not bounded by a aggrega…
ioanatia 34c883e
Add test and apply refactor suggestion
ioanatia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm - now that I am looking at this more - I think we should return all fields, because one branch is not bounded by any command like
KEEP
orSTATS
that resets the output to a known list of fields. will fix 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one more query where I am confused, in part because of probably not knowing what is the expectation for
fork
.FROM employees | FORK ( WHERE true | stats min(salary) by gender) ( WHERE true | LIMIT 3 )
This shows these columns:
min(salary) | gender | _fork | salary
Should these be a "union" kind of set of columns and
fieldNames
is only limiting it to what it "sees" in thefork
's first branch? If that's true, this means thatfieldNames
should consider a union kind of field names from all the branches offork
. As a shortcut, the first branch that it finds that's the "widest" it should stop checking the rest.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FORK output should be a union of the outputs of the fork branches.
If we detect that the same field exists in multiple fork branches outputs, but the field has different type, we fail with a validation error.
FORK will pad with null columns the output of FORK branches that are missing fields.
For example:
Will produce:
I think fixed the field resolution for this case.
In this test example here we should ask for all fields, since not all branches are bounded by an
Aggregate
orProject
.