@Override public List<?> getList(Object data) { if (data == null) { return null; } LazyBinaryArray array = (LazyBinaryArray) data; return array.getList(); }
/** * 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."); }
adjustArraySize(arraySize);
/** * Returns the actual primitive object at the index position inside the array * represented by this LazyBinaryObject. */ public Object getListElementObject(int index) { if (!parsed) { parse(); } if (index < 0 || index >= arraySize) { return null; } return uncheckedGetElement(index); }
@Override public Object getListElement(Object data, int index) { if (data == null) { return null; } LazyBinaryArray array = (LazyBinaryArray) data; return array.getListElementObject(index); }
/** * Returns the array size. */ public int getListLength() { if (!parsed) { parse(); } return arraySize; }
@Override public int getListLength(Object data) { if (data == null) { return -1; } LazyBinaryArray array = (LazyBinaryArray) data; return array.getListLength(); } }
/** * Returns the List of actual primitive objects. Returns null for null array. */ public List<Object> getList() { if (!parsed) { parse(); } if (cachedList == null) { cachedList = new ArrayList<Object>(arraySize); } else { cachedList.clear(); } for (int index = 0; index < arraySize; index++) { cachedList.add(uncheckedGetElement(index)); } return cachedList; } }
@Override public Object getListElement(Object data, int index) { if (data == null) { return null; } LazyBinaryArray array = (LazyBinaryArray) data; return array.getListElementObject(index); }
/** * Returns the array size. */ public int getListLength() { if (!parsed) { parse(); } return arraySize; }
@Override public int getListLength(Object data) { if (data == null) { return -1; } LazyBinaryArray array = (LazyBinaryArray) data; return array.getListLength(); } }
List<Object> list; if (lazyObject instanceof LazyBinaryArray) { list = ((LazyBinaryArray) lazyObject).getList(); } else { list = (List<Object>) lazyObject;
/** * Returns the actual primitive object at the index position inside the array * represented by this LazyBinaryObject. */ public Object getListElementObject(int index) { if (!parsed) { parse(); } if (index < 0 || index >= arraySize) { return null; } return uncheckedGetElement(index); }
@Override public Object getListElement(Object data, int index) { if (data == null) { return null; } LazyBinaryArray array = (LazyBinaryArray) data; return array.getListElementObject(index); }
/** * Returns the array size. */ public int getListLength() { if (!parsed) { parse(); } return arraySize; }
@Override public int getListLength(Object data) { if (data == null) { return -1; } LazyBinaryArray array = (LazyBinaryArray) data; return array.getListLength(); } }
/** * 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); } throw new RuntimeException("Hive LazyBinarySerDe Internal error."); }
actualValue = decodeRecordReaderList(type, ((LazyBinaryArray) actualValue).getList());
/** * Returns the actual primitive object at the index position inside the array * represented by this LazyBinaryObject. */ public Object getListElementObject(int index) { if (!parsed) { parse(); } if (index < 0 || index >= arraySize) { return null; } return uncheckedGetElement(index); }