本文整理汇总了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);
}
}
示例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);
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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();
}
}
示例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);
}
}
示例10: ParquetLevelValuesReader
import parquet.column.values.ValuesReader; //导入依赖的package包/类
public ParquetLevelValuesReader(ValuesReader delegate)
{
this.delegate = delegate;
}
示例11: readValues
import parquet.column.values.ValuesReader; //导入依赖的package包/类
public abstract void readValues(ValuesReader valuesReader, int valueNumber, ParquetLevelReader definitionReader);