Skip to content

Commit

Permalink
Add more comments abou iterator execution
Browse files Browse the repository at this point in the history
  • Loading branch information
miland-db committed Aug 12, 2024
1 parent 5389e0c commit 12bdede
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ trait LeafStatementExec extends CompoundStatementExec {
/** Error state of the statement. */
var errorState: Option[String] = None

/** Error raised during statement execution. */
var error: Option[SparkThrowable] = None

/** Throwable to rethrow after the statement execution if the error is not handled. */
var rethrow: Option[Throwable] = None

Expand Down Expand Up @@ -168,7 +165,6 @@ class SingleStatementExec(
case e: SparkThrowable =>
raisedError = true
errorState = Some(e.getSqlState)
error = Some(e)
e match {
case throwable: Throwable =>
rethrow = Some(throwable)
Expand Down Expand Up @@ -253,7 +249,12 @@ class CompoundBodyExec(
private var localIterator: Iterator[CompoundStatementExec] = statements.iterator
private var curr: Option[CompoundStatementExec] =
if (localIterator.hasNext) Some(localIterator.next()) else None
private var stopIteration: Boolean = false // hard stop iteration flag

// Flag to stop the iteration of the current begin/end block.
// It is set to true when non-consumed leave statement is encountered.
private var stopIteration: Boolean = false

// Statement to return to after handling the error with continue handler.
private var returnHere: Option[CompoundStatementExec] = None

def getTreeIterator: Iterator[CompoundStatementExec] = treeIterator
Expand Down

0 comments on commit 12bdede

Please sign in to comment.