Search in sources :

Example 1 with SettableUnionObjectInspector

use of org.apache.hadoop.hive.serde2.objectinspector.SettableUnionObjectInspector in project hive by apache.

the class VectorDeserializeRow method convertUnionRowColumn.

private Object convertUnionRowColumn(ColumnVector colVector, int batchIndex, Field field) throws IOException {
    final SettableUnionObjectInspector unionOI = (SettableUnionObjectInspector) field.objectInspector;
    final UnionComplexTypeHelper unionHelper = (UnionComplexTypeHelper) field.getComplexHelper();
    final Field[] fields = unionHelper.getFields();
    final UnionColumnVector unionColumnVector = (UnionColumnVector) colVector;
    final Object union = unionOI.create();
    final int tag = deserializeRead.currentInt;
    unionOI.setFieldAndTag(union, new StandardUnion((byte) tag, convertComplexFieldRowColumn(unionColumnVector.fields[tag], batchIndex, fields[tag])), (byte) tag);
    deserializeRead.finishComplexVariableFieldsType();
    return union;
}
Also used : StructField(org.apache.hadoop.hive.serde2.objectinspector.StructField) StandardUnion(org.apache.hadoop.hive.serde2.objectinspector.StandardUnionObjectInspector.StandardUnion) SettableUnionObjectInspector(org.apache.hadoop.hive.serde2.objectinspector.SettableUnionObjectInspector)

Aggregations

SettableUnionObjectInspector (org.apache.hadoop.hive.serde2.objectinspector.SettableUnionObjectInspector)1 StandardUnion (org.apache.hadoop.hive.serde2.objectinspector.StandardUnionObjectInspector.StandardUnion)1 StructField (org.apache.hadoop.hive.serde2.objectinspector.StructField)1