Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8464#discussion_r38002322
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/local/SeqScanNode.scala 
---
    @@ -25,25 +25,30 @@ import 
org.apache.spark.sql.catalyst.expressions.Attribute
      */
     case class SeqScanNode(output: Seq[Attribute], data: Seq[InternalRow]) 
extends LeafLocalNode {
     
    -  private[this] var iterator: Iterator[InternalRow] = _
    -  private[this] var currentRow: InternalRow = _
    +  override def execute(): OpenCloseRowIterator = new OpenCloseRowIterator {
     
    -  override def open(): Unit = {
    -    iterator = data.iterator
    -  }
    +    private var iter: Iterator[InternalRow] = _
    --- End diff --
    
    Why not just assign value here(we can use `val` then)? Your changes to 
`FilterNode` and `ProjectNode` also assign value to `predicate`/`project` 
immediately instead of in the `open`.


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