org.apache.hadoop.hive.hbase
Class HBaseCompositeKey
java.lang.Object
org.apache.hadoop.hive.serde2.lazy.LazyObjectBase
org.apache.hadoop.hive.serde2.lazy.LazyObject<OI>
org.apache.hadoop.hive.serde2.lazy.LazyNonPrimitive<LazySimpleStructObjectInspector>
org.apache.hadoop.hive.serde2.lazy.LazyStruct
org.apache.hadoop.hive.hbase.HBaseCompositeKey
- All Implemented Interfaces:
- SerDeStatsStruct
public class HBaseCompositeKey
- extends LazyStruct
HBaseCompositeKey extension of LazyStruct. All complex composite keys should extend this class
and override the LazyStruct.getField(int) method where fieldID corresponds to the ID of a
key in the composite key.
For example, for a composite key "/part1/part2/part3", part1 will have an id
0, part2 will have an id 1 and part3 will have an id 2. Custom
implementations of getField(fieldID) should return the value corresponding to that fieldID. So,
for the above example, the value returned for getField(0) should be part1,
getField(1) should be part2 and getField(2) should be part3.
All custom implementation are expected to have a constructor of the form:
MyCustomCompositeKey(LazySimpleStructObjectInspector oi, Properties tbl, Configuration conf)
| Fields inherited from class org.apache.hadoop.hive.serde2.lazy.LazyObject |
oi |
HBaseCompositeKey
public HBaseCompositeKey(LazySimpleStructObjectInspector oi)
getFieldsAsList
public ArrayList<Object> getFieldsAsList()
- Overrides:
getFieldsAsList in class LazyStruct
toLazyObject
public LazyObject<? extends ObjectInspector> toLazyObject(int fieldID,
byte[] bytes)
- Create an initialize a
LazyObject with the given bytes for the given fieldID.
- Parameters:
fieldID - field for which the object is to be createdbytes - value with which the object is to be initialized with
- Returns:
- initialized
LazyObject
Copyright © 2014 The Apache Software Foundation. All rights reserved.