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

    https://github.com/apache/spark/pull/11484#discussion_r54997367
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegen.scala 
---
    @@ -109,7 +114,10 @@ trait CodegenSupport extends SparkPlan {
         * Consume the columns generated from current SparkPlan, call it's 
parent.
         */
       final def consume(ctx: CodegenContext, input: Seq[ExprCode], row: String 
= null): String = {
    -    if (input != null) {
    +    // We check if input expressions has same length as output when:
    +    // 1. parent can't consume UnsafeRow and input is not null.
    +    // 2. parent consumes UnsafeRow and row is null.
    +    if ((input != null && !parent.consumeUnsafeRow) || 
(parent.consumeUnsafeRow && row == null)) {
    --- End diff --
    
    When the child knows its parent can consume UnsafeRow, it can choose to 
pass an UnsafeRow and empty input. If so, we don't need to check if 
`input.length == output.length` here.


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