Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/16417#discussion_r94721395 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala --- @@ -327,24 +359,28 @@ class CodegenContext { nullable: Boolean, isVectorized: Boolean = false): String = { if (nullable) { - // Can't call setNullAt on DecimalType, because we need to keep the offset - if (!isVectorized && dataType.isInstanceOf[DecimalType]) { + // Can't call setNullAt for mutable but non-primitive data type, e.g. DecimalType, StructType + // with fix-length fields, because we need to keep the offset and length. + val isMutableVarLenField = UnsafeRow.isMutable(dataType) && !UnsafeRow.isFixedLength(dataType) --- End diff -- Do you think it is good to add `isMutableVarLenField` method into `UnsafeRow` directly?
--- 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