/** * 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(); }
return v == null ? v : v.getObject(); } else { return _value;
/** * Get the element without checking out-of-bound index. */ private Object uncheckedGetElement(int index) { if (elementInited[index]) { return arrayElements[index].getObject(); } elementInited[index] = true; int elementStart = startPosition[index]; int elementLength = startPosition[index + 1] - elementStart - 1; if (arrayElements[index] == null) { arrayElements[index] = LazyFactory.createLazyObject(oi.getListElementObjectInspector()); } if (isNull(oi.getNullSequence(), bytes, elementStart, elementLength)) { arrayElements[index].setNull(); } else { arrayElements[index].init(bytes, elementStart, elementLength); } return arrayElements[index].getObject(); }
/** * Get the value object with the index without checking parsed. * * @param index * The index into the array starting from 0 */ private Object uncheckedGetValue(int index) { if (valueInited[index]) { return valueObjects[index].getObject(); } valueInited[index] = true; Text nullSequence = oi.getNullSequence(); int valueIBegin = keyEnd[index] + 1; int valueILength = valueLength[index]; if (valueObjects[index] == null) { valueObjects[index] = LazyFactory.createLazyObject(oi.getMapValueObjectInspector()); } if (isNull(oi.getNullSequence(), bytes, valueIBegin, valueILength)) { valueObjects[index].setNull(); } else { valueObjects[index].init(bytes, valueIBegin, valueILength); } return valueObjects[index].getObject(); }
cachedMap.put(key.getObject(), value.getObject());
/** * 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(); }
/** * Get the field out of the row without checking parsed. * * @return The value of the field */ private Object uncheckedGetField() { Text nullSequence = oi.getNullSequence(); int fieldLength = start + length - startPosition; if (fieldLength != 0 && fieldLength == nullSequence.getLength() && LazyUtils.compare(bytes.getData(), startPosition, fieldLength, nullSequence.getBytes(), 0, nullSequence.getLength()) == 0) { return null; } if (!fieldInited) { fieldInited = true; field.init(bytes, startPosition, fieldLength); } return field.getObject(); }
/** * 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(); }
/** * 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(); }
/** * 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(); }
/** * Get the field out of the row without checking parsed. This is called by * both getField and getFieldsAsList. * * @param fieldID * The id of the field starting from 0. * @param nullSequence * The sequence representing NULL value. * @return The value of the field */ private Object uncheckedGetField(int fieldID) { Text nullSequence = oi.getNullSequence(); // Test the length first so in most cases we avoid doing a byte[] // comparison. int fieldByteBegin = startPosition[fieldID]; int fieldLength = startPosition[fieldID + 1] - startPosition[fieldID] - 1; if ((fieldLength < 0) || (fieldLength == nullSequence.getLength() && LazyUtils.compare(bytes .getData(), fieldByteBegin, fieldLength, nullSequence.getBytes(), 0, nullSequence.getLength()) == 0)) { return null; } if (!fieldInited[fieldID]) { fieldInited[fieldID] = true; fields[fieldID].init(bytes, fieldByteBegin, fieldLength); } return fields[fieldID].getObject(); }
/** * Get the element without checking out-of-bound index. */ private Object uncheckedGetElement(int index) { if (elementInited[index]) { return arrayElements[index].getObject(); } elementInited[index] = true; int elementStart = startPosition[index]; int elementLength = startPosition[index + 1] - elementStart - 1; if (arrayElements[index] == null) { arrayElements[index] = LazyFactory.createLazyObject(oi.getListElementObjectInspector()); } if (isNull(oi.getNullSequence(), bytes, elementStart, elementLength)) { arrayElements[index].setNull(); } else { arrayElements[index].init(bytes, elementStart, elementLength); } return arrayElements[index].getObject(); }
/** * Get the element without checking out-of-bound index. */ private Object uncheckedGetElement(int index) { if (elementInited[index]) { return arrayElements[index].getObject(); } elementInited[index] = true; int elementStart = startPosition[index]; int elementLength = startPosition[index + 1] - elementStart - 1; if (arrayElements[index] == null) { arrayElements[index] = LazyFactory.createLazyObject(oi.getListElementObjectInspector()); } if (isNull(oi.getNullSequence(), bytes, elementStart, elementLength)) { arrayElements[index].setNull(); } else { arrayElements[index].init(bytes, elementStart, elementLength); } return arrayElements[index].getObject(); }
/** * Get the element without checking out-of-bound index. */ private Object uncheckedGetElement(int index) { if (elementInited[index]) { return arrayElements[index].getObject(); } elementInited[index] = true; int elementStart = startPosition[index]; int elementLength = startPosition[index + 1] - elementStart - 1; if (arrayElements[index] == null) { arrayElements[index] = LazyFactory.createLazyObject(oi.getListElementObjectInspector()); } if (isNull(oi.getNullSequence(), bytes, elementStart, elementLength)) { arrayElements[index].setNull(); } else { arrayElements[index].init(bytes, elementStart, elementLength); } return arrayElements[index].getObject(); }
/** * Get the element without checking out-of-bound index. */ private Object uncheckedGetElement(int index) { if (elementInited[index]) { return arrayElements[index].getObject(); } elementInited[index] = true; int elementStart = startPosition[index]; int elementLength = startPosition[index + 1] - elementStart - 1; if (arrayElements[index] == null) { arrayElements[index] = LazyFactory.createLazyObject(oi.getListElementObjectInspector()); } if (isNull(oi.getNullSequence(), bytes, elementStart, elementLength)) { arrayElements[index].setNull(); } else { arrayElements[index].init(bytes, elementStart, elementLength); } return arrayElements[index].getObject(); }
/** * Get the element without checking out-of-bound index. */ private Object uncheckedGetElement(int index) { Text nullSequence = oi.getNullSequence(); int elementLength = startPosition[index + 1] - startPosition[index] - 1; if (elementLength == nullSequence.getLength() && 0 == LazyUtils .compare(bytes.getData(), startPosition[index], elementLength, nullSequence.getBytes(), 0, nullSequence.getLength())) { return null; } else { if (!elementInited[index]) { elementInited[index] = true; if (arrayElements[index] == null) { arrayElements[index] = LazyFactory .createLazyObject(((ListObjectInspector) oi) .getListElementObjectInspector()); } arrayElements[index].init(bytes, startPosition[index], elementLength); } } return arrayElements[index].getObject(); }
private void parseObjectColumn(int column, byte[] bytes, int start, int length) { boolean wasNull; if (length == "\\N".length() && bytes[start] == '\\' && bytes[start + 1] == 'N') { wasNull = true; } else { LazyObject<? extends ObjectInspector> lazyObject = LazyFactory.createLazyObject(fieldInspectors[column]); ByteArrayRef byteArrayRef = new ByteArrayRef(); byteArrayRef.setData(bytes); lazyObject.init(byteArrayRef, start, length); objects[column] = getBlockObject(types[column], lazyObject.getObject(), fieldInspectors[column]); wasNull = false; } nulls[column] = wasNull; } @Override
/** * Get the value object with the index without checking parsed. * * @param index * The index into the array starting from 0 */ private Object uncheckedGetValue(int index) { if (valueInited[index]) { return valueObjects[index].getObject(); } valueInited[index] = true; Text nullSequence = oi.getNullSequence(); int valueIBegin = keyEnd[index] + 1; int valueILength = valueLength[index]; if (valueObjects[index] == null) { valueObjects[index] = LazyFactory.createLazyObject(oi.getMapValueObjectInspector()); } if (isNull(oi.getNullSequence(), bytes, valueIBegin, valueILength)) { valueObjects[index].setNull(); } else { valueObjects[index].init(bytes, valueIBegin, valueILength); } return valueObjects[index].getObject(); }
/** * Get the value object with the index without checking parsed. * * @param index * The index into the array starting from 0 */ private Object uncheckedGetValue(int index) { if (valueInited[index]) { return valueObjects[index].getObject(); } valueInited[index] = true; Text nullSequence = oi.getNullSequence(); int valueIBegin = keyEnd[index] + 1; int valueILength = valueLength[index]; if (valueObjects[index] == null) { valueObjects[index] = LazyFactory.createLazyObject(oi.getMapValueObjectInspector()); } if (isNull(oi.getNullSequence(), bytes, valueIBegin, valueILength)) { valueObjects[index].setNull(); } else { valueObjects[index].init(bytes, valueIBegin, valueILength); } return valueObjects[index].getObject(); }
return field.getObject();