Search in sources :

Example 1 with HyperRowSetImpl

use of org.apache.drill.test.rowSet.HyperRowSetImpl in project drill by axbaretto.

the class GenericSV4CopierTest method createSrcRowSet.

@Override
public RowSet createSrcRowSet(RootAllocator allocator) throws SchemaChangeException {
    final BatchSchema batchSchema = createTestSchema(BatchSchema.SelectionVectorMode.NONE);
    final DrillBuf drillBuf = allocator.buffer(4 * 3);
    final SelectionVector4 sv4 = new SelectionVector4(drillBuf, 3, Character.MAX_VALUE);
    final VectorContainer batch1 = new RowSetBuilder(allocator, batchSchema).addRow(row1()).addRow(row4()).build().container();
    final VectorContainer batch2 = new RowSetBuilder(allocator, batchSchema).addRow(row2()).addRow(row5()).addRow(row3()).build().container();
    final ExpandableHyperContainer hyperContainer = new ExpandableHyperContainer(batch1);
    hyperContainer.addBatch(batch2);
    sv4.set(0, 0, 0);
    sv4.set(1, 1, 0);
    sv4.set(2, 1, 2);
    return new HyperRowSetImpl(hyperContainer, sv4);
}
Also used : RowSetBuilder(org.apache.drill.test.rowSet.RowSetBuilder) ExpandableHyperContainer(org.apache.drill.exec.record.ExpandableHyperContainer) BatchSchema(org.apache.drill.exec.record.BatchSchema) HyperRowSetImpl(org.apache.drill.test.rowSet.HyperRowSetImpl) DrillBuf(io.netty.buffer.DrillBuf) SelectionVector4(org.apache.drill.exec.record.selection.SelectionVector4) VectorContainer(org.apache.drill.exec.record.VectorContainer)

Aggregations

DrillBuf (io.netty.buffer.DrillBuf)1 BatchSchema (org.apache.drill.exec.record.BatchSchema)1 ExpandableHyperContainer (org.apache.drill.exec.record.ExpandableHyperContainer)1 VectorContainer (org.apache.drill.exec.record.VectorContainer)1 SelectionVector4 (org.apache.drill.exec.record.selection.SelectionVector4)1 HyperRowSetImpl (org.apache.drill.test.rowSet.HyperRowSetImpl)1 RowSetBuilder (org.apache.drill.test.rowSet.RowSetBuilder)1