You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/27 18:41:04 UTC

[GitHub] [spark] ankurdave commented on a change in pull request #30160: [SPARK-33260][SQL] Fix incorrect results from SortExec when sortOrder is Stream

ankurdave commented on a change in pull request #30160:
URL: https://github.com/apache/spark/pull/30160#discussion_r512940190



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateOrdering.scala
##########
@@ -71,7 +71,13 @@ object GenerateOrdering extends CodeGenerator[Seq[SortOrder], BaseOrdering] with
     ctx.INPUT_ROW = row
     // to use INPUT_ROW we must make sure currentVars is null
     ctx.currentVars = null
-    ordering.map(_.child.genCode(ctx))
+    ordering.map(_.child.genCode(ctx)) match {
+      case stream: Stream[ExprCode] =>

Review comment:
       I agree. From a quick survey (`git grep -i -e map --and -e genCode`), a number of call sites seem vulnerable to the same bug.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org