You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/06 21:00:21 UTC
[GitHub] [spark] bersprockets commented on a diff in pull request #38923: [SPARK-41395][SQL] `InterpretedMutableProjection` should use `setDecimal` to set null values for high-precision decimals in an unsafe row
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org