public static VectorizedRowBatch getVectorizedRowBatchDoubleInDoubleOut() { VectorizedRowBatch batch = new VectorizedRowBatch(2); DoubleColumnVector inV; DoubleColumnVector outV; outV = new DoubleColumnVector(); inV = new DoubleColumnVector(); inV.vector[0] = -1.5d; inV.vector[1] = -0.5d; inV.vector[2] = -0.1d; inV.vector[3] = 0d; inV.vector[4] = 0.5d; inV.vector[5] = 0.7d; inV.vector[6] = 1.5d; inV.vector[7] = 1.2345678d; batch.cols[0] = inV; batch.cols[1] = outV; batch.size = 8; return batch; }
arg2ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); } else { outputColVector.fill(arg3Scalar); arg2ColVector.flatten(batch.selectedInUse, sel, n); arg2ColVector.unFlatten();
public void flatten(boolean selectedInUse, int[] sel, int size) { flattenPush(); if (isRepeating) { isRepeating = false; double repeatVal = vector[0]; if (selectedInUse) { for (int j = 0; j < size; j++) { int i = sel[j]; vector[i] = repeatVal; } } else { Arrays.fill(vector, 0, size, repeatVal); } flattenRepeatingNulls(selectedInUse, sel, size); } flattenNoNulls(selectedInUse, sel, size); }
arg2ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); } else { arg3ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); arg2ColVector.flatten(batch.selectedInUse, sel, n); arg3ColVector.flatten(batch.selectedInUse, sel, n); arg2ColVector.unFlatten(); arg3ColVector.unFlatten();
arg2ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); } else { arg3ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); arg2ColVector.flatten(batch.selectedInUse, sel, n); arg3ColVector.flatten(batch.selectedInUse, sel, n); arg2ColVector.unFlatten(); arg3ColVector.unFlatten();
resultCV = new DoubleColumnVector(length); System.arraycopy(((DoubleColumnVector) lcv.child).vector, start, ((DoubleColumnVector) resultCV).vector, 0, length);
arg2ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); } else { outputColVector.fill(arg3Scalar); arg2ColVector.flatten(batch.selectedInUse, sel, n); arg2ColVector.unFlatten();
arg2ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); } else { arg3ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); arg2ColVector.flatten(batch.selectedInUse, sel, n); arg3ColVector.flatten(batch.selectedInUse, sel, n); arg2ColVector.unFlatten(); arg3ColVector.unFlatten();
public void flatten(boolean selectedInUse, int[] sel, int size) { flattenPush(); if (isRepeating) { isRepeating = false; double repeatVal = vector[0]; if (selectedInUse) { for (int j = 0; j < size; j++) { int i = sel[j]; vector[i] = repeatVal; } } else { Arrays.fill(vector, 0, size, repeatVal); } flattenRepeatingNulls(selectedInUse, sel, size); } flattenNoNulls(selectedInUse, sel, size); }
private VectorizedRowBatch getBatch1Long3DoubleVectors() { VectorizedRowBatch batch = new VectorizedRowBatch(4); LongColumnVector lv = new LongColumnVector(); // set first argument to IF -- boolean flag lv.vector[0] = 0; lv.vector[1] = 0; lv.vector[2] = 1; lv.vector[3] = 1; batch.cols[0] = lv; // set second argument to IF DoubleColumnVector v = new DoubleColumnVector(); v.vector[0] = -1; v.vector[1] = -2; v.vector[2] = -3; v.vector[3] = -4; batch.cols[1] = v; // set third argument to IF v = new DoubleColumnVector(); v.vector[0] = 1; v.vector[1] = 2; v.vector[2] = 3; v.vector[3] = 4; batch.cols[2] = v; // set output column batch.cols[3] = new DoubleColumnVector(); batch.size = 4; return batch; }
outputColVector.fill(arg2Scalar); } else { arg3ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); arg3ColVector.flatten(batch.selectedInUse, sel, n); arg3ColVector.unFlatten();
public void flatten(boolean selectedInUse, int[] sel, int size) { flattenPush(); if (isRepeating) { isRepeating = false; double repeatVal = vector[0]; if (selectedInUse) { for (int j = 0; j < size; j++) { int i = sel[j]; vector[i] = repeatVal; } } else { Arrays.fill(vector, 0, size, repeatVal); } flattenRepeatingNulls(selectedInUse, sel, size); } flattenNoNulls(selectedInUse, sel, size); }
public static DoubleColumnVector generateDoubleColumnVector(boolean nulls, boolean repeating, int size, Random rand) { DoubleColumnVector dcv = new DoubleColumnVector(size); dcv.noNulls = !nulls; dcv.isRepeating = repeating; double repeatingValue; do{ repeatingValue= rand.nextDouble(); }while(repeatingValue == 0); int nullFrequency = generateNullFrequency(rand); for(int i = 0; i < size; i++) { if(nulls && (repeating || i % nullFrequency == 0)) { dcv.isNull[i] = true; dcv.vector[i] = DOUBLE_VECTOR_NULL_VALUE; }else { dcv.isNull[i] = false; dcv.vector[i] = repeating ? repeatingValue : rand.nextDouble(); if(dcv.vector[i] == 0) { i--; } } } return dcv; }
outputColVector.fill(arg2Scalar); } else { arg3ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); arg3ColVector.flatten(batch.selectedInUse, sel, n); arg3ColVector.unFlatten();
public static VectorizedRowBatch getVectorizedRowBatchTimestampInDoubleOut(double[] doubleValues) { Random r = new Random(45993); VectorizedRowBatch batch = new VectorizedRowBatch(2); TimestampColumnVector tcv; DoubleColumnVector dcv; tcv = new TimestampColumnVector(doubleValues.length); dcv = new DoubleColumnVector(doubleValues.length); for (int i = 0; i < doubleValues.length; i++) { doubleValues[i] = r.nextDouble() % (double) SECONDS_LIMIT; dcv.vector[i] = doubleValues[i]; } batch.cols[0] = tcv; batch.cols[1] = dcv; batch.size = doubleValues.length; return batch; }