/** * This method will compare 2 DictionaryByteArrayWrapper objects * * @param other * @return */ @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || getClass() != other.getClass()) { return false; } DictionaryByteArrayWrapper otherObjectToCompare = (DictionaryByteArrayWrapper) other; if (data.length != otherObjectToCompare.data.length) { return false; } return ByteUtil.UnsafeComparer.INSTANCE.equals(data, otherObjectToCompare.data); }
.equals(CarbonCommonConstants.MEMBER_DEFAULT_VAL_ARRAY, 0, CarbonCommonConstants.MEMBER_DEFAULT_VAL_ARRAY.length, data, currentDataOffset, length)) {
} else { for (int i = 0; i < noDictionaryKeys.length; i++) { result = UnsafeComparer.INSTANCE.equals(noDictionaryKeys[i], noDictionaryKeysOther[i]); if (!result) { return false; } else { for (int i = 0; i < complexTypesKeys.length; i++) { result = UnsafeComparer.INSTANCE.equals(complexTypesKeys[i], complexTypesKeysOther[i]); if (!result) { return false; return UnsafeComparer.INSTANCE.equals(dictionaryKey, ((ByteArrayWrapper) other).dictionaryKey);
DataType dt = vector.getType(); if ((!(dt == DataTypes.STRING) && length == 0) || ByteUtil.UnsafeComparer.INSTANCE .equals(CarbonCommonConstants.MEMBER_DEFAULT_VAL_ARRAY, 0, CarbonCommonConstants.MEMBER_DEFAULT_VAL_ARRAY.length, value, 0, length)) { vector.putNull(vectorRow);
(data[localOffset + 2] & 0xFF) << 8) | (data[localOffset + 3] & 0xFF)); localOffset += 4; if (comparator.equals(CarbonCommonConstants.MEMBER_DEFAULT_VAL_ARRAY, 0, CarbonCommonConstants.MEMBER_DEFAULT_VAL_ARRAY.length, data, localOffset, length)) { vector.putNull(i); (data[localOffset + 2] & 0xFF) << 8) | (data[localOffset + 3] & 0xFF)); localOffset += 4; if (comparator.equals(CarbonCommonConstants.MEMBER_DEFAULT_VAL_ARRAY, 0, CarbonCommonConstants.MEMBER_DEFAULT_VAL_ARRAY.length, data, localOffset, length)) { vector.putNull(i);
@Override public void fillVector(byte[] data, CarbonColumnVector vector) { // start position will be used to store the current data position int localOffset = 0; ByteUtil.UnsafeComparer comparator = ByteUtil.UnsafeComparer.INSTANCE; for (int i = 0; i < numberOfRows; i++) { int length = (((data[localOffset] & 0xFF) << 8) | (data[localOffset + 1] & 0xFF)); localOffset += 2; if (comparator.equals(CarbonCommonConstants.MEMBER_DEFAULT_VAL_ARRAY, 0, CarbonCommonConstants.MEMBER_DEFAULT_VAL_ARRAY.length, data, localOffset, length)) { vector.putNull(i); } else { vector.putArray(i, localOffset, length); } localOffset += length; } vector.putAllByteArray(data, 0, actualDataLength); } }