public ColumnarStructBase(ObjectInspector oi, List<Integer> notSkippedColumnIDs) { List<? extends StructField> fieldRefs = ((StructObjectInspector) oi) .getAllStructFieldRefs(); int num = fieldRefs.size(); fieldInfoList = new FieldInfo[num]; for (int i = 0; i < num; i++) { ObjectInspector foi = fieldRefs.get(i).getFieldObjectInspector(); fieldInfoList[i] = new FieldInfo( createLazyObjectBase(foi), !notSkippedColumnIDs.contains(i), foi); } // maintain a list of non-NULL column IDs int min = notSkippedColumnIDs.size() > num ? num : notSkippedColumnIDs .size(); prjColIDs = new int[min]; for (int i = 0, index = 0; i < notSkippedColumnIDs.size(); ++i) { int readCol = notSkippedColumnIDs.get(i).intValue(); if (readCol < num) { prjColIDs[index] = readCol; index++; } } }
/** * Get the values of the fields as an ArrayList. * * @return The values of the fields as an ArrayList. */ public ArrayList<Object> getFieldsAsList() { if (cachedList == null) { cachedList = new ArrayList<Object>(); } else { cachedList.clear(); } for (int i = 0; i < fieldInfoList.length; i++) { cachedList.add(fieldInfoList[i].uncheckedGetField()); } return cachedList; }
public ColumnarStructBase(ObjectInspector oi, List<Integer> notSkippedColumnIDs) { List<? extends StructField> fieldRefs = ((StructObjectInspector) oi) .getAllStructFieldRefs(); int num = fieldRefs.size(); fieldInfoList = new FieldInfo[num]; for (int i = 0; i < num; i++) { ObjectInspector foi = fieldRefs.get(i).getFieldObjectInspector(); fieldInfoList[i] = new FieldInfo( createLazyObjectBase(foi), !notSkippedColumnIDs.contains(i), foi); } // maintain a list of non-NULL column IDs int min = notSkippedColumnIDs.size() > num ? num : notSkippedColumnIDs .size(); prjColIDs = new int[min]; for (int i = 0, index = 0; i < notSkippedColumnIDs.size(); ++i) { int readCol = notSkippedColumnIDs.get(i).intValue(); if (readCol < num) { prjColIDs[index] = readCol; index++; } } }
public ColumnarStructBase(ObjectInspector oi, List<Integer> notSkippedColumnIDs) { List<? extends StructField> fieldRefs = ((StructObjectInspector) oi) .getAllStructFieldRefs(); int num = fieldRefs.size(); fieldInfoList = new FieldInfo[num]; for (int i = 0; i < num; i++) { ObjectInspector foi = fieldRefs.get(i).getFieldObjectInspector(); fieldInfoList[i] = new FieldInfo( createLazyObjectBase(foi), !notSkippedColumnIDs.contains(i), foi); } // maintain a list of non-NULL column IDs int min = notSkippedColumnIDs.size() > num ? num : notSkippedColumnIDs .size(); prjColIDs = new int[min]; for (int i = 0, index = 0; i < notSkippedColumnIDs.size(); ++i) { int readCol = notSkippedColumnIDs.get(i).intValue(); if (readCol < num) { prjColIDs[index] = readCol; index++; } } }
public ColumnarStructBase(ObjectInspector oi, List<Integer> notSkippedColumnIDs) { List<? extends StructField> fieldRefs = ((StructObjectInspector) oi) .getAllStructFieldRefs(); int num = fieldRefs.size(); fieldInfoList = new FieldInfo[num]; for (int i = 0; i < num; i++) { ObjectInspector foi = fieldRefs.get(i).getFieldObjectInspector(); fieldInfoList[i] = new FieldInfo( createLazyObjectBase(foi), !notSkippedColumnIDs.contains(i), foi); } // maintain a list of non-NULL column IDs int min = notSkippedColumnIDs.size() > num ? num : notSkippedColumnIDs .size(); prjColIDs = new int[min]; for (int i = 0, index = 0; i < notSkippedColumnIDs.size(); ++i) { int readCol = notSkippedColumnIDs.get(i).intValue(); if (readCol < num) { prjColIDs[index] = readCol; index++; } } }
public ColumnarStructBase(ObjectInspector oi, List<Integer> notSkippedColumnIDs) { List<? extends StructField> fieldRefs = ((StructObjectInspector) oi) .getAllStructFieldRefs(); int num = fieldRefs.size(); fieldInfoList = new FieldInfo[num]; for (int i = 0; i < num; i++) { ObjectInspector foi = fieldRefs.get(i).getFieldObjectInspector(); fieldInfoList[i] = new FieldInfo( createLazyObjectBase(foi), !notSkippedColumnIDs.contains(i), foi); } // maintain a list of non-NULL column IDs int min = notSkippedColumnIDs.size() > num ? num : notSkippedColumnIDs .size(); prjColIDs = new int[min]; for (int i = 0, index = 0; i < notSkippedColumnIDs.size(); ++i) { int readCol = notSkippedColumnIDs.get(i).intValue(); if (readCol < num) { prjColIDs[index] = readCol; index++; } } }
/** * Get one field out of the struct. * * 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). * * NOTE: separator and nullSequence has to be the same each time this method * is called. These two parameters are used only once to parse each record. * * @param fieldID * The field ID * @return The field as a LazyObject */ public Object getField(int fieldID) { return fieldInfoList[fieldID].uncheckedGetField(); }
/** * Get one field out of the struct. * * 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). * * NOTE: separator and nullSequence has to be the same each time this method * is called. These two parameters are used only once to parse each record. * * @param fieldID * The field ID * @return The field as a LazyObject */ public Object getField(int fieldID) { return fieldInfoList[fieldID].uncheckedGetField(); }
/** * Get one field out of the struct. * * 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). * * NOTE: separator and nullSequence has to be the same each time this method * is called. These two parameters are used only once to parse each record. * * @param fieldID * The field ID * @return The field as a LazyObject */ public Object getField(int fieldID) { return fieldInfoList[fieldID].uncheckedGetField(); }
/** * Get one field out of the struct. * * 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). * * NOTE: separator and nullSequence has to be the same each time this method * is called. These two parameters are used only once to parse each record. * * @param fieldID * The field ID * @return The field as a LazyObject */ public Object getField(int fieldID) { return fieldInfoList[fieldID].uncheckedGetField(); }
/** * Get the values of the fields as an ArrayList. * * @return The values of the fields as an ArrayList. */ public ArrayList<Object> getFieldsAsList() { if (cachedList == null) { cachedList = new ArrayList<Object>(); } else { cachedList.clear(); } for (int i = 0; i < fieldInfoList.length; i++) { cachedList.add(fieldInfoList[i].uncheckedGetField()); } return cachedList; }
/** * Get the values of the fields as an ArrayList. * * @return The values of the fields as an ArrayList. */ public ArrayList<Object> getFieldsAsList() { if (cachedList == null) { cachedList = new ArrayList<Object>(); } else { cachedList.clear(); } for (int i = 0; i < fieldInfoList.length; i++) { cachedList.add(fieldInfoList[i].uncheckedGetField()); } return cachedList; }
/** * Get the values of the fields as an ArrayList. * * @return The values of the fields as an ArrayList. */ public ArrayList<Object> getFieldsAsList() { if (cachedList == null) { cachedList = new ArrayList<Object>(); } else { cachedList.clear(); } for (int i = 0; i < fieldInfoList.length; i++) { cachedList.add(fieldInfoList[i].uncheckedGetField()); } return cachedList; }
/** * Get the values of the fields as an ArrayList. * * @return The values of the fields as an ArrayList. */ public ArrayList<Object> getFieldsAsList() { if (cachedList == null) { cachedList = new ArrayList<Object>(); } else { cachedList.clear(); } for (int i = 0; i < fieldInfoList.length; i++) { cachedList.add(fieldInfoList[i].uncheckedGetField()); } return cachedList; }
public long getRawDataSerializedSize() { long serializedSize = 0; for (int i = 0; i < fieldInfoList.length; ++i) { serializedSize += fieldInfoList[i].getSerializedSize(); } return serializedSize; }
public void init(BytesRefArrayWritable cols) { for (int i = 0; i < prjColIDs.length; ++i) { int fieldIndex = prjColIDs[i]; if (fieldIndex < cols.size()) { fieldInfoList[fieldIndex].init(cols.unCheckedGet(fieldIndex)); } else { // select columns that actually do not exist in the file. fieldInfoList[fieldIndex].init(null); } } }
public void init(BytesRefArrayWritable cols) { for (int i = 0; i < prjColIDs.length; ++i) { int fieldIndex = prjColIDs[i]; if (fieldIndex < cols.size()) { fieldInfoList[fieldIndex].init(cols.unCheckedGet(fieldIndex)); } else { // select columns that actually do not exist in the file. fieldInfoList[fieldIndex].init(null); } } }
public void init(BytesRefArrayWritable cols) { for (int i = 0; i < prjColIDs.length; ++i) { int fieldIndex = prjColIDs[i]; if (fieldIndex < cols.size()) { fieldInfoList[fieldIndex].init(cols.unCheckedGet(fieldIndex)); } else { // select columns that actually do not exist in the file. fieldInfoList[fieldIndex].init(null); } } }
public long getRawDataSerializedSize() { long serializedSize = 0; for (int i = 0; i < fieldInfoList.length; ++i) { serializedSize += fieldInfoList[i].getSerializedSize(); } return serializedSize; }
public void init(BytesRefArrayWritable cols) { for (int i = 0; i < prjColIDs.length; ++i) { int fieldIndex = prjColIDs[i]; if (fieldIndex < cols.size()) { fieldInfoList[fieldIndex].init(cols.unCheckedGet(fieldIndex)); } else { // select columns that actually do not exist in the file. fieldInfoList[fieldIndex].init(null); } } }