Github user marmbrus commented on a diff in the pull request: https://github.com/apache/spark/pull/5208#discussion_r28287227 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala --- @@ -41,6 +41,15 @@ case class Project(projectList: Seq[NamedExpression], child: SparkPlan) extends val resuableProjection = buildProjection() iter.map(resuableProjection) } + + /** + * 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. + */ + override def outputOrdering: Option[Ordering[Row]] = None --- End diff -- Thinking about this more, I think its actually okay to just have project inherit the childs ordering. If they remove one of the attributes, its technically still sorted by it anyway...
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org