hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zheng Shao (JIRA)" <>
Subject [jira] Created: (HIVE-537) Hive TypeInfo/ObjectInspector to support union (besides struct, array, and map)
Date Wed, 03 Jun 2009 08:58:07 GMT
Hive TypeInfo/ObjectInspector to support union (besides struct, array, and map)

                 Key: HIVE-537
             Project: Hadoop Hive
          Issue Type: New Feature
            Reporter: Zheng Shao

There are already some cases inside the code that we use heterogeneous data: JoinOperator,
and UnionOperator (in the sense that different parents can pass in records with different
We currently use Operator's parentID to distinguish that. However that approach does not extend
to more complex plans that might be needed in the future.

We will support the union type like this:

  type: primitivetype | structtype | arraytype | maptype | uniontype
  uniontype: "union" "<" tag ":" type ("," tag ":" type)* ">"

Example of serialized data format:
  We will first store the tag byte before we serialize the object. On deserialization, we
will first read out the tag byte, then we know what is the current type of the following object,
so we can deserialize it successfully.

Interface for ObjectInspector:
interface UnionObjectInspector {
  /** Returns the array of OIs that are for each of the tags
  ObjectInspector[] getObjectInspectors();
  /** Return the tag of the object.
  byte getTag(Object o);
  /** Return the field based on the tag value associated with the Object.
  Object getField(Object o);


This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message