Java Code Examples for org.apache.parquet.format.PageType#DATA_PAGE
The following examples show how to use
org.apache.parquet.format.PageType#DATA_PAGE .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ParquetMetadataConverter.java From parquet-mr with Apache License 2.0 | 6 votes |
private PageHeader newDataPageHeader( int uncompressedSize, int compressedSize, int valueCount, org.apache.parquet.column.Encoding rlEncoding, org.apache.parquet.column.Encoding dlEncoding, org.apache.parquet.column.Encoding valuesEncoding, int crc) { PageHeader pageHeader = new PageHeader(PageType.DATA_PAGE, uncompressedSize, compressedSize); pageHeader.setCrc(crc); pageHeader.setData_page_header(new DataPageHeader( valueCount, getEncoding(valuesEncoding), getEncoding(dlEncoding), getEncoding(rlEncoding))); return pageHeader; }
Example 2
Source File: ParquetMetadataConverter.java From parquet-mr with Apache License 2.0 | 5 votes |
private PageHeader newDataPageHeader( int uncompressedSize, int compressedSize, int valueCount, org.apache.parquet.column.Encoding rlEncoding, org.apache.parquet.column.Encoding dlEncoding, org.apache.parquet.column.Encoding valuesEncoding) { PageHeader pageHeader = new PageHeader(PageType.DATA_PAGE, uncompressedSize, compressedSize); pageHeader.setData_page_header(new DataPageHeader( valueCount, getEncoding(valuesEncoding), getEncoding(dlEncoding), getEncoding(rlEncoding))); return pageHeader; }
Example 3
Source File: TestParquetMetadataConverter.java From parquet-mr with Apache License 2.0 | 5 votes |
@Test public void testPageHeader() throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); PageType type = PageType.DATA_PAGE; int compSize = 10; int uncSize = 20; PageHeader pageHeader = new PageHeader(type, uncSize, compSize); writePageHeader(pageHeader, out); PageHeader readPageHeader = readPageHeader(new ByteArrayInputStream(out.toByteArray())); assertEquals(pageHeader, readPageHeader); }