/** * Create a hierarchical LazyBinaryObject based on the given typeInfo. */ public static LazyBinaryObject createLazyBinaryObject(ObjectInspector oi) { ObjectInspector.Category c = oi.getCategory(); switch (c) { case PRIMITIVE: return createLazyBinaryPrimitiveClass((PrimitiveObjectInspector) oi); case MAP: return new LazyBinaryMap((LazyBinaryMapObjectInspector) oi); case LIST: return new LazyBinaryArray((LazyBinaryListObjectInspector) oi); case STRUCT: return new LazyBinaryStruct((LazyBinaryStructObjectInspector) oi); case UNION: return new LazyBinaryUnion((LazyBinaryUnionObjectInspector) oi); } throw new RuntimeException("Hive LazyBinarySerDe Internal error."); }
public static boolean lazyCompareUnion(UnionTypeInfo unionTypeInfo, LazyBinaryUnion union, UnionObject expectedUnion) { byte tag = union.getTag(); byte expectedTag = expectedUnion.getTag(); if (tag != expectedTag) { throw new RuntimeException("Union tag does not match union.getTag() " + tag + " expectedUnion.getTag() " + expectedTag); } return lazyCompare(unionTypeInfo.getAllUnionObjectTypeInfos().get(tag), union.getField(), expectedUnion.getObject()); }
/** * Get the set field out of the union. * * If the field is a primitive field, return the actual object. Otherwise * return the LazyObject. This is because PrimitiveObjectInspector does not * have control over the object used by the user - the user simply directly * use the Object instead of going through Object * PrimitiveObjectInspector.get(Object). * @return The field as a LazyObject */ public Object getField() { if (!parsed) { parse(); } if(cachedObject == null) { return uncheckedGetField(); } return cachedObject; }
/** * Return the tag of the object. */ public byte getTag(Object o) { if (o == null) { return -1; } LazyBinaryUnion lazyBinaryUnion = (LazyBinaryUnion) o; return lazyBinaryUnion.getTag(); }
/** * Return the field based on the tag value associated with the Object. */ public Object getField(Object o) { if (o == null) { return null; } LazyBinaryUnion lazyBinaryUnion = (LazyBinaryUnion) o; return lazyBinaryUnion.getField(); } }
/** * Get the set field's tag * * * @return The tag of the field set in the union */ public byte getTag() { if (!parsed) { parse(); } return tag; } }
/** * Return the tag of the object. */ public byte getTag(Object o) { if (o == null) { return -1; } LazyBinaryUnion lazyBinaryUnion = (LazyBinaryUnion) o; return lazyBinaryUnion.getTag(); }
/** * Return the field based on the tag value associated with the Object. */ public Object getField(Object o) { if (o == null) { return null; } LazyBinaryUnion lazyBinaryUnion = (LazyBinaryUnion) o; return lazyBinaryUnion.getField(); } }
/** * Get the set field's tag * * * @return The tag of the field set in the union */ public byte getTag() { if (!parsed) { parse(); } return tag; } }
/** * Get the set field out of the union. * * If the field is a primitive field, return the actual object. Otherwise * return the LazyObject. This is because PrimitiveObjectInspector does not * have control over the object used by the user - the user simply directly * use the Object instead of going through Object * PrimitiveObjectInspector.get(Object). * @return The field as a LazyObject */ public Object getField() { if (!parsed) { parse(); } if(cachedObject == null) { return uncheckedGetField(); } return cachedObject; }
public static boolean lazyCompareUnion(UnionTypeInfo unionTypeInfo, LazyBinaryUnion union, UnionObject expectedUnion) { byte tag = union.getTag(); byte expectedTag = expectedUnion.getTag(); if (tag != expectedTag) { throw new RuntimeException("Union tag does not match union.getTag() " + tag + " expectedUnion.getTag() " + expectedTag); } return lazyCompare(unionTypeInfo.getAllUnionObjectTypeInfos().get(tag), union.getField(), expectedUnion.getObject()); }
/** * Return the tag of the object. */ public byte getTag(Object o) { if (o == null) { return -1; } LazyBinaryUnion lazyBinaryUnion = (LazyBinaryUnion) o; return lazyBinaryUnion.getTag(); }
/** * Return the field based on the tag value associated with the Object. */ public Object getField(Object o) { if (o == null) { return null; } LazyBinaryUnion lazyBinaryUnion = (LazyBinaryUnion) o; return lazyBinaryUnion.getField(); } }
/** * Get the set field's tag * * * @return The tag of the field set in the union */ public byte getTag() { if (!parsed) { parse(); } return tag; } }
/** * Create a hierarchical LazyBinaryObject based on the given typeInfo. */ public static LazyBinaryObject createLazyBinaryObject(ObjectInspector oi) { ObjectInspector.Category c = oi.getCategory(); switch (c) { case PRIMITIVE: return createLazyBinaryPrimitiveClass((PrimitiveObjectInspector) oi); case MAP: return new LazyBinaryMap((LazyBinaryMapObjectInspector) oi); case LIST: return new LazyBinaryArray((LazyBinaryListObjectInspector) oi); case STRUCT: return new LazyBinaryStruct((LazyBinaryStructObjectInspector) oi); case UNION: return new LazyBinaryUnion((LazyBinaryUnionObjectInspector) oi); } throw new RuntimeException("Hive LazyBinarySerDe Internal error."); }
/** * Get the set field out of the union. * * If the field is a primitive field, return the actual object. Otherwise * return the LazyObject. This is because PrimitiveObjectInspector does not * have control over the object used by the user - the user simply directly * use the Object instead of going through Object * PrimitiveObjectInspector.get(Object). * @return The field as a LazyObject */ public Object getField() { if (!parsed) { parse(); } if(cachedObject == null) { return uncheckedGetField(); } return cachedObject; }
/** * Return the tag of the object. */ public byte getTag(Object o) { if (o == null) { return -1; } LazyBinaryUnion lazyBinaryUnion = (LazyBinaryUnion) o; return lazyBinaryUnion.getTag(); }
/** * Return the field based on the tag value associated with the Object. */ public Object getField(Object o) { if (o == null) { return null; } LazyBinaryUnion lazyBinaryUnion = (LazyBinaryUnion) o; return lazyBinaryUnion.getField(); } }
/** * Get the set field's tag * * * @return The tag of the field set in the union */ public byte getTag() { if (!parsed) { parse(); } return tag; } }
/** * Create a hierarchical LazyBinaryObject based on the given typeInfo. */ public static LazyBinaryObject createLazyBinaryObject(ObjectInspector oi) { ObjectInspector.Category c = oi.getCategory(); switch (c) { case PRIMITIVE: return createLazyBinaryPrimitiveClass((PrimitiveObjectInspector) oi); case MAP: return new LazyBinaryMap((LazyBinaryMapObjectInspector) oi); case LIST: return new LazyBinaryArray((LazyBinaryListObjectInspector) oi); case STRUCT: return new LazyBinaryStruct((LazyBinaryStructObjectInspector) oi); case UNION: return new LazyBinaryUnion((LazyBinaryUnionObjectInspector) oi); } throw new RuntimeException("Hive LazyBinarySerDe Internal error."); }