当前位置: 首页>>代码示例>>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;未经允许,请勿转载。