本文整理汇总了Java中parquet.format.DictionaryPageHeader类的典型用法代码示例。如果您正苦于以下问题:Java DictionaryPageHeader类的具体用法?Java DictionaryPageHeader怎么用?Java DictionaryPageHeader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DictionaryPageHeader类属于parquet.format包,在下文中一共展示了DictionaryPageHeader类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readDictionaryPage
import parquet.format.DictionaryPageHeader; //导入依赖的package包/类
private static DictionaryPage readDictionaryPage(byte[] data, ParquetCodecFactory codecFactory, CompressionCodecName codecName)
{
try {
ByteArrayInputStream inputStream = new ByteArrayInputStream(data);
PageHeader pageHeader = Util.readPageHeader(inputStream);
if (pageHeader.type != PageType.DICTIONARY_PAGE) {
return null;
}
// todo this wrapper is not needed
BytesInput compressedData = BytesInput.from(data, data.length - inputStream.available(), pageHeader.getCompressed_page_size());
BytesDecompressor decompressor = codecFactory.getDecompressor(codecName);
BytesInput decompressed = decompressor.decompress(compressedData, pageHeader.getUncompressed_page_size());
DictionaryPageHeader dicHeader = pageHeader.getDictionary_page_header();
Encoding encoding = Encoding.valueOf(dicHeader.getEncoding().name());
int dictionarySize = dicHeader.getNum_values();
return new DictionaryPage(decompressed, dictionarySize, encoding);
}
catch (IOException ignored) {
return null;
}
}
示例2: writeDictionaryPageHeader
import parquet.format.DictionaryPageHeader; //导入依赖的package包/类
public void writeDictionaryPageHeader(
int uncompressedSize, int compressedSize, int valueCount,
parquet.column.Encoding valuesEncoding, OutputStream to) throws IOException {
PageHeader pageHeader = new PageHeader(PageType.DICTIONARY_PAGE, uncompressedSize, compressedSize);
pageHeader.setDictionary_page_header(new DictionaryPageHeader(valueCount, getEncoding(valuesEncoding)));
writePageHeader(pageHeader, to);
}
示例3: readDictionaryPage
import parquet.format.DictionaryPageHeader; //导入依赖的package包/类
private DictionaryPage readDictionaryPage(PageHeader pageHeader, int uncompressedPageSize, int compressedPageSize)
throws IOException
{
DictionaryPageHeader dicHeader = pageHeader.getDictionary_page_header();
return new DictionaryPage(getBytesInput(compressedPageSize),
uncompressedPageSize,
dicHeader.getNum_values(),
Encoding.valueOf(dicHeader.getEncoding().name()));
}