fix: Order by mentioning missing column multiple times#13158
Merged
alamb merged 3 commits intoapache:mainfrom Oct 30, 2024
Merged
fix: Order by mentioning missing column multiple times#13158alamb merged 3 commits intoapache:mainfrom
alamb merged 3 commits intoapache:mainfrom
Conversation
findepi
approved these changes
Oct 29, 2024
|
|
||
| columns.into_iter().for_each(|c| { | ||
| if !schema.has_column(c) { | ||
| if !schema.has_column(c) && !missing_cols.contains(c) { |
Contributor
Author
There was a problem hiding this comment.
I did not try it out, but most likely yes. The change becomes slightly bigger because we currently pass missing_cols as a slice to some helper methods.
I assume you are worried about this code now being quadratic? It was not clear if that was a real case in practice that you would order by a large number of columns and none of them are part of the output. But maybe it better to go for the set as it seems safer choice.
Previously we crashed on queries where the order by mentioned a missing columns multiple times. Closes apache#13157
Contributor
|
I restarted the failed CI check (was related to some sort of neetwork issue) |
Contributor
|
Thanks again @eejbyfeldt and @findepi |
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.
Which issue does this PR close?
Closes #13157
Rationale for this change
Previously we crashed on queries where the order by mentioned a missing
columns multiple times.
What changes are included in this PR?
Only add each missing column once.
Are these changes tested?
Yes, new sqllogictest.
Are there any user-facing changes?
Bugfix.