Uh oh!
There was an error while loading. Please reload this page.
[SPARK-22092] Reallocation in OffHeapColumnVector.reserveInternal corrupts struct and array data - #19308
Closed
ala wants to merge 2 commits into
Closed
[SPARK-22092] Reallocation in OffHeapColumnVector.reserveInternal corrupts struct and array data#19308ala wants to merge 2 commits into
ala wants to merge 2 commits into
Conversation
ala
commented
Sep 21, 2017
ContributorAuthor
| protected void reserveInternal(int newCapacity) { | ||
| int oldCapacity = (this.data == 0L) ? 0 : capacity; | ||
| if (this.resultArray != null) { | ||
| oldCapacity = (this.lengthData == 0L) ? 0 : capacity; |
Contributor
There was a problem hiding this comment.
Structs have a similar problem, only nulls is used and data == 0. Should we also fix these here?
A related question, maybe we should use nulls instead of data or length to detect if we are resizing the column or creating a new one.
SparkQA
commented
Sep 21, 2017
Test build #82038 has finished for PR 19308 at commit
|
ala
commented
Sep 22, 2017
ContributorAuthor
@hvanhovell How about this? |
SparkQA
commented
Sep 22, 2017
Test build #82077 has finished for PR 19308 at commit
|
hvanhovell
commented
Sep 22, 2017
Contributor
LGTM - merging to master. Thanks! |
hvanhovell
commented
Sep 22, 2017
Contributor
@ala Can you backport this one to 2.2? |
ala added a commit
to ala/spark
that referenced
this pull request
Sep 22, 2017
…rupts struct and array data `OffHeapColumnVector.reserveInternal()` will only copy already inserted values during reallocation if `data != null`. In vectors containing arrays or structs this is incorrect, since there field `data` is not used at all. We need to check `nulls` instead. Adds new tests to `ColumnVectorSuite` that reproduce the errors. Author: Ala Luszczak <ala@databricks.com> Closesapache#19308 from ala/vector-realloc. (cherry picked from commit d2b2932) Signed-off-by: Ala Luszczak <ala@databricks.com>
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 freeto 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.
What changes were proposed in this pull request?
OffHeapColumnVector.reserveInternal()will only copy already inserted values during reallocation ifdata != null. In vectors containing arrays or structs this is incorrect, since there fielddatais not used at all. We need to checknullsinstead.How was this patch tested?
Adds new tests to
ColumnVectorSuitethat reproduce the errors.