Github user MaxGekk commented on the issue:
https://github.com/apache/spark/pull/21736
> Probably it is not a big deal to get rid of lazy.
Sure. You just do unnecessary synchronization inside of lazy implementation
when you read the `lazy val` per each `null` input, for example here:
https://github.com/apache/spark/pull/21736/files#diff-9853dcf5ce3d2ac1e94d473197ff5768R103
.
In general, the difference between current implementation and yours, you
just moved constructor's parameter to its body at the beginning and added two
key words `lazy` and `@transient`. Basically this PR propose only those 3
changes. Moving constructor parameter to its body is understandable - you
simplified tests. For `lazy`, you just degrade performance in some cases.
`@transient` - serialization of `Boolean` value - not big deal.
As far as I see you are going to repeat the same pattern in another places
(functions). Maybe it makes sense to make the pattern clear here before
repeating it?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]