/** * Set the maximum number of rows in the batch. * Data is not preserved. */ public void ensureSize(int rows) { for (ColumnVector col : cols) { col.ensureSize(rows, false); } } }
/** * Do the per-batch setup for an inner join. */ protected void innerPerBatchSetup(VectorizedRowBatch batch) { // For join operators that can generate small table results, reset their // (target) scratch columns. for (int column : smallTableValueColumnMap) { ColumnVector smallTableColumn = batch.cols[column]; smallTableColumn.reset(); } }
/** * Initializee the vector */ @Override public void init() { super.init(); childCount = 0; }
/** * Resets the row batch to default state * - sets selectedInUse to false * - sets size to 0 * - sets endOfFile to false * - resets each column * - inits each column */ public void reset() { selectedInUse = false; size = 0; endOfFile = false; for (ColumnVector vc : cols) { if (vc != null) { vc.reset(); vc.init(); } } }
childCount += length; lengths[outputElementNum] = length; keys.ensureSize(childCount, true); values.ensureSize(childCount, true); for (int i = 0; i < length; ++i) { final int inputIndex = inputOffset + i; final int outputIndex = i + offset; keys.isNull[outputIndex] = false; keys.setElement(outputIndex, inputIndex, input.keys); values.isNull[outputIndex] = false; values.setElement(outputIndex, inputIndex, input.values);
outputColVector.init(); thenColVector.copySelected(batch.selectedInUse, batch.selected, n, outputColVector); } else { outputIsNull[0] = true; final int batchIndex = thenSelected[i]; outputIsNull[batchIndex] = false; outputColVector.setElement(batchIndex, batchIndex, thenColVector);
cv.reset(); cv.ensureSize(batchSize, false); reader.nextVector(cv, null, batchSize);
outputVector.init(); outputVector.isRepeating = true; outputVector.isNull[0] = false; outputVector.setElement(0, 0, first); } else if (batch.selectedInUse) { for (int j = 0; j != n; j++) { if ( (cv.isRepeating) && (cv.noNulls || !cv.isNull[0])) { outputVector.isNull[i] = false; outputVector.setElement(i, 0, cv); break; } else if ((!cv.isRepeating) && (cv.noNulls || !cv.isNull[i])) { outputVector.isNull[i] = false; outputVector.setElement(i, i, cv); break; if ((cv.isRepeating) && (cv.noNulls || !cv.isNull[0])) { outputVector.isNull[i] = false; outputVector.setElement(i, 0, cv); break; } else if ((!cv.isRepeating) && (cv.noNulls || !cv.isNull[i])) { outputVector.isNull[i] = false; outputVector.setElement(i, i, cv); break;
@Override public void shallowCopyTo(ColumnVector otherCv) { IntervalDayTimeColumnVector other = (IntervalDayTimeColumnVector)otherCv; super.shallowCopyTo(other); other.totalSeconds = totalSeconds; other.nanos = nanos; } }
ColumnVector outputField = fields[i]; outputField.isNull[outputElementNum] = false; outputField.setElement(outputElementNum, inputElementNum, inputField);
@Override public void stringifyValue(StringBuilder buffer, int row) { if (isRepeating) { row = 0; } if (noNulls || !isNull[row]) { buffer.append("{\"tag\": "); buffer.append(tags[row]); buffer.append(", \"value\": "); fields[tags[row]].stringifyValue(buffer, row); buffer.append('}'); } else { buffer.append("null"); } }
arg2ColVector.copySelected(batch.selectedInUse, sel, n, outputColVector); } else { outputColVector.isRepeating = true; outputColVector.setElement(i, 0, arg2ColVector); } else { isNull[i] = true; outputColVector.setElement(i, 0, arg2ColVector); } else { isNull[i] = true; if (vector1[i] == 1) { isNull[i] = false; outputColVector.setElement(i, i, arg2ColVector); } else { isNull[i] = true; if (vector1[i] == 1) { isNull[i] = false; outputColVector.setElement(i, i, arg2ColVector); } else { isNull[i] = true; if (!null1[i] && vector1[i] == 1) { isNull[i] = false; outputColVector.setElement(i, 0, arg2ColVector); } else { isNull[i] = true;
int[] sel = {0, 2}; int size = 2; v.flatten(true, sel, size); Assert.assertFalse(v.noNulls); Assert.assertFalse(v.isNull[0] || v.isNull[2]); v.unFlatten(); Assert.assertTrue(v.noNulls); v.noNulls = false; v.isNull[0] = true; v.flatten(true, sel, 2); Assert.assertFalse(v.noNulls); Assert.assertTrue(v.isNull[0] && v.isNull[2]); Assert.assertFalse(v.isRepeating); v.unFlatten(); Assert.assertFalse(v.noNulls); Assert.assertTrue(v.isRepeating); if (v instanceof LongColumnVector) { ((LongColumnVector) v).vector[0] = 100; v.flatten(true, sel, 2); Assert.assertTrue(((LongColumnVector) v).vector[2] == 100); } else if (v instanceof DoubleColumnVector) { ((DoubleColumnVector) v).vector[0] = 200d; v.flatten(true, sel, 2); Assert.assertTrue(((DoubleColumnVector) v).vector[2] == 200d); } else if (v instanceof BytesColumnVector) {
outputColVector.init(); thenColVector.copySelected(batch.selectedInUse, batch.selected, n, outputColVector); } else { elseColVector.copySelected(batch.selectedInUse, batch.selected, n, outputColVector); final int batchIndex = thenSelected[i]; outputIsNull[batchIndex] = false; outputColVector.setElement(batchIndex, batchIndex, thenColVector); final int batchIndex = elseSelected[i]; outputIsNull[batchIndex] = false; outputColVector.setElement(batchIndex, batchIndex, elseColVector);
childCount += length; lengths[outputElementNum] = length; child.ensureSize(childCount, true); for (int i = 0; i < length; ++i) { final int outputIndex = i + offset; child.isNull[outputIndex] = false; child.setElement(outputIndex, inputOffset + i, input.child);
outputColVector.init(); outputColVector.setElement(0, 0, cv); outputColVector.isRepeating = true; return; outputColVector.setElement(batchIndex, 0, cv); final int batchIndex = sel[i]; outputIsNull[batchIndex] = false; outputColVector.setElement(batchIndex, batchIndex, cv); outputColVector.setElement(batchIndex, batchIndex, cv); if (!inputIsNull[batchIndex]) { outputIsNull[batchIndex] = false; outputColVector.setElement(batchIndex, batchIndex, cv); } else { unassignedBatchIndices[unassignedColumnCount++] = batchIndex; if (!inputIsNull[batchIndex]) { outputIsNull[batchIndex] = false; outputColVector.setElement(batchIndex, batchIndex, cv); } else { unassignedBatchIndices[unassignedColumnCount++] = batchIndex; final int batchIndex = unassignedBatchIndices[i]; outputIsNull[batchIndex] = false; outputColVector.setElement(batchIndex, batchIndex, cv);
@Override public void shallowCopyTo(ColumnVector otherCv) { TimestampColumnVector other = (TimestampColumnVector)otherCv; super.shallowCopyTo(other); other.time = time; other.nanos = nanos; } }
ColumnVector outputField = fields[tag]; outputField.isNull[outputElementNum] = false; outputField.setElement( outputElementNum, inputElementNum, inputField); } else {