### Question:
OrcFileRewriter { private static int uncompressedSize(Object object) throws IOException { if (object instanceof OrcStruct) { OrcStruct struct = (OrcStruct) object; int size = 0; for (int i = 0; i < struct.getNumFields(); i++) { size += uncompressedSize(getFieldValue(struct, i)); } return size; } if ((object == null) || (object instanceof BooleanWritable)) { return SIZE_OF_BYTE; } if (object instanceof LongWritable) { return SIZE_OF_LONG; } if (object instanceof DoubleWritable) { return SIZE_OF_DOUBLE; } if (object instanceof HiveDecimalWritable) { return SIZE_OF_LONG; } if (object instanceof Text) { return ((Text) object).getLength(); } if (object instanceof BytesWritable) { return ((BytesWritable) object).getLength(); } if (object instanceof List<?>) { int size = 0; for (Object element : (Iterable<?>) object) { size += uncompressedSize(element); } return size; } if (object instanceof Map<?, ?>) { int size = 0; for (Map.Entry<?, ?> entry : ((Map<?, ?>) object).entrySet()) { size += uncompressedSize(entry.getKey()); size += uncompressedSize(entry.getValue()); } return size; } throw new IOException("Unhandled ORC object: " + object.getClass().getName()); } private  OrcFileRewriter(); static OrcFileInfo rewrite(File input, File output, BitSet rowsToDelete);  }### Answer:
@Test public void testUncompressedSize() throws Exception { List<Long> columnIds = ImmutableList.of(1L, 2L, 3L, 4L, 5L); List<Type> columnTypes = ImmutableList.of(BOOLEAN, BIGINT, DOUBLE, createVarcharType(10), VARBINARY); File file = new File(temporary, randomUUID().toString()); try (OrcFileWriter writer = new OrcFileWriter(columnIds, columnTypes, file)) { List<Page> pages = rowPagesBuilder(columnTypes) .row(true, 123L, 98.7, "hello", utf8Slice("abc")) .row(false, 456L, 65.4, "world", utf8Slice("xyz")) .row(null, null, null, null, null) .build(); writer.appendPages(pages); } File newFile = new File(temporary, randomUUID().toString()); OrcFileInfo info = OrcFileRewriter.rewrite(file, newFile, new BitSet()); assertEquals(info.getRowCount(), 3); assertEquals(info.getUncompressedSize(), 55); }