use of org.apache.hadoop.hive.ql.exec.vector.VoidColumnVector in project alluxio by Alluxio.
the class OrcRow method getColumn.
@Override
public Object getColumn(String column) {
final Integer columnPosition = mColumnNamePosition.get(column);
if (columnPosition == null) {
throw new IllegalArgumentException("Invalid column name: " + column);
}
final ColumnVector col = mBatch.cols[columnPosition];
if (col.isNull[mPosition]) {
return null;
}
if (col instanceof TimestampColumnVector) {
return ((TimestampColumnVector) col).asScratchTimestamp(mPosition).getTime();
} else if (col instanceof VoidColumnVector) {
return null;
} else if (col instanceof DecimalColumnVector) {
final HiveDecimal hiveDecimal = ((DecimalColumnVector) col).vector[mPosition].getHiveDecimal();
return hiveDecimal;
} else if (col instanceof LongColumnVector) {
return ((LongColumnVector) col).vector[mPosition];
} else if (col instanceof BytesColumnVector) {
BytesColumnVector bcv = (BytesColumnVector) col;
return Arrays.copyOfRange(bcv.vector[mPosition], bcv.start[mPosition], bcv.start[mPosition] + bcv.length[mPosition]);
} else if (col instanceof DoubleColumnVector) {
return ((DoubleColumnVector) col).vector[mPosition];
}
throw new UnsupportedOperationException("Unsupported column vector: " + col.getClass().getName());
}
Aggregations