@Override public void evaluate(VectorizedRowBatch batch) { if (childExpressions != null) { this.evaluateChildren(batch); } DoubleColumnVector outputColVector = (DoubleColumnVector) batch.cols[outputCol]; int[] sel = batch.selected; int n = batch.size; double[] outputVector = outputColVector.vector; outputColVector.noNulls = true; outputColVector.isRepeating = false; // return immediately if batch is empty if (n == 0) { return; } // For no-seed case, create new random number generator locally. if (random == null) { random = new Random(); } if (batch.selectedInUse) { for(int j = 0; j != n; j++) { int i = sel[j]; outputVector[i] = random.nextDouble(); } } else { for(int i = 0; i != n; i++) { outputVector[i] = random.nextDouble(); } } }
expr = new FuncRand(99999, 0); expr.evaluate(b); sum = 0;
this.evaluateChildren(batch);
@Override public void evaluate(VectorizedRowBatch batch) { if (childExpressions != null) { this.evaluateChildren(batch); } DoubleColumnVector outputColVector = (DoubleColumnVector) batch.cols[outputCol]; int[] sel = batch.selected; int n = batch.size; double[] outputVector = outputColVector.vector; outputColVector.noNulls = true; outputColVector.isRepeating = false; // return immediately if batch is empty if (n == 0) { return; } // For no-seed case, create new random number generator locally. if (random == null) { random = new Random(); } if (batch.selectedInUse) { for(int j = 0; j != n; j++) { int i = sel[j]; outputVector[i] = random.nextDouble(); } } else { for(int i = 0; i != n; i++) { outputVector[i] = random.nextDouble(); } } }