Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
replace equal by semanticEquals
  • Loading branch information
gatorsmile committed Nov 14, 2015
commit 4590af15aafae611a34ba2aad49659d3cfb4a5bd
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,17 @@ case class HashPartitioning(expressions: Seq[Expression], numPartitions: Int)
override def satisfies(required: Distribution): Boolean = required match {
case UnspecifiedDistribution => true
case ClusteredDistribution(requiredClustering) =>
expressions.toSet.subsetOf(requiredClustering.toSet)
expressions.forall(x=>requiredClustering.exists(_.semanticEquals(x)))
case _ => false
}

override def compatibleWith(other: Partitioning): Boolean = other match {
case o: HashPartitioning => this == o
case o: HashPartitioning => this.semanticEquals(o)
case _ => false
}

override def guarantees(other: Partitioning): Boolean = other match {
case o: HashPartitioning => this == o
case o: HashPartitioning => this.semanticEquals(o)
case _ => false
}

Expand Down Expand Up @@ -276,17 +276,17 @@ case class RangePartitioning(ordering: Seq[SortOrder], numPartitions: Int)
val minSize = Seq(requiredOrdering.size, ordering.size).min
requiredOrdering.take(minSize) == ordering.take(minSize)
case ClusteredDistribution(requiredClustering) =>
ordering.map(_.child).toSet.subsetOf(requiredClustering.toSet)
ordering.map(_.child).forall(x=>requiredClustering.exists(_.semanticEquals(x)))
case _ => false
}

override def compatibleWith(other: Partitioning): Boolean = other match {
case o: RangePartitioning => this == o
case o: RangePartitioning => this.semanticEquals(o)
case _ => false
}

override def guarantees(other: Partitioning): Boolean = other match {
case o: RangePartitioning => this == o
case o: RangePartitioning => this.semanticEquals(o)
case _ => false
}
}
Expand Down