protected LazyUnionObjectInspector( List<ObjectInspector> ois, byte separator, LazyObjectInspectorParameters lazyParams) { init(ois, separator, lazyParams); }
protected void init(List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, List<String> structFieldComments, byte separator, LazyObjectInspectorParameters lazyParams) { init(structFieldNames, structFieldObjectInspectors, structFieldComments); this.separator = separator; this.lazyParams = lazyParams; }
protected void init(List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, List<String> structFieldComments, byte separator, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar) { LazyObjectInspectorParameters lazyParams = new LazyObjectInspectorParametersImpl(escaped, escapeChar, false, null, null, nullSequence, lastColumnTakesRest); init(structFieldNames, structFieldObjectInspectors, structFieldComments, separator, lazyParams); }
@Deprecated public static LazySimpleStructObjectInspector getLazySimpleStructObjectInspector( List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, List<String> structFieldComments, byte separator, Text nullSequence, boolean lastColumnTakesRest, boolean escaped,byte escapeChar, ObjectInspectorOptions option) { return getLazySimpleStructObjectInspector(structFieldNames, structFieldObjectInspectors, structFieldComments, separator, new LazyObjectInspectorParametersImpl( escaped, escapeChar, false, null, null, nullSequence, lastColumnTakesRest), option); }
@Deprecated public static LazySimpleStructObjectInspector getLazySimpleStructObjectInspector( List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, List<String> structFieldComments, byte separator, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar) { return getLazySimpleStructObjectInspector(structFieldNames, structFieldObjectInspectors, structFieldComments, separator, nullSequence, lastColumnTakesRest, escaped, escapeChar, ObjectInspectorOptions.JAVA); }
@Override public ArrayList<Object> getFieldsAsList() { ArrayList<Object> allFields = new ArrayList<Object>(); List<? extends StructField> fields = oi.getAllStructFieldRefs(); for (int i = 0; i < fields.size(); i++) { allFields.add(getField(i)); } return allFields; }
public static LazyListObjectInspector getLazySimpleListObjectInspector( ObjectInspector listElementObjectInspector, byte separator, LazyObjectInspectorParameters lazyParams) { ArrayList<Object> signature = new ArrayList<Object>(); signature.add(listElementObjectInspector); signature.add(Byte.valueOf(separator)); signature.add(lazyParams.getNullSequence().toString()); LazyObjectInspectorFactory.addCommonLazyParamsToSignature(lazyParams, signature); LazyListObjectInspector result = cachedLazySimpleListObjectInspector .get(signature); if (result == null) { result = new LazyListObjectInspector(listElementObjectInspector, separator, lazyParams); LazyListObjectInspector prev = cachedLazySimpleListObjectInspector.putIfAbsent(signature, result); if (prev != null) { result = prev; } } return result; }
@Deprecated public static LazyMapObjectInspector getLazySimpleMapObjectInspector( ObjectInspector mapKeyObjectInspector, ObjectInspector mapValueObjectInspector, byte itemSeparator, byte keyValueSeparator, Text nullSequence, boolean escaped, byte escapeChar) { return getLazySimpleMapObjectInspector(mapKeyObjectInspector, mapValueObjectInspector, itemSeparator, keyValueSeparator, new LazyObjectInspectorParametersImpl(escaped, escapeChar, false, null, null, nullSequence)); }
public static LazyUnionObjectInspector getLazyUnionObjectInspector( List<ObjectInspector> ois, byte separator, LazyObjectInspectorParameters lazyParams) { List<Object> signature = new ArrayList<Object>(); signature.add(ois); signature.add(Byte.valueOf(separator)); signature.add(lazyParams.getNullSequence().toString()); LazyObjectInspectorFactory.addCommonLazyParamsToSignature(lazyParams, signature); LazyUnionObjectInspector result = cachedLazyUnionObjectInspector .get(signature); if (result == null) { result = new LazyUnionObjectInspector(ois, separator, lazyParams); LazyUnionObjectInspector prev = cachedLazyUnionObjectInspector.putIfAbsent(signature, result); if (prev != null) { result = prev; } } return result; }
@Deprecated public static LazyUnionObjectInspector getLazyUnionObjectInspector( List<ObjectInspector> ois, byte separator, Text nullSequence, boolean escaped, byte escapeChar) { return getLazyUnionObjectInspector(ois, separator, new LazyObjectInspectorParametersImpl(escaped, escapeChar, false, null, null, nullSequence)); }
@Deprecated public static LazyListObjectInspector getLazySimpleListObjectInspector( ObjectInspector listElementObjectInspector, byte separator, Text nullSequence, boolean escaped, byte escapeChar) { return getLazySimpleListObjectInspector(listElementObjectInspector, separator, new LazyObjectInspectorParametersImpl(escaped, escapeChar, false, null, null, nullSequence)); }
/** * Get the field out of the row without checking parsed. * * @return The value of the field */ @SuppressWarnings("rawtypes") private Object uncheckedGetField() { LazyObject field = (LazyObject) this.field; if (fieldInited) { return field.getObject(); } fieldInited = true; int fieldStart = startPosition; int fieldLength = start + length - startPosition; if (isNull(oi.getNullSequence(), bytes, fieldStart, fieldLength)) { field.setNull(); } else { field.init(bytes, fieldStart, fieldLength); } return field.getObject(); }
@Override public List<Object> getStructFieldsDataAsList(Object data) { if (data == null) { return null; } // Iterate over all the fields picking up the nested structs within them List<Object> result = new ArrayList<Object>(fields.size()); for (MyField myField : fields) { result.add(getStructFieldData(data, myField)); } return result; }
@Deprecated public static LazySimpleStructObjectInspector getLazySimpleStructObjectInspector( List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, byte separator, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar) { return getLazySimpleStructObjectInspector(structFieldNames, structFieldObjectInspectors, null, separator, nullSequence, lastColumnTakesRest, escaped, escapeChar, ObjectInspectorOptions.JAVA); }
@Override public ArrayList<Object> getFieldsAsList() { ArrayList<Object> allFields = new ArrayList<Object>(); List<? extends StructField> fields = oi.getAllStructFieldRefs(); for (int i = 0; i < fields.size(); i++) { allFields.add(getField(i)); } return allFields; }
public LazySimpleStructObjectInspector(List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, List<String> structFieldComments, byte separator, LazyObjectInspectorParameters lazyParams) { init(structFieldNames, structFieldObjectInspectors, structFieldComments, separator, lazyParams); }
@Deprecated public static LazySimpleStructObjectInspector getLazySimpleStructObjectInspector( List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, byte separator, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar, ObjectInspectorOptions option) { return getLazySimpleStructObjectInspector(structFieldNames, structFieldObjectInspectors, null, separator, nullSequence, lastColumnTakesRest, escaped, escapeChar, option); }
private void initFields() { if (getFields() == null) { initLazyFields(oi.getAllStructFieldRefs()); } if (!getParsed()) { Arrays.fill(getFieldInited(), false); setParsed(true); } }
/** * Call ObjectInspectorFactory.getLazySimpleStructObjectInspector instead. */ @Deprecated protected LazySimpleStructObjectInspector(List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, byte separator, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar) { init(structFieldNames, structFieldObjectInspectors, null, separator, nullSequence, lastColumnTakesRest, escaped, escapeChar); }
@Deprecated public LazySimpleStructObjectInspector(List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, List<String> structFieldComments, byte separator, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar) { init(structFieldNames, structFieldObjectInspectors, structFieldComments, separator, nullSequence, lastColumnTakesRest, escaped, escapeChar); }