@Override
  public Object setFieldAndTag(Object union, Object field, byte tag) {
    StandardUnion unionObject = (StandardUnion) union;
    unionObject.setObject(field);
    if (field == null) {
      unionObject.setTag((byte) -1);
    } else {
      unionObject.setTag(tag);
    }
    return unionObject;
  }
Return the field based on the tag value associated with the Object.
serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StandardUnionObjectInspector.java