[query] Stop silently exporting null bgens if no GP field exists#12650
Merged
danking merged 4 commits intohail-is:mainfrom Feb 7, 2023
Merged
[query] Stop silently exporting null bgens if no GP field exists#12650danking merged 4 commits intohail-is:mainfrom
danking merged 4 commits intohail-is:mainfrom
Conversation
danking
previously requested changes
Feb 3, 2023
Contributor
danking
left a comment
There was a problem hiding this comment.
Indeed that seems not great. I think we need to keep the if. I also noticed on line 243/245 that we have export_gen where there should be an export/bgen.
| entries.forEachDefinedOrMissing(cb)({ (cb, j) => | ||
| emitNullGP(cb) | ||
| }, { case (cb, j, entry: SBaseStructValue) => | ||
| if (entry.st.virtualType.fieldIdx.get("GP").isDefined) { |
Contributor
There was a problem hiding this comment.
Couldn't the GP field still be missing even though the entries aren't? (Meaning we need this if)
Contributor
Author
There was a problem hiding this comment.
this is asking whether the GP field is not in the schema.
Contributor
Author
There was a problem hiding this comment.
missing GP values are handled by the consume
Contributor
Author
There was a problem hiding this comment.
will do the same for GEN though!
danking
approved these changes
Feb 3, 2023
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.
could use a second look here -- am I crazy?
If GP is missing from the MT and no expression is passed, there's no GP in the MT passed into the writer.
And if there's no GP in the writer, we export a file worth of nulls.
hail/hail/src/main/scala/is/hail/expr/ir/MatrixWriter.scala
Lines 1123 to 1149 in eee0924