/** * Create a lazy primitive object instance given a primitive object inspector based on it's * type. It takes a boolean switch to decide whether to return a binary or standard variant * of the lazy object. * * @param poi PrimitiveObjectInspector * @param typeBinary a switch to return either a LazyPrimtive class or it's binary * companion * @return LazyPrimitive<? extends ObjectInspector, ? extends Writable> */ public static LazyPrimitive<? extends ObjectInspector, ? extends Writable> createLazyPrimitiveClass(PrimitiveObjectInspector poi, boolean typeBinary) { if (typeBinary) { return createLazyPrimitiveBinaryClass(poi); } else { return createLazyPrimitiveClass(poi); } }
/** * Creates a LazyObject based on the LazyObjectInspector. Will create binary variants for * primitive objects when the switch <code>typeBinary</code> is specified as true. * * @param oi ObjectInspector * @param typeBinary Boolean value used as switch to return variants of LazyPrimitive * objects which are initialized from a binary format for the data. * @return LazyObject<? extends ObjectInspector> */ public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi, boolean typeBinary) { if (oi.getCategory() == Category.PRIMITIVE) { return createLazyPrimitiveClass((PrimitiveObjectInspector) oi, typeBinary); } else { return createLazyObject(oi); } }
/** * Create a hierarchical LazyObject based on the given typeInfo. */ public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi) { ObjectInspector.Category c = oi.getCategory(); switch (c) { case PRIMITIVE: return createLazyPrimitiveClass((PrimitiveObjectInspector) oi); case MAP: return new LazyMap((LazyMapObjectInspector) oi); case LIST: return new LazyArray((LazyListObjectInspector) oi); case STRUCT: return new LazyStruct((LazySimpleStructObjectInspector) oi); case UNION: return new LazyUnion((LazyUnionObjectInspector) oi); } throw new RuntimeException("Hive LazySerDe Internal error."); }
/** * Get the key object with the index without checking parsed. * * @param index * The index into the array starting from 0 */ private LazyPrimitive<?, ?> uncheckedGetKey(int index) { if (keyInited[index]) { return keyObjects[index]; } int keyIBegin = keyStart[index]; int keyILength = keyEnd[index] - keyStart[index]; if (isNull(oi.getNullSequence(), bytes, keyIBegin, keyILength)) { return null; } keyInited[index] = true; if (keyObjects[index] == null) { keyObjects[index] = LazyFactory.createLazyPrimitiveClass( (PrimitiveObjectInspector) oi.getMapKeyObjectInspector()); } keyObjects[index].init(bytes, keyIBegin, keyILength); return keyObjects[index]; }
LazyFactory.createLazyPrimitiveClass( (PrimitiveObjectInspector) lazyMoi.getMapKeyObjectInspector(), binaryStorage.get(0));
/** * Create a lazy primitive object instance given a primitive object inspector based on it's * type. It takes a boolean switch to decide whether to return a binary or standard variant * of the lazy object. * * @param poi PrimitiveObjectInspector * @param typeBinary a switch to return either a LazyPrimtive class or it's binary * companion * @return LazyPrimitive<? extends ObjectInspector, ? extends Writable> */ public static LazyPrimitive<? extends ObjectInspector, ? extends Writable> createLazyPrimitiveClass(PrimitiveObjectInspector poi, boolean typeBinary) { if (typeBinary) { return createLazyPrimitiveBinaryClass(poi); } else { return createLazyPrimitiveClass(poi); } }
/** * Create a lazy primitive object instance given a primitive object inspector based on it's * type. It takes a boolean switch to decide whether to return a binary or standard variant * of the lazy object. * * @param poi PrimitiveObjectInspector * @param typeBinary a switch to return either a LazyPrimtive class or it's binary * companion * @return LazyPrimitive<? extends ObjectInspector, ? extends Writable> */ public static LazyPrimitive<? extends ObjectInspector, ? extends Writable> createLazyPrimitiveClass(PrimitiveObjectInspector poi, boolean typeBinary) { if (typeBinary) { return createLazyPrimitiveBinaryClass(poi); } else { return createLazyPrimitiveClass(poi); } }
/** * Create a lazy primitive object instance given a primitive object inspector based on it's * type. It takes a boolean switch to decide whether to return a binary or standard variant * of the lazy object. * * @param poi PrimitiveObjectInspector * @param typeBinary a switch to return either a LazyPrimtive class or it's binary * companion * @return LazyPrimitive<? extends ObjectInspector, ? extends Writable> */ public static LazyPrimitive<? extends ObjectInspector, ? extends Writable> createLazyPrimitiveClass(PrimitiveObjectInspector poi, boolean typeBinary) { if (typeBinary) { return createLazyPrimitiveBinaryClass(poi); } else { return createLazyPrimitiveClass(poi); } }
/** * Create a lazy primitive object instance given a primitive object inspector based on it's * type. It takes a boolean switch to decide whether to return a binary or standard variant * of the lazy object. * * @param poi PrimitiveObjectInspector * @param typeBinary a switch to return either a LazyPrimtive class or it's binary * companion * @return LazyPrimitive<? extends ObjectInspector, ? extends Writable> */ public static LazyPrimitive<? extends ObjectInspector, ? extends Writable> createLazyPrimitiveClass(PrimitiveObjectInspector poi, boolean typeBinary) { if (typeBinary) { return createLazyPrimitiveBinaryClass(poi); } else { return createLazyPrimitiveClass(poi); } }
/** * Creates a LazyObject based on the LazyObjectInspector. Will create binary variants for * primitive objects when the switch <code>typeBinary</code> is specified as true. * * @param oi ObjectInspector * @param typeBinary Boolean value used as switch to return variants of LazyPrimitive * objects which are initialized from a binary format for the data. * @return LazyObject<? extends ObjectInspector> */ public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi, boolean typeBinary) { if (oi.getCategory() == Category.PRIMITIVE) { return createLazyPrimitiveClass((PrimitiveObjectInspector) oi, typeBinary); } else { return createLazyObject(oi); } }
/** * Creates a LazyObject based on the LazyObjectInspector. Will create binary variants for * primitive objects when the switch <code>typeBinary</code> is specified as true. * * @param oi ObjectInspector * @param typeBinary Boolean value used as switch to return variants of LazyPrimitive * objects which are initialized from a binary format for the data. * @return LazyObject<? extends ObjectInspector> */ public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi, boolean typeBinary) { if (oi.getCategory() == Category.PRIMITIVE) { return createLazyPrimitiveClass((PrimitiveObjectInspector) oi, typeBinary); } else { return createLazyObject(oi); } }
/** * Creates a LazyObject based on the LazyObjectInspector. Will create binary variants for * primitive objects when the switch <code>typeBinary</code> is specified as true. * * @param oi ObjectInspector * @param typeBinary Boolean value used as switch to return variants of LazyPrimitive * objects which are initialized from a binary format for the data. * @return LazyObject<? extends ObjectInspector> */ public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi, boolean typeBinary) { if (oi.getCategory() == Category.PRIMITIVE) { return createLazyPrimitiveClass((PrimitiveObjectInspector) oi, typeBinary); } else { return createLazyObject(oi); } }
/** * Creates a LazyObject based on the LazyObjectInspector. Will create binary variants for * primitive objects when the switch <code>typeBinary</code> is specified as true. * * @param oi ObjectInspector * @param typeBinary Boolean value used as switch to return variants of LazyPrimitive * objects which are initialized from a binary format for the data. * @return LazyObject<? extends ObjectInspector> */ public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi, boolean typeBinary) { if (oi.getCategory() == Category.PRIMITIVE) { return createLazyPrimitiveClass((PrimitiveObjectInspector) oi, typeBinary); } else { return createLazyObject(oi); } }
/** * Create a hierarchical LazyObject based on the given typeInfo. */ public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi) { ObjectInspector.Category c = oi.getCategory(); switch (c) { case PRIMITIVE: return createLazyPrimitiveClass((PrimitiveObjectInspector) oi); case MAP: return new LazyMap((LazyMapObjectInspector) oi); case LIST: return new LazyArray((LazyListObjectInspector) oi); case STRUCT: return new LazyStruct((LazySimpleStructObjectInspector) oi); case UNION: return new LazyUnion((LazyUnionObjectInspector) oi); } throw new RuntimeException("Hive LazySerDe Internal error."); }
/** * Create a hierarchical LazyObject based on the given typeInfo. */ public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi) { ObjectInspector.Category c = oi.getCategory(); switch (c) { case PRIMITIVE: return createLazyPrimitiveClass((PrimitiveObjectInspector) oi); case MAP: return new LazyMap((LazyMapObjectInspector) oi); case LIST: return new LazyArray((LazyListObjectInspector) oi); case STRUCT: return new LazyStruct((LazySimpleStructObjectInspector) oi); case UNION: return new LazyUnion((LazyUnionObjectInspector) oi); } throw new RuntimeException("Hive LazySerDe Internal error."); }
/** * Create a hierarchical LazyObject based on the given typeInfo. */ public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi) { ObjectInspector.Category c = oi.getCategory(); switch (c) { case PRIMITIVE: return createLazyPrimitiveClass((PrimitiveObjectInspector) oi); case MAP: return new LazyMap((LazyMapObjectInspector) oi); case LIST: return new LazyArray((LazyListObjectInspector) oi); case STRUCT: return new LazyStruct((LazySimpleStructObjectInspector) oi); case UNION: return new LazyUnion((LazyUnionObjectInspector) oi); } throw new RuntimeException("Hive LazySerDe Internal error."); }
/** * Create a hierarchical LazyObject based on the given typeInfo. */ public static LazyObject<? extends ObjectInspector> createLazyObject(ObjectInspector oi) { ObjectInspector.Category c = oi.getCategory(); switch (c) { case PRIMITIVE: return createLazyPrimitiveClass((PrimitiveObjectInspector) oi); case MAP: return new LazyMap((LazyMapObjectInspector) oi); case LIST: return new LazyArray((LazyListObjectInspector) oi); case STRUCT: return new LazyStruct((LazySimpleStructObjectInspector) oi); case UNION: return new LazyUnion((LazyUnionObjectInspector) oi); } throw new RuntimeException("Hive LazySerDe Internal error."); }
/** * Create a hierarchical LazyObject based on the given typeInfo. */ public static LazyObject createLazyObject(ObjectInspector oi) { ObjectInspector.Category c = oi.getCategory(); switch (c) { case PRIMITIVE: return createLazyPrimitiveClass((PrimitiveObjectInspector) oi); case MAP: return new LazyMap((LazyMapObjectInspector) oi); case LIST: return new LazyArray((LazyListObjectInspector) oi); case STRUCT: return new LazyStruct((LazySimpleStructObjectInspector) oi); case UNION: return new LazyUnion((LazyUnionObjectInspector) oi); } throw new RuntimeException("Hive LazySerDe Internal error."); }
/** * Get the key object with the index without checking parsed. * * @param index * The index into the array starting from 0 */ private LazyPrimitive<?, ?> uncheckedGetKey(int index) { if (keyInited[index]) { return keyObjects[index]; } int keyIBegin = keyStart[index]; int keyILength = keyEnd[index] - keyStart[index]; if (isNull(oi.getNullSequence(), bytes, keyIBegin, keyILength)) { return null; } keyInited[index] = true; if (keyObjects[index] == null) { keyObjects[index] = LazyFactory.createLazyPrimitiveClass( (PrimitiveObjectInspector) oi.getMapKeyObjectInspector()); } keyObjects[index].init(bytes, keyIBegin, keyILength); return keyObjects[index]; }
/** * Get the key object with the index without checking parsed. * * @param index * The index into the array starting from 0 */ private LazyPrimitive<?, ?> uncheckedGetKey(int index) { if (keyInited[index]) { return keyObjects[index]; } int keyIBegin = keyStart[index]; int keyILength = keyEnd[index] - keyStart[index]; if (isNull(oi.getNullSequence(), bytes, keyIBegin, keyILength)) { return null; } keyInited[index] = true; if (keyObjects[index] == null) { keyObjects[index] = LazyFactory.createLazyPrimitiveClass( (PrimitiveObjectInspector) oi.getMapKeyObjectInspector()); } keyObjects[index].init(bytes, keyIBegin, keyILength); return keyObjects[index]; }