Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17122#discussion_r103837174
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala
 ---
    @@ -434,6 +434,17 @@ case class RangeExec(range: 
org.apache.spark.sql.catalyst.plans.logical.Range)
         val input = ctx.freshName("input")
         // Right now, Range is only used when there is one upstream.
         ctx.addMutableState("scala.collection.Iterator", input, s"$input = 
inputs[0];")
    +
    +    val localIdx = ctx.freshName("localIdx")
    +    val localEnd = ctx.freshName("localEnd")
    +    val range = ctx.freshName("range")
    +    // we need to place consume() before calling isShouldStopRequired
    +    val body = consume(ctx, Seq(ev))
    +    val shouldStop = if (isShouldStopRequired) {
    --- End diff --
    
    `isShouldStopRequired` complicates the logic. Is it necessary? How much 
improvement it brings?


---
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]

Reply via email to