Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-9546][SQL] Centralize orderable data type checking. #7880

Closed
wants to merge 2 commits into from

Conversation

rxin
Copy link
Contributor

@rxin rxin commented Aug 2, 2015

This pull request creates two isOrderable functions in RowOrdering that can be used to check whether a data type or a sequence of expressions can be used in sorting.

@SparkQA
Copy link

SparkQA commented Aug 3, 2015

Test build #39473 has finished for PR 7880 at commit 28502f5.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class RowOrdering(ordering: Seq[SortOrder]) extends Ordering[InternalRow]

@SparkQA
Copy link

SparkQA commented Aug 3, 2015

Test build #39482 has finished for PR 7880 at commit 0439b43.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class RowOrdering(ordering: Seq[SortOrder]) extends Ordering[InternalRow]

@SparkQA
Copy link

SparkQA commented Aug 3, 2015

Test build #39483 has finished for PR 7880 at commit f9e322d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class RowOrdering(ordering: Seq[SortOrder]) extends Ordering[InternalRow]

@@ -111,7 +99,7 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
// If the sort merge join option is set, we want to use sort merge join prior to hashjoin
// for now let's support inner join first, then add outer join
case ExtractEquiJoinKeys(Inner, leftKeys, rightKeys, condition, left, right)
if sqlContext.conf.sortMergeJoinEnabled && isValidSort(leftKeys, rightKeys) =>
if sqlContext.conf.sortMergeJoinEnabled && RowOrdering.isOrderable(leftKeys) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing && RowOrdering.isOrderable(rightKeys)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

left/right should be the same data types -- otherwise they cannot be joined together

@liancheng
Copy link
Contributor

LGTM

@rxin
Copy link
Contributor Author

rxin commented Aug 3, 2015

Thanks - merging this in.

@asfgit asfgit closed this in 30e8911 Aug 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants