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


Java ValuesReader類代碼示例

本文整理匯總了Java中parquet.column.values.ValuesReader的典型用法代碼示例。如果您正苦於以下問題:Java ValuesReader類的具體用法?Java ValuesReader怎麽用?Java ValuesReader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ValuesReader類屬於parquet.column.values包,在下文中一共展示了ValuesReader類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readPageV1

import parquet.column.values.ValuesReader; //導入依賴的package包/類
private ValuesReader readPageV1(DataPageV1 page)
{
    ValuesReader rlReader = page.getRlEncoding().getValuesReader(columnDescriptor, ValuesType.REPETITION_LEVEL);
    ValuesReader dlReader = page.getDlEncoding().getValuesReader(columnDescriptor, ValuesType.DEFINITION_LEVEL);
    repetitionReader = new ParquetLevelValuesReader(rlReader);
    definitionReader = new ParquetLevelValuesReader(dlReader);
    try {
        byte[] bytes = page.getBytes().toByteArray();
        rlReader.initFromPage(pageValueCount, bytes, 0);
        int offset = rlReader.getNextOffset();
        dlReader.initFromPage(pageValueCount, bytes, offset);
        offset = dlReader.getNextOffset();
        return initDataReader(page.getValueEncoding(), bytes, offset, page.getValueCount());
    }
    catch (IOException e) {
        throw new ParquetDecodingException("Error reading parquet page " + page + " in column " + columnDescriptor, e);
    }
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:19,代碼來源:ParquetColumnReader.java

示例2: initDataReader

import parquet.column.values.ValuesReader; //導入依賴的package包/類
private ValuesReader initDataReader(Encoding dataEncoding, byte[] bytes, int offset, int valueCount)
{
    pageValueCount = valueCount;
    ValuesReader valuesReader;
    if (dataEncoding.usesDictionary()) {
        if (dictionary == null) {
            throw new ParquetDecodingException("Dictionary is missing for Page");
        }
        valuesReader = dataEncoding.getDictionaryBasedValuesReader(columnDescriptor, ValuesType.VALUES, dictionary);
    }
    else {
        valuesReader = dataEncoding.getValuesReader(columnDescriptor, ValuesType.VALUES);
    }

    try {
        valuesReader.initFromPage(pageValueCount, bytes, offset);
        return valuesReader;
    }
    catch (IOException e) {
        throw new ParquetDecodingException("Error reading parquet page in column " + columnDescriptor, e);
    }
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:23,代碼來源:ParquetColumnReader.java

示例3: readValues

import parquet.column.values.ValuesReader; //導入依賴的package包/類
@Override
public void readValues(ValuesReader valuesReader, int valueNumber, ParquetLevelReader definitionReader)
{
    for (int i = 0; i < valueNumber; i++) {
        if (definitionReader.readLevel() == descriptor.getMaxDefinitionLevel()) {
            DOUBLE.writeDouble(blockBuilder, valuesReader.readFloat());
        }
        else {
            blockBuilder.appendNull();
        }
    }
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:13,代碼來源:ParquetFloatBuilder.java

示例4: readValues

import parquet.column.values.ValuesReader; //導入依賴的package包/類
@Override
public void readValues(ValuesReader valuesReader, int valueNumber, ParquetLevelReader definitionReader)
{
    for (int i = 0; i < valueNumber; i++) {
        if (definitionReader.readLevel() == descriptor.getMaxDefinitionLevel()) {
            BIGINT.writeLong(blockBuilder, valuesReader.readInteger());
        }
        else {
            blockBuilder.appendNull();
        }
    }
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:13,代碼來源:ParquetIntBuilder.java

示例5: readValues

import parquet.column.values.ValuesReader; //導入依賴的package包/類
@Override
public void readValues(ValuesReader valuesReader, int valueNumber, ParquetLevelReader definitionReader)
{
    for (int i = 0; i < valueNumber; i++) {
        if (definitionReader.readLevel() == descriptor.getMaxDefinitionLevel()) {
            DOUBLE.writeDouble(blockBuilder, valuesReader.readDouble());
        }
        else {
            blockBuilder.appendNull();
        }
    }
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:13,代碼來源:ParquetDoubleBuilder.java

示例6: readValues

import parquet.column.values.ValuesReader; //導入依賴的package包/類
@Override
public void readValues(ValuesReader valuesReader, int valueNumber, ParquetLevelReader definitionReader)
{
    for (int i = 0; i < valueNumber; i++) {
        if (definitionReader.readLevel() == descriptor.getMaxDefinitionLevel()) {
            BOOLEAN.writeBoolean(blockBuilder, valuesReader.readBoolean());
        }
        else {
            blockBuilder.appendNull();
        }
    }
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:13,代碼來源:ParquetBooleanBuilder.java

示例7: readValues

import parquet.column.values.ValuesReader; //導入依賴的package包/類
@Override
public void readValues(ValuesReader valuesReader, int valueNumber, ParquetLevelReader definitionReader)
{
    for (int i = 0; i < valueNumber; i++) {
        if (definitionReader.readLevel() == descriptor.getMaxDefinitionLevel()) {
            BIGINT.writeLong(blockBuilder, valuesReader.readLong());
        }
        else {
            blockBuilder.appendNull();
        }
    }
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:13,代碼來源:ParquetLongBuilder.java

示例8: readValues

import parquet.column.values.ValuesReader; //導入依賴的package包/類
@Override
public void readValues(ValuesReader valuesReader, int valueNumber, ParquetLevelReader definitionReader)
{
    for (int i = 0; i < valueNumber; i++) {
        if (definitionReader.readLevel() == descriptor.getMaxDefinitionLevel()) {
            Binary binary = valuesReader.readBytes();
            if (binary.length() != 0) {
                VARCHAR.writeSlice(blockBuilder, Slices.wrappedBuffer(binary.getBytes()));
                continue;
            }
        }
        blockBuilder.appendNull();
    }
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:15,代碼來源:ParquetBinaryBuilder.java

示例9: readPageV2

import parquet.column.values.ValuesReader; //導入依賴的package包/類
private ValuesReader readPageV2(DataPageV2 page)
{
    repetitionReader = buildLevelRLEReader(columnDescriptor.getMaxRepetitionLevel(), page.getRepetitionLevels());
    definitionReader = buildLevelRLEReader(columnDescriptor.getMaxDefinitionLevel(), page.getDefinitionLevels());
    try {
        return initDataReader(page.getDataEncoding(), page.getData().toByteArray(), 0, page.getValueCount());
    }
    catch (IOException e) {
        throw new ParquetDecodingException("could not read page " + page + " in col " + columnDescriptor, e);
    }
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:12,代碼來源:ParquetColumnReader.java

示例10: ParquetLevelValuesReader

import parquet.column.values.ValuesReader; //導入依賴的package包/類
public ParquetLevelValuesReader(ValuesReader delegate)
{
    this.delegate = delegate;
}
 
開發者ID:y-lan,項目名稱:presto,代碼行數:5,代碼來源:ParquetLevelValuesReader.java

示例11: readValues

import parquet.column.values.ValuesReader; //導入依賴的package包/類
public abstract void readValues(ValuesReader valuesReader, int valueNumber, ParquetLevelReader definitionReader); 
開發者ID:y-lan,項目名稱:presto,代碼行數:2,代碼來源:ParquetBlockBuilder.java


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