diff options
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/VarLengthColumnReaders.java')
-rw-r--r-- | exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/VarLengthColumnReaders.java | 141 |
1 files changed, 0 insertions, 141 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/VarLengthColumnReaders.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/VarLengthColumnReaders.java index 2d8b4747a..dd61abda2 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/VarLengthColumnReaders.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/VarLengthColumnReaders.java @@ -19,19 +19,11 @@ package org.apache.drill.exec.store.parquet.columnreaders; import io.netty.buffer.DrillBuf; -import java.math.BigDecimal; import java.nio.ByteBuffer; import org.apache.drill.common.exceptions.ExecutionSetupException; -import org.apache.drill.exec.expr.holders.Decimal28SparseHolder; -import org.apache.drill.exec.expr.holders.Decimal38SparseHolder; -import org.apache.drill.exec.util.DecimalUtility; import org.apache.drill.exec.vector.VarDecimalVector; import org.apache.drill.exec.vector.NullableVarDecimalVector; -import org.apache.drill.exec.vector.Decimal28SparseVector; -import org.apache.drill.exec.vector.Decimal38SparseVector; -import org.apache.drill.exec.vector.NullableDecimal28SparseVector; -import org.apache.drill.exec.vector.NullableDecimal38SparseVector; import org.apache.drill.exec.vector.NullableVarBinaryVector; import org.apache.drill.exec.vector.NullableVarCharVector; import org.apache.drill.exec.vector.VarBinaryVector; @@ -45,9 +37,6 @@ import org.apache.parquet.hadoop.metadata.ColumnChunkMetaData; public class VarLengthColumnReaders { static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(VarLengthColumnReaders.class); - /* DAO 7/28/2016 replace fixed width decimal columns for variable width parquet column, and instead use variable - * width decimal column (new code, VarDecimal*) - */ public static class VarDecimalColumn extends VarLengthValuesColumn<VarDecimalVector> { protected VarDecimalVector varDecimalVector; @@ -114,131 +103,6 @@ public class VarLengthColumnReaders { return nullableVarDecimalVector.getBuffer().capacity(); } } - /* end DAO VarDecimal changes */ - - public static class Decimal28Column extends VarLengthValuesColumn<Decimal28SparseVector> { - - protected Decimal28SparseVector decimal28Vector; - - Decimal28Column(ParquetRecordReader parentReader, int allocateSize, ColumnDescriptor descriptor, - ColumnChunkMetaData columnChunkMetaData, boolean fixedLength, Decimal28SparseVector v, - SchemaElement schemaElement) throws ExecutionSetupException { - super(parentReader, allocateSize, descriptor, columnChunkMetaData, fixedLength, v, schemaElement); - this.decimal28Vector = v; - } - - @Override - public boolean setSafe(int index, DrillBuf bytebuf, int start, int length) { - int width = Decimal28SparseHolder.WIDTH; - BigDecimal intermediate = DecimalUtility.getBigDecimalFromDrillBuf(bytebuf, start, length, - schemaElement.getScale()); - if (index >= decimal28Vector.getValueCapacity()) { - return false; - } - DecimalUtility.getSparseFromBigDecimal(intermediate, decimal28Vector.getBuffer(), index * width, schemaElement.getScale(), - schemaElement.getPrecision(), Decimal28SparseHolder.nDecimalDigits); - return true; - } - - @Override - public int capacity() { - return decimal28Vector.getBuffer().capacity(); - } - } - - public static class NullableDecimal28Column extends NullableVarLengthValuesColumn<NullableDecimal28SparseVector> { - - protected NullableDecimal28SparseVector nullableDecimal28Vector; - - NullableDecimal28Column(ParquetRecordReader parentReader, int allocateSize, ColumnDescriptor descriptor, - ColumnChunkMetaData columnChunkMetaData, boolean fixedLength, NullableDecimal28SparseVector v, - SchemaElement schemaElement) throws ExecutionSetupException { - super(parentReader, allocateSize, descriptor, columnChunkMetaData, fixedLength, v, schemaElement); - nullableDecimal28Vector = v; - } - - @Override - public boolean setSafe(int index, DrillBuf bytebuf, int start, int length) { - int width = Decimal28SparseHolder.WIDTH; - BigDecimal intermediate = DecimalUtility.getBigDecimalFromDrillBuf(bytebuf, start, length, - schemaElement.getScale()); - if (index >= nullableDecimal28Vector.getValueCapacity()) { - return false; - } - DecimalUtility.getSparseFromBigDecimal(intermediate, nullableDecimal28Vector.getBuffer(), index * width, schemaElement.getScale(), - schemaElement.getPrecision(), Decimal28SparseHolder.nDecimalDigits); - nullableDecimal28Vector.getMutator().setIndexDefined(index); - return true; - } - - @Override - public int capacity() { - return nullableDecimal28Vector.getBuffer().capacity(); - } - } - - public static class Decimal38Column extends VarLengthValuesColumn<Decimal38SparseVector> { - - protected Decimal38SparseVector decimal28Vector; - - Decimal38Column(ParquetRecordReader parentReader, int allocateSize, ColumnDescriptor descriptor, - ColumnChunkMetaData columnChunkMetaData, boolean fixedLength, Decimal38SparseVector v, - SchemaElement schemaElement) throws ExecutionSetupException { - super(parentReader, allocateSize, descriptor, columnChunkMetaData, fixedLength, v, schemaElement); - decimal28Vector = v; - } - - @Override - public boolean setSafe(int index, DrillBuf bytebuf, int start, int length) { - int width = Decimal38SparseHolder.WIDTH; - BigDecimal intermediate = DecimalUtility.getBigDecimalFromDrillBuf(bytebuf, start, length, - schemaElement.getScale()); - if (index >= decimal28Vector.getValueCapacity()) { - return false; - } - DecimalUtility.getSparseFromBigDecimal(intermediate, decimal28Vector.getBuffer(), index * width, schemaElement.getScale(), - schemaElement.getPrecision(), Decimal38SparseHolder.nDecimalDigits); - return true; - } - - @Override - public int capacity() { - return decimal28Vector.getBuffer().capacity(); - } - } - - public static class NullableDecimal38Column extends NullableVarLengthValuesColumn<NullableDecimal38SparseVector> { - - private final NullableDecimal38SparseVector nullableDecimal38Vector; - - NullableDecimal38Column(ParquetRecordReader parentReader, int allocateSize, ColumnDescriptor descriptor, - ColumnChunkMetaData columnChunkMetaData, boolean fixedLength, NullableDecimal38SparseVector v, - SchemaElement schemaElement) throws ExecutionSetupException { - super(parentReader, allocateSize, descriptor, columnChunkMetaData, fixedLength, v, schemaElement); - nullableDecimal38Vector = v; - } - - @Override - public boolean setSafe(int index, DrillBuf bytebuf, int start, int length) { - int width = Decimal38SparseHolder.WIDTH; - BigDecimal intermediate = DecimalUtility.getBigDecimalFromDrillBuf(bytebuf, start, length, - schemaElement.getScale()); - if (index >= nullableDecimal38Vector.getValueCapacity()) { - return false; - } - - DecimalUtility.getSparseFromBigDecimal(intermediate, nullableDecimal38Vector.getBuffer(), index * width, schemaElement.getScale(), - schemaElement.getPrecision(), Decimal38SparseHolder.nDecimalDigits); - nullableDecimal38Vector.getMutator().setIndexDefined(index); - return true; - } - - @Override - public int capacity() { - return nullableDecimal38Vector.getBuffer().capacity(); - } - } - /* DAO */ public static class VarCharColumn extends VarLengthValuesColumn<VarCharVector> { @@ -278,8 +142,6 @@ public class VarLengthColumnReaders { public static class NullableVarCharColumn extends NullableVarLengthValuesColumn<NullableVarCharVector> { - int nullsRead; - boolean currentValNull = false; // store a hard reference to the vector (which is also stored in the superclass) to prevent repetitive casting protected final NullableVarCharVector.Mutator mutator; private final NullableVarCharVector vector; @@ -351,8 +213,6 @@ public class VarLengthColumnReaders { public static class NullableVarBinaryColumn extends NullableVarLengthValuesColumn<NullableVarBinaryVector> { - int nullsRead; - boolean currentValNull = false; // store a hard reference to the vector (which is also stored in the superclass) to prevent repetitive casting private final NullableVarBinaryVector nullableVarBinaryVector; private final NullableVarBinaryVector.Mutator mutator; @@ -365,7 +225,6 @@ public class VarLengthColumnReaders { mutator = v.getMutator(); } - @Override public boolean setSafe(int index, DrillBuf value, int start, int length) { if (index >= nullableVarBinaryVector.getValueCapacity()) { |