Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/5208#discussion_r28350524
--- 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 --
If you start with a relation `(a,b,c)` and that is sorted by `a`, and you
project `(-a AS newAlias,b,c)`, it is still sorted by `a`.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]