Github user srowen commented on the pull request:
https://github.com/apache/spark/pull/11617#issuecomment-195258085
Returning a value by modifying an arg in place is exceptional, but I don't
think it's something that can never happen. This is a case where it should, and
it's done and documented in this special-purpose implementation intentionally
for performance. I don't know about you, but around BLAS/lapack and related
methods is exactly where I expect the function args to be modified, since
that's the only way lapack works.
Ideally, the modifying in-place semantics is reusable for a bunch of
purposes. Since it's just the result of the lapack call, I suspect it could be.
However that doesn't mean it's suitable for your use case. But if your solution
is to clone for all calls, then a solution for this particular other usage is
to pass a clone of your argument, yeah.
---
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]