本文整理匯總了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);