final List<Integer> schemaChangeIdx = Lists.newArrayList(); final BatchMetaInfo aggBatchMetaInfo = new BatchMetaInfo(); final VectorContainer vectorContainer = vcSerializable.get(); aggBatchMetaInfo.add(getBatchMetaInfo(vcSerializable)); System.out.println(aggBatchMetaInfo.toString()); System.out.println(String.format("Empty batch : %d", emptyBatchNum)); System.out.println(String.format("Schema changes : %d", schemaChangeIdx.size()));
private void showSingleBatch (VectorAccessibleSerializable vcSerializable, boolean showHeader) { final VectorContainer vectorContainer = vcSerializable.get(); /* show the header of the batch */ if (showHeader) { System.out.println(getBatchMetaInfo(vcSerializable).toString()); System.out.println("Schema Information"); for (final VectorWrapper w : vectorContainer) { final MaterializedField field = w.getValueVector().getField(); System.out.println (String.format("name : %s, minor_type : %s, data_mode : %s", field.getName(), field.getType().getMinorType().toString(), field.isNullable() ? "nullable":"non-nullable" )); } } /* show the contents in the batch */ VectorUtil.logVectorAccessibleContent(vectorContainer); }
private BatchMetaInfo getBatchMetaInfo(VectorAccessibleSerializable vcSerializable) { final VectorAccessible vectorContainer = vcSerializable.get(); int rows; int selectedRows; int totalDataSize = 0; rows = vectorContainer.getRecordCount(); selectedRows = rows; if (vectorContainer.getSchema().getSelectionVectorMode() == SelectionVectorMode.TWO_BYTE) { selectedRows = vcSerializable.getSv2().getCount(); } for (final VectorWrapper w : vectorContainer) { totalDataSize += w.getValueVector().getBufferSize(); } return new BatchMetaInfo(rows, selectedRows, totalDataSize); } }