Github user kiszk commented on the issue:
https://github.com/apache/spark/pull/13758
You are right. I missed `UnsafeArrayData` is a subclass of `ArrayData`. We
can pass `UnsafeArrayData` to an projection.
I have one question.
When we directly generate `UnsafeArrayData` from a primitive array and copy
it into an `InternalRow` (`serializefromobject_result`), the following two
operations are required:
1. Copy from a primitive array to `UnsafeArrayData`
2. Copy from `UnsafeArrayData` into `InternalRow` at line 102
On the other hand, this PR requires the following one operation
0. (No copy happens at line 086 since this PR just store a reference to a
primitive array in `GenericArrayData`)
1. Copy from a primitive array to `InternalRow` ([this
PR](https://github.com/apache/spark/pull/13911) performs `Platform.copy Memory`
without no iteration.
Can we avoid additional copy at 2. when we directly generate
`UnsafeArrayData` from a primitive array?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]