Github user holdenk commented on a diff in the pull request:
https://github.com/apache/spark/pull/11578#discussion_r56611345
--- Diff:
core/src/main/scala/org/apache/spark/util/random/RandomSampler.scala ---
@@ -155,6 +171,28 @@ class BernoulliSampler[T: ClassTag](fraction: Double)
extends RandomSampler[T, T
override def setSeed(seed: Long): Unit = rng.setSeed(seed)
+ private val gapSampling: GapSampling = if (fraction > 0.0 && fraction <
1.0) {
--- End diff --
Would this (and subsequent one) maybe be simpler as a lazy val and then get
rid of the if/else/null thing? It seems like right now we make this some times
even when it isn't used.
---
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]