Github user davies commented on a diff in the pull request: https://github.com/apache/spark/pull/11484#discussion_r55544043 --- 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 -- Once input is not null, it have to have the required length. We should passing `null` instead of empty seq.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org