bersprockets commented on code in PR #38923:
URL: https://github.com/apache/spark/pull/38923#discussion_r1040179271
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/InterpretedMutableProjection.scala:
##########
@@ -75,13 +78,28 @@ class InterpretedMutableProjection(expressions:
Seq[Expression]) extends Mutable
if (!e.nullable) {
(v: Any) => writer(mutableRow, v)
} else {
- (v: Any) => {
- if (v == null) {
- mutableRow.setNullAt(i)
- } else {
- writer(mutableRow, v)
- }
+ val nullSafeWriter: (InternalRow, Any) => Unit = e.dataType match {
+ case DecimalType.Fixed(precision, _) if precision >
Decimal.MAX_LONG_DIGITS =>
Review Comment:
Although this won't handle the case where the decimal type is nested in a
struct or array, that shouldn't be an issue, since in that situation the target
row won't be an unsafe row (`InterpretedMutableProjection#target` would reject
such a row, AFAICT). When the row is not an unsafe row, the plain `writer`
should be fine.
--
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]