bersprockets commented on code in PR #38923:
URL: https://github.com/apache/spark/pull/38923#discussion_r1041454229
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/InterpretedMutableProjection.scala:
##########
@@ -67,6 +69,7 @@ class InterpretedMutableProjection(expressions:
Seq[Expression]) extends Mutable
validExprs.map(_._1.dataType).filterNot(UnsafeRow.isMutable)
.map(_.catalogString).mkString(", "))
mutableRow = row
+ unsafeMutableRow = if (mutableRow.isInstanceOf[UnsafeRow]) true else false;
Review Comment:
The generated code for `MutableProjection` doesn't seem to care about the
type of the target row. It just calls `setDecimal` for decimal null values
regardless of whether the target is an unsafe row or not:
```java
/* 092 */ // copy all the results into MutableRow
/* 093 */
/* 094 */ if (!isNull_6) {
/* 095 */ mutableRow.setDecimal(0, mutableStateArray_0[0], 27);
/* 096 */ } else {
/* 097 */ mutableRow.setDecimal(0, null, 27);
/* 098 */ }
```
So this code should probably also not care. I will make the change and test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]