Search in sources :

Example 11 with IntervalDayTimeColumnVector

use of org.apache.hadoop.hive.ql.exec.vector.IntervalDayTimeColumnVector in project hive by apache.

the class VectorHashKeyWrapperBatch method assignRowColumn.

public void assignRowColumn(VectorizedRowBatch batch, int batchIndex, int keyIndex, VectorHashKeyWrapperBase kw) throws HiveException {
    ColumnVector colVector = batch.cols[keyIndex];
    if (kw.isNull(keyIndex)) {
        colVector.noNulls = false;
        colVector.isNull[batchIndex] = true;
        return;
    }
    colVector.isNull[batchIndex] = false;
    ColumnVector.Type columnVectorType = columnVectorTypes[keyIndex];
    int columnTypeSpecificIndex = columnTypeSpecificIndices[keyIndex];
    switch(columnVectorType) {
        case LONG:
        case DECIMAL_64:
            ((LongColumnVector) colVector).vector[batchIndex] = kw.getLongValue(columnTypeSpecificIndex);
            break;
        case DOUBLE:
            ((DoubleColumnVector) colVector).vector[batchIndex] = kw.getDoubleValue(columnTypeSpecificIndex);
            break;
        case BYTES:
            ((BytesColumnVector) colVector).setVal(batchIndex, kw.getBytes(columnTypeSpecificIndex), kw.getByteStart(columnTypeSpecificIndex), kw.getByteLength(columnTypeSpecificIndex));
            break;
        case DECIMAL:
            ((DecimalColumnVector) colVector).set(batchIndex, kw.getDecimal(columnTypeSpecificIndex));
            break;
        case TIMESTAMP:
            ((TimestampColumnVector) colVector).set(batchIndex, kw.getTimestamp(columnTypeSpecificIndex));
            break;
        case INTERVAL_DAY_TIME:
            ((IntervalDayTimeColumnVector) colVector).set(batchIndex, kw.getIntervalDayTime(columnTypeSpecificIndex));
            break;
        default:
            throw new HiveException("Unexpected column vector type " + columnVectorType);
    }
}
Also used : TimestampColumnVector(org.apache.hadoop.hive.ql.exec.vector.TimestampColumnVector) DecimalColumnVector(org.apache.hadoop.hive.ql.exec.vector.DecimalColumnVector) DoubleColumnVector(org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector) HiveException(org.apache.hadoop.hive.ql.metadata.HiveException) Type(org.apache.hadoop.hive.ql.exec.vector.ColumnVector.Type) IntervalDayTimeColumnVector(org.apache.hadoop.hive.ql.exec.vector.IntervalDayTimeColumnVector) BytesColumnVector(org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector) LongColumnVector(org.apache.hadoop.hive.ql.exec.vector.LongColumnVector) TimestampColumnVector(org.apache.hadoop.hive.ql.exec.vector.TimestampColumnVector) DecimalColumnVector(org.apache.hadoop.hive.ql.exec.vector.DecimalColumnVector) BytesColumnVector(org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector) LongColumnVector(org.apache.hadoop.hive.ql.exec.vector.LongColumnVector) ColumnVector(org.apache.hadoop.hive.ql.exec.vector.ColumnVector) IntervalDayTimeColumnVector(org.apache.hadoop.hive.ql.exec.vector.IntervalDayTimeColumnVector) DoubleColumnVector(org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector)

Aggregations

IntervalDayTimeColumnVector (org.apache.hadoop.hive.ql.exec.vector.IntervalDayTimeColumnVector)11 LongColumnVector (org.apache.hadoop.hive.ql.exec.vector.LongColumnVector)10 BytesColumnVector (org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector)7 DecimalColumnVector (org.apache.hadoop.hive.ql.exec.vector.DecimalColumnVector)6 DoubleColumnVector (org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector)6 TimestampColumnVector (org.apache.hadoop.hive.ql.exec.vector.TimestampColumnVector)6 ColumnVector (org.apache.hadoop.hive.ql.exec.vector.ColumnVector)4 Timestamp (java.sql.Timestamp)1 HiveIntervalDayTime (org.apache.hadoop.hive.common.type.HiveIntervalDayTime)1 Type (org.apache.hadoop.hive.ql.exec.vector.ColumnVector.Type)1 HiveException (org.apache.hadoop.hive.ql.metadata.HiveException)1 HiveDecimalWritable (org.apache.hadoop.hive.serde2.io.HiveDecimalWritable)1