private void parse() {
      LazyBinaryUnionObjectInspector uoi = (LazyBinaryUnionObjectInspector) oi;

      /**
       * Please note that tag is followed by field
       */
      int unionByteEnd = start + length;
      byte[] byteArr = this.bytes.getData();

      //Tag of union field is the first byte to be parsed
      final int tagEnd = start + 1;
      tag = byteArr[start];
      field = LazyBinaryFactory.createLazyBinaryObject(uoi.getObjectInspectors().get(tag));
      //Check the union field's length and offset
      LazyBinaryUtils.checkObjectByteInfo(uoi.getObjectInspectors().get(tag), byteArr, tagEnd, recordInfo, vInt);
      fieldStart = tagEnd + recordInfo.elementOffset;
      // Add 1 for tag
      fieldLength = recordInfo.elementSize;

      // Extra bytes at the end?
      if (!extraFieldWarned &&  (fieldStart + fieldLength) < unionByteEnd) {
        extraFieldWarned = true;
        LOG.warn("Extra bytes detected at the end of the row! Ignoring similar "
                         + "problems.");
      }

      // Missing fields?
      if (!missingFieldWarned && (fieldStart + fieldLength) > unionByteEnd) {
        missingFieldWarned = true;
        LOG.info("Missing fields! Expected 1 fields but "
                         + "only got " + field + "! Ignoring similar problems.");
      }

      parsed = true;
    }
Parse the byte[] and fill fieldStart, fieldLength, fieldInited and
fieldIsNull.
serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinaryUnion.java