Uh oh!
There was an error while loading. Please reload this page.
[SPARK-20451] Filter out nested mapType datatypes from sort order in randomSplit - #17751
Closed
sameeragarwal wants to merge 3 commits into
Closed
[SPARK-20451] Filter out nested mapType datatypes from sort order in randomSplit#17751sameeragarwal wants to merge 3 commits into
sameeragarwal wants to merge 3 commits into
Conversation
sameeragarwal
commented
Apr 24, 2017
MemberAuthor
| // ordering deterministic. Note that MapTypes cannot be sorted and are explicitly pruned out | ||
| // from the sort order. | ||
| val sortOrder = logicalPlan.output | ||
| .filterNot(_.dataType.existsRecursively(dt => dt.isInstanceOf[MapType])) |
Member
There was a problem hiding this comment.
How about calling RowOrdering.isOrderable?
Member
There was a problem hiding this comment.
UDT with underlying MapType is also not sortable.
| val plan = if (sortOrder.nonEmpty) { | ||
| Sort(sortOrder, global = false, logicalPlan) | ||
| } else { | ||
| // SPARK-12662: If sort order is empty, we materialize the dataset to guarantee determinism |
MemberAuthor
There was a problem hiding this comment.
We actually discussed materialization in https://issues.apache.org/jira/browse/SPARK-12662 so that ticket should provide direct context.
SparkQA
commented
Apr 24, 2017
Test build #76118 has finished for PR 17751 at commit
|
gatorsmile
commented
Apr 24, 2017
Member
LGTM pending Jenkins |
SparkQA
commented
Apr 25, 2017
Test build #76123 has finished for PR 17751 at commit
|
asfgit pushed a commit
that referenced
this pull request
Apr 25, 2017
…randomSplit ## What changes were proposed in this pull request? In `randomSplit`, It is possible that the underlying dataset doesn't guarantee the ordering of rows in its constituent partitions each time a split is materialized which could result in overlapping splits. To prevent this, as part of SPARK-12662, we explicitly sort each input partition to make the ordering deterministic. Given that `MapTypes` cannot be sorted this patch explicitly prunes them out from the sort order. Additionally, if the resulting sort order is empty, this patch then materializes the dataset to guarantee determinism. ## How was this patch tested? Extended `randomSplit on reordered partitions` in `DataFrameStatSuite` to also test for dataframes with mapTypes nested mapTypes. Author: Sameer Agarwal <sameerag@cs.berkeley.edu> Closes#17751 from sameeragarwal/randomsplit2. (cherry picked from commit 31345fd) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
asfgit pushed a commit
that referenced
this pull request
Apr 25, 2017
…randomSplit ## What changes were proposed in this pull request? In `randomSplit`, It is possible that the underlying dataset doesn't guarantee the ordering of rows in its constituent partitions each time a split is materialized which could result in overlapping splits. To prevent this, as part of SPARK-12662, we explicitly sort each input partition to make the ordering deterministic. Given that `MapTypes` cannot be sorted this patch explicitly prunes them out from the sort order. Additionally, if the resulting sort order is empty, this patch then materializes the dataset to guarantee determinism. ## How was this patch tested? Extended `randomSplit on reordered partitions` in `DataFrameStatSuite` to also test for dataframes with mapTypes nested mapTypes. Author: Sameer Agarwal <sameerag@cs.berkeley.edu> Closes#17751 from sameeragarwal/randomsplit2. (cherry picked from commit 31345fd) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
cloud-fan
commented
Apr 25, 2017
Contributor
thanks, merging to master/2.2/2.1/2.0! |
asfgit pushed a commit
that referenced
this pull request
Apr 25, 2017
…randomSplit ## What changes were proposed in this pull request? In `randomSplit`, It is possible that the underlying dataset doesn't guarantee the ordering of rows in its constituent partitions each time a split is materialized which could result in overlapping splits. To prevent this, as part of SPARK-12662, we explicitly sort each input partition to make the ordering deterministic. Given that `MapTypes` cannot be sorted this patch explicitly prunes them out from the sort order. Additionally, if the resulting sort order is empty, this patch then materializes the dataset to guarantee determinism. ## How was this patch tested? Extended `randomSplit on reordered partitions` in `DataFrameStatSuite` to also test for dataframes with mapTypes nested mapTypes. Author: Sameer Agarwal <sameerag@cs.berkeley.edu> Closes#17751 from sameeragarwal/randomsplit2. (cherry picked from commit 31345fd) Signed-off-by: Wenchen Fan <wenchen@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?
In
randomSplit, It is possible that the underlying dataset doesn't guarantee the ordering of rows in its constituent partitions each time a split is materialized which could result in overlappingsplits.
To prevent this, as part of SPARK-12662, we explicitly sort each input partition to make the ordering deterministic. Given that
MapTypescannot be sorted this patch explicitly prunes them out from the sort order. Additionally, if the resulting sort order is empty, this patch then materializes the dataset to guarantee determinism.How was this patch tested?
Extended
randomSplit on reordered partitionsinDataFrameStatSuiteto also test for dataframes with mapTypes nested mapTypes.