當前位置: 首頁>>代碼示例>>Java>>正文


Java DictionaryPageHeader類代碼示例

本文整理匯總了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;
    }
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:27,代碼來源:ParquetPredicateUtils.java

示例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);
}
 
開發者ID:grokcoder,項目名稱:pbase,代碼行數:8,代碼來源:ParquetMetadataConverter.java

示例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()));
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:10,代碼來源:ParquetColumnChunk.java


注:本文中的parquet.format.DictionaryPageHeader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。