(PrimitiveObjectInspector) lazyMoi.getMapKeyObjectInspector(), binaryStorage.get(0)); LazyFactory.createLazyObject(lazyMoi.getMapValueObjectInspector(), binaryStorage.get(1)); if (isNull(oi.getNullSequence(), bytes, 0, bytes.length)) { value.setNull(); } else {
public static LazyMapObjectInspector getLazySimpleMapObjectInspector( ObjectInspector mapKeyObjectInspector, ObjectInspector mapValueObjectInspector, byte itemSeparator, byte keyValueSeparator, LazyObjectInspectorParameters lazyParams) { ArrayList<Object> signature = new ArrayList<Object>(); signature.add(mapKeyObjectInspector); signature.add(mapValueObjectInspector); signature.add(Byte.valueOf(itemSeparator)); signature.add(Byte.valueOf(keyValueSeparator)); signature.add(lazyParams.getNullSequence().toString()); LazyObjectInspectorFactory.addCommonLazyParamsToSignature(lazyParams, signature); LazyMapObjectInspector result = cachedLazySimpleMapObjectInspector .get(signature); if (result == null) { result = new LazyMapObjectInspector(mapKeyObjectInspector, mapValueObjectInspector, itemSeparator, keyValueSeparator, lazyParams); LazyMapObjectInspector prev = cachedLazySimpleMapObjectInspector.putIfAbsent(signature, result); if (prev != null) { result = prev; } } return result; }
parsed = true; byte itemSeparator = oi.getItemSeparator(); byte keyValueSeparator = oi.getKeyValueSeparator(); boolean isEscaped = oi.isEscaped(); byte escapeChar = oi.getEscapeChar();
/** * 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 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(); }
(PrimitiveObjectInspector) lazyMoi.getMapKeyObjectInspector(), binaryStorage.get(0)); LazyFactory.createLazyObject(lazyMoi.getMapValueObjectInspector(), binaryStorage.get(1));
/** * 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) { Text nullSequence = oi.getNullSequence(); int keyIBegin = keyStart[index]; int keyILength = keyEnd[index] - keyStart[index]; if (keyILength < 0 || ((keyILength == nullSequence.getLength()) && 0 == LazyUtils.compare( bytes.getData(), keyIBegin, keyILength, nullSequence.getBytes(), 0, nullSequence.getLength()))) { return null; } if (!keyInited[index]) { keyInited[index] = true; if (keyObjects[index] == null) { // Keys are always primitive keyObjects[index] = LazyFactory .createLazyPrimitiveClass((PrimitiveObjectInspector) ((MapObjectInspector) 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]; }
/** * 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 LazyObject uncheckedGetValue(int index) { Text nullSequence = oi.getNullSequence(); int valueIBegin = keyEnd[index] + 1; int valueILength = keyStart[index + 1] - 1 - valueIBegin; if (valueILength < 0 || ((valueILength == nullSequence.getLength()) && 0 == LazyUtils .compare(bytes.getData(), valueIBegin, valueILength, nullSequence .getBytes(), 0, nullSequence.getLength()))) { return null; } if (!valueInited[index]) { valueInited[index] = true; if (valueObjects[index] == null) { valueObjects[index] = LazyFactory .createLazyObject(((MapObjectInspector) oi) .getMapValueObjectInspector()); } valueObjects[index].init(bytes, valueIBegin, valueILength); } return valueObjects[index]; }
(PrimitiveObjectInspector) lazyMoi.getMapKeyObjectInspector(), binaryStorage.get(0)); LazyFactory.createLazyObject(lazyMoi.getMapValueObjectInspector(), binaryStorage.get(1)); if (isNull(oi.getNullSequence(), bytes, 0, bytes.length)) { value.setNull(); } else {
parsed = true; byte itemSeparator = oi.getItemSeparator(); byte keyValueSeparator = oi.getKeyValueSeparator(); boolean isEscaped = oi.isEscaped(); byte escapeChar = oi.getEscapeChar();
/** * 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 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(); }
public static LazyMapObjectInspector getLazySimpleMapObjectInspector( ObjectInspector mapKeyObjectInspector, ObjectInspector mapValueObjectInspector, byte itemSeparator, byte keyValueSeparator, Text nullSequence, boolean escaped, byte escapeChar) { ArrayList<Object> signature = new ArrayList<Object>(); signature.add(mapKeyObjectInspector); signature.add(mapValueObjectInspector); signature.add(Byte.valueOf(itemSeparator)); signature.add(Byte.valueOf(keyValueSeparator)); signature.add(nullSequence.toString()); signature.add(Boolean.valueOf(escaped)); signature.add(Byte.valueOf(escapeChar)); LazyMapObjectInspector result = cachedLazySimpleMapObjectInspector .get(signature); if (result == null) { result = new LazyMapObjectInspector(mapKeyObjectInspector, mapValueObjectInspector, itemSeparator, keyValueSeparator, nullSequence, escaped, escapeChar); cachedLazySimpleMapObjectInspector.put(signature, result); } return result; }
.createLazyPrimitiveClass((PrimitiveObjectInspector) lazyMoi.getMapKeyObjectInspector(), ColumnEncoding.BINARY == columnMapping.getKeyEncoding()); LazyObject<?> value = LazyFactory.createLazyObject(lazyMoi.getMapValueObjectInspector(), ColumnEncoding.BINARY == columnMapping.getValueEncoding()); if (bytes == null || isNull(oi.getNullSequence(), bytes, 0, bytes.length)) { value.setNull(); } else {
parsed = true; byte itemSeparator = oi.getItemSeparator(); byte keyValueSeparator = oi.getKeyValueSeparator(); boolean isEscaped = oi.isEscaped(); byte escapeChar = oi.getEscapeChar();
/** * 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 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(); }
public static LazyMapObjectInspector getLazySimpleMapObjectInspector( ObjectInspector mapKeyObjectInspector, ObjectInspector mapValueObjectInspector, byte itemSeparator, byte keyValueSeparator, LazyObjectInspectorParameters lazyParams) { ArrayList<Object> signature = new ArrayList<Object>(); signature.add(mapKeyObjectInspector); signature.add(mapValueObjectInspector); signature.add(Byte.valueOf(itemSeparator)); signature.add(Byte.valueOf(keyValueSeparator)); signature.add(lazyParams.getNullSequence().toString()); LazyObjectInspectorFactory.addCommonLazyParamsToSignature(lazyParams, signature); LazyMapObjectInspector result = cachedLazySimpleMapObjectInspector .get(signature); if (result == null) { result = new LazyMapObjectInspector(mapKeyObjectInspector, mapValueObjectInspector, itemSeparator, keyValueSeparator, lazyParams); LazyMapObjectInspector prev = cachedLazySimpleMapObjectInspector.putIfAbsent(signature, result); if (prev != null) { result = prev; } } return result; }