diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/Exchange.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/Exchange.scala index ba866357f8bf0..d67e5c40a4727 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/Exchange.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/Exchange.scala @@ -29,7 +29,10 @@ import org.apache.spark.sql.catalyst.rules.Rule import org.apache.spark.util.MutablePair /** - * :: DeveloperApi :: + * Shuffle data according to a new partition rule, and sort inside each partition if necessary. + * @param newPartitioning The new partitioning way that required by parent + * @param sort Whether we will sort inside each partition + * @param child Child operator */ @DeveloperApi case class Exchange( diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala index c723c502ab90b..cbfcca1ea1546 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala @@ -45,11 +45,9 @@ case class Project(projectList: Seq[NamedExpression], child: SparkPlan) extends /** * outputOrdering of Project is not always same with child's outputOrdering if the certain * key is pruned, however, if the key is pruned then we must not require child using this - * ordering from upper layer, only if the ordering would not be changed by a negative, there - * would be a way to keep the ordering. - * TODO: we may utilize this feature later to avoid some unnecessary sorting. + * ordering from upper layer, so it is fine to keep it to avoid some unnecessary sorting. */ - override def outputOrdering: Option[Ordering[Row]] = None + override def outputOrdering: Option[Ordering[Row]] = child.outputOrdering } /**