Skip to content

Commit 1c33263

Browse files
committed
rename to outputOrdering
1 parent 81e4828 commit 1c33263

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,8 +740,8 @@ object EliminateSorts extends Rule[LogicalPlan] {
740740
*/
741741
object RemoveRedundantSorts extends Rule[LogicalPlan] {
742742
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
743-
case Sort(orders, true, child) if child.sortedOrder.nonEmpty
744-
&& child.sortedOrder.zip(orders).forall { case (s1, s2) => s1.satisfies(s2) } =>
743+
case Sort(orders, true, child) if child.outputOrdering.nonEmpty
744+
&& SortOrder.orderingSatisfies(child.outputOrdering, orders) =>
745745
child
746746
}
747747
}

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ abstract class LogicalPlan
221221
def refresh(): Unit = children.foreach(_.refresh())
222222

223223
/**
224-
* If the current plan contains sorted data, it contains the sorted order.
224+
* Returns the output ordering that this plan generates.
225225
*/
226-
def sortedOrder: Seq[SortOrder] = Nil
226+
def outputOrdering: Seq[SortOrder] = Nil
227227
}
228228

229229
/**
@@ -281,5 +281,5 @@ abstract class BinaryNode extends LogicalPlan {
281281
}
282282

283283
abstract class KeepOrderUnaryNode extends UnaryNode {
284-
override final def sortedOrder: Seq[SortOrder] = child.sortedOrder
284+
override final def outputOrdering: Seq[SortOrder] = child.outputOrdering
285285
}

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ case class Sort(
470470
child: LogicalPlan) extends UnaryNode {
471471
override def output: Seq[Attribute] = child.output
472472
override def maxRows: Option[Long] = child.maxRows
473-
override def sortedOrder: Seq[SortOrder] = order
473+
override def outputOrdering: Seq[SortOrder] = order
474474
}
475475

476476
/** Factory for constructing new `Range` nodes. */
@@ -525,7 +525,7 @@ case class Range(
525525
Statistics(sizeInBytes = LongType.defaultSize * numElements)
526526
}
527527

528-
override def sortedOrder: Seq[SortOrder] = output.map(a => SortOrder(a, Descending))
528+
override def outputOrdering: Seq[SortOrder] = output.map(a => SortOrder(a, Descending))
529529
}
530530

531531
case class Aggregate(
@@ -872,8 +872,8 @@ case class RepartitionByExpression(
872872
override def maxRows: Option[Long] = child.maxRows
873873
override def shuffle: Boolean = true
874874

875-
override def sortedOrder: Seq[SortOrder] = partitioning match {
876-
case RangePartitioning(sortedOrder, _) => sortedOrder
875+
override def outputOrdering: Seq[SortOrder] = partitioning match {
876+
case RangePartitioning(ordering, _) => ordering
877877
case _ => Nil
878878
}
879879
}

sql/core/src/main/scala/org/apache/spark/sql/execution/ExistingRDD.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ case class LogicalRDD(
125125
output: Seq[Attribute],
126126
rdd: RDD[InternalRow],
127127
outputPartitioning: Partitioning = UnknownPartitioning(0),
128-
outputOrdering: Seq[SortOrder] = Nil,
128+
override val outputOrdering: Seq[SortOrder] = Nil,
129129
override val isStreaming: Boolean = false)(session: SparkSession)
130130
extends LeafNode with MultiInstanceRelation {
131131

sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryRelation.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,5 @@ case class InMemoryRelation(
170170
override protected def otherCopyArgs: Seq[AnyRef] =
171171
Seq(_cachedColumnBuffers, sizeInBytesStats, statsOfPlanToCache)
172172

173-
override def sortedOrder: Seq[SortOrder] = child.outputOrdering
173+
override def outputOrdering: Seq[SortOrder] = child.outputOrdering
174174
}

0 commit comments

Comments
 (0)