[query] Fix key pruning bug with respect to table/matrix row scans.#11937
Merged
Conversation
chrisvittal
previously approved these changes
Jun 21, 2022
Collaborator
|
This seems very broken. |
chrisvittal
reviewed
Jun 21, 2022
| val child2Keyed = if (child2.typ.key.exists(k => !newRowType.hasField(k))) | ||
| val child2Keyed = if (child2.typ.key.exists(k => !newRowType.hasField(k))) { | ||
| val upcastKey = child2.typ.key.takeWhile(newRowType.hasField) | ||
| assert(requestedType.key.startsWith(upcastKey)) |
Collaborator
There was a problem hiding this comment.
This new assertion is failing a bunch
Can lead to keys being pruned upstream, producing invalid scans. CHANGELOG: Fixed correctness bug in scan order for `Table.annotate` and `MatrixTable.annotate_rows` in certain circumstances.
The upcastKey may be longer than the requested type's key, especially in an aggregation that doesn't need a key, like all.
c61b4e9 to
fae5c0a
Compare
Collaborator
|
@tpoterba I think your assertion was backwards. Please take a look at my changes. |
chrisvittal
approved these changes
Jun 23, 2022
chrisvittal
left a comment
Collaborator
There was a problem hiding this comment.
We need this fix, if my assertion is wrong, it doesn't make things more broken and it can be fixed later.
Contributor
Author
|
yep. |
Contributor
Author
|
thanks! |
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.
Can lead to keys being pruned upstream, producing invalid scans.
CHANGELOG: Fixed correctness bug in scan order for
Table.annotateandMatrixTable.annotate_rowsin certain circumstances.