Skip to content

[query] Fix key pruning bug with respect to table/matrix row scans.#11937

Merged
danking merged 2 commits into
hail-is:mainfrom
tpoterba:fix-map-rows-pruning
Jun 23, 2022
Merged

[query] Fix key pruning bug with respect to table/matrix row scans.#11937
danking merged 2 commits into
hail-is:mainfrom
tpoterba:fix-map-rows-pruning

Conversation

@tpoterba

Copy link
Copy Markdown
Contributor

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.

chrisvittal
chrisvittal previously approved these changes Jun 21, 2022
@chrisvittal

Copy link
Copy Markdown
Collaborator

This seems very broken.

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))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new assertion is failing a bunch

@chrisvittal chrisvittal dismissed their stale review June 21, 2022 20:14

Will re-review after fix

tpoterba and others added 2 commits June 22, 2022 21:09
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.
@chrisvittal chrisvittal force-pushed the fix-map-rows-pruning branch from c61b4e9 to fae5c0a Compare June 23, 2022 01:16
@chrisvittal

Copy link
Copy Markdown
Collaborator

@tpoterba I think your assertion was backwards. Please take a look at my changes.

@chrisvittal chrisvittal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this fix, if my assertion is wrong, it doesn't make things more broken and it can be fixed later.

@danking danking merged commit e2277e5 into hail-is:main Jun 23, 2022
@tpoterba

Copy link
Copy Markdown
Contributor Author

yep.

@tpoterba

Copy link
Copy Markdown
Contributor Author

thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants