Skip to content

Conversation

kb18951452
Copy link

No description provided.

if(samplingPercent == 0) {
var increment = 0;
} else {
var increment = 100/samplingPercent;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's type cast this to integer so that increment is a natural number always.
Also I think we should have a condition samplingPercent > 0 and <= 100 and then we can run a for loop inside it.
Also would be good to break this into two separate functions one for filtering and other for sampling. Filtering one returns filtered + tobesampled records and takes records as input
while sampling one takes tobesampled records and sampling percent as input and returns sampled records
later on we merge the filtered and sampled records

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants