Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/20750#discussion_r173130586
--- Diff:
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/codegen/UnsafeRowWriter.java
---
@@ -93,6 +93,26 @@ public void setNullAt(int ordinal) {
Platform.putLong(holder.buffer, getFieldOffset(ordinal), 0L);
}
+ @Override
+ public void setNullByte(int ordinal) {
--- End diff --
These methods are needed for writing `UnsafeArrayData`, we fill the slot
with 0s if we set it to null. The slot size in `UnsafeArrayData` is dependent
on the data type we are storing in it.
I wanted to avoid writing a lot of duplicate code in the
`InterpretedUsafeProjection`, and this is why I added these methods the
`UnsafeWriter` parent class, and this also why they are in the
`UnsafeRowWriter`.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]