@Override protected OnHeapColumnVector reserveNewColumn(int capacity, DataType type) { return new OnHeapColumnVector(capacity, type); } }
@Override protected OnHeapColumnVector reserveNewColumn(int capacity, DataType type) { return new OnHeapColumnVector(capacity, type); } }
/** * Allocates a column to store elements of `type` on or off heap. * Capacity is the initial capacity of the vector and it will grow as necessary. Capacity is * in number of elements, not number of bytes. */ public static ColumnVector allocate(int capacity, DataType type, MemoryMode mode) { if (mode == MemoryMode.OFF_HEAP) { return new OffHeapColumnVector(capacity, type); } else { return new OnHeapColumnVector(capacity, type); } }
/** * Allocates columns to store elements of each field on heap. * Capacity is the initial capacity of the vector and it will grow as necessary. Capacity is * in number of elements, not number of bytes. */ public static OnHeapColumnVector[] allocateColumns(int capacity, StructField[] fields) { OnHeapColumnVector[] vectors = new OnHeapColumnVector[fields.length]; for (int i = 0; i < fields.length; i++) { vectors[i] = new OnHeapColumnVector(capacity, fields[i].dataType()); } return vectors; }
/** * Allocates columns to store elements of each field on heap. * Capacity is the initial capacity of the vector and it will grow as necessary. Capacity is * in number of elements, not number of bytes. */ public static OnHeapColumnVector[] allocateColumns(int capacity, StructField[] fields) { OnHeapColumnVector[] vectors = new OnHeapColumnVector[fields.length]; for (int i = 0; i < fields.length; i++) { vectors[i] = new OnHeapColumnVector(capacity, fields[i].dataType()); } return vectors; }
@Override public InputPartitionReader<ColumnarBatch> createPartitionReader() { this.i = new OnHeapColumnVector(BATCH_SIZE, DataTypes.IntegerType); this.j = new OnHeapColumnVector(BATCH_SIZE, DataTypes.IntegerType); ColumnVector[] vectors = new ColumnVector[2]; vectors[0] = i; vectors[1] = j; this.batch = new ColumnarBatch(vectors); return this; }
@Override public InputPartitionReader<ColumnarBatch> createPartitionReader() { this.i = new OnHeapColumnVector(BATCH_SIZE, DataTypes.IntegerType); this.j = new OnHeapColumnVector(BATCH_SIZE, DataTypes.IntegerType); ColumnVector[] vectors = new ColumnVector[2]; vectors[0] = i; vectors[1] = j; this.batch = new ColumnarBatch(vectors); return this; }
/** * Allocates a column to store elements of `type` on or off heap. * Capacity is the initial capacity of the vector and it will grow as necessary. Capacity is * in number of elements, not number of bytes. */ public static ColumnVector allocate(int capacity, DataType type, MemoryMode mode) { if (mode == MemoryMode.OFF_HEAP) { return new OffHeapColumnVector(capacity, type); } else { return new OnHeapColumnVector(capacity, type); } }
OnHeapColumnVector missingCol = new OnHeapColumnVector(capacity, dt); missingCol.putNulls(0, capacity); missingCol.setIsConstant(); for (int i = 0; i < partitionValues.numFields(); i++) { DataType dt = partitionSchema.fields()[i].dataType(); OnHeapColumnVector partitionCol = new OnHeapColumnVector(capacity, dt); ColumnVectorUtils.populate(partitionCol, partitionValues, i); partitionCol.setIsConstant();
OnHeapColumnVector missingCol = new OnHeapColumnVector(capacity, dt); missingCol.putNulls(0, capacity); missingCol.setIsConstant(); for (int i = 0; i < partitionValues.numFields(); i++) { DataType dt = partitionSchema.fields()[i].dataType(); OnHeapColumnVector partitionCol = new OnHeapColumnVector(capacity, dt); ColumnVectorUtils.populate(partitionCol, partitionValues, i); partitionCol.setIsConstant();