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

    https://github.com/apache/spark/pull/13065#discussion_r88571483
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala
 ---
    @@ -149,29 +167,52 @@ case class Stack(children: Seq[Expression])
           InternalRow(fields: _*)
         }
       }
    +
    +  override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): 
ExprCode = {
    +    // Rows - we write these into an array.
    +    val rowData = ctx.freshName("rows")
    +    ctx.addMutableState("InternalRow[]", rowData, s"this.$rowData = new 
InternalRow[$numRows];")
    +    val values = children.tail
    +    val dataTypes = values.take(numFields).map(_.dataType)
    +    val code = ctx.splitExpressions(ctx.INPUT_ROW, Seq.tabulate(numRows) { 
row =>
    --- End diff --
    
    I have added a test to check if it will fail compilation for a large stack 
expression. Testing the actual fallback is nearly impossible. I would need to 
change something on this line: 
https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala#L359


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