private Row(ColumnarBatch parent) { this.parent = parent; this.fixedLenRowSize = UnsafeRow.calculateFixedPortionByteSize(parent.numCols()); this.columns = parent.columns; }
/** * Resets the batch for writing. */ public void reset() { for (int i = 0; i < numCols(); ++i) { columns[i].reset(); } if (this.numRowsFiltered > 0) { Arrays.fill(filteredRows, false); } this.numRows = 0; this.numRowsFiltered = 0; }
private Row(ColumnarBatch parent) { this.parent = parent; this.fixedLenRowSize = UnsafeRow.calculateFixedPortionByteSize(parent.numCols()); this.columns = parent.columns; }
/** * Resets the batch for writing. */ public void reset() { for (int i = 0; i < numCols(); ++i) { columns[i].reset(); } if (this.numRowsFiltered > 0) { Arrays.fill(filteredRows, false); } this.numRows = 0; this.numRowsFiltered = 0; }
/** * Resets this column for writing. The currently stored values are no longer accessible. */ public void reset() { for (int i = 0; i < columnarBatch.numCols(); i++) { ((ColumnVectorProxy) columnarBatch.column(i)).reset(); } }
/** * Adapter class which handles the columnar vector reading of the carbondata * based on the spark ColumnVector and ColumnarBatch API. This proxy class * handles the complexity of spark 2.3 version related api changes since * spark ColumnVector and ColumnarBatch interfaces are still evolving. * * @param memMode which represent the type onheap or offheap vector. * @param outputSchema, metadata related to current schema of table. * @param rowNum rows number for vector reading * @param useLazyLoad Whether to use lazy load while getting the data. */ public CarbonVectorProxy(MemoryMode memMode, StructType outputSchema, int rowNum, boolean useLazyLoad) { columnarBatch = ColumnarBatch.allocate(outputSchema, memMode, rowNum); columnVectorProxies = new ColumnVectorProxy[columnarBatch.numCols()]; for (int i = 0; i < columnVectorProxies.length; i++) { if (useLazyLoad) { columnVectorProxies[i] = new ColumnVectorProxyWithLazyLoad(columnarBatch.column(i), rowNum, memMode); } else { columnVectorProxies[i] = new ColumnVectorProxy(columnarBatch.column(i), rowNum, memMode); } } updateColumnVectors(); }