@Override public void transientInit() throws HiveException { super.transientInit(); dateVector1 = new LongColumnVector(); dateVector2 = new LongColumnVector(); }
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; long 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();
dateVector1 = new LongColumnVector(size * 2); dateVector = dateVector1; } else { dateVector2 = new LongColumnVector(size * 2); dateVector = dateVector2; case TIMESTAMP: LongColumnVector lcv = (LongColumnVector) inputColVector; lcv.copySelected(batch.selectedInUse, batch.selected, batch.size, dateVector); if (dateVector.isRepeating) { date.setTime(dateVector.vector[0] / 1000000);
@Override public void nextVector(ColumnVector previousVector, boolean[] isNull, final int batchSize) throws IOException { final BytesColumnVector result = (BytesColumnVector) previousVector; // Read present/isNull stream super.nextVector(result, isNull, batchSize); scratchlcv.ensureSize(batchSize, false); BytesColumnVectorUtil.readOrcByteArrays(stream, lengths, scratchlcv, result, batchSize); }
@Override public void evaluate(VectorizedRowBatch batch) { if (childExpressions != null) { super.evaluateChildren(batch); } LongColumnVector inV = (LongColumnVector) batch.cols[inputColumn]; int[] sel = batch.selected; int n = batch.size; LongColumnVector outV = (LongColumnVector) batch.cols[outputColumn]; if (n == 0) { // Nothing to do return; } switch (inputTypes[0]) { case DATE: inV.copySelected(batch.selectedInUse, batch.selected, batch.size, outV); break; default: throw new Error("Unsupported input type " + inputTypes[0].name()); } }
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();
@Override public void nextVector(ColumnVector previousVector, boolean[] isNull, final int batchSize) throws IOException { final BytesColumnVector result = (BytesColumnVector) previousVector; // Read present/isNull stream super.nextVector(result, isNull, batchSize); scratchlcv.ensureSize(batchSize, false); BytesColumnVectorUtil.readOrcByteArrays(stream, lengths, scratchlcv, result, batchSize); }
inV.copySelected(batch.selectedInUse, batch.selected, batch.size, outV); break; default:
private LongColumnVector newRandomLongColumnVector(int range, int size) { LongColumnVector vector = new LongColumnVector(size); for (int i = 0; i < size; i++) { vector.vector[i] = random.nextInt(range); } return vector; }
outputColVector.fill(arg2Scalar); } else { arg3ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); arg3ColVector.flatten(batch.selectedInUse, sel, n); arg3ColVector.unFlatten();
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; long 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); }
lcv.isRepeating = true; } else { lcv.fill((Boolean) value == true ? 1 : 0); lcv.isRepeating = true; } else { lcv.fill((Byte) value); lcv.isRepeating = true; } else { lcv.fill((Short) value); lcv.isRepeating = true; } else { lcv.fill((Integer) value); lcv.isRepeating = true; } else { lcv.fill((Long) value); lcv.isRepeating = true; } else { lcv.fill(DateWritableV2.dateToDays((Date) value)); lcv.isRepeating = true; } else { lcv.fill(((HiveIntervalYearMonth) value).getTotalMonths());
scratchlcv.ensureSize(batchSize, false); lengths.nextVector(scratchlcv, scratchlcv.vector, batchSize); int totalLength = 0;
private VectorizedRowBatch getBatchSingleLongVectorPositiveNonZero() { VectorizedRowBatch batch = new VectorizedRowBatch(2); final int size = VectorizedRowBatch.DEFAULT_SIZE; LongColumnVector lcv = new LongColumnVector(); for (int i = 0; i < size; i++) { lcv.vector[i] = (i + 1) * 37; } batch.cols[0] = lcv; batch.cols[1] = new LongColumnVector(); batch.size = size; return batch; }
arg2ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); } else { outputColVector.fill(arg3Scalar); arg2ColVector.flatten(batch.selectedInUse, sel, n); arg2ColVector.unFlatten();