/** * Get a 1-bit radix key from a column values of the given tuple. * The keys of 0 and 3 are reserved for null values. * * @param tuple * @param sortKeyId * @param pass * @return */ static int ascNullLast1bRadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = _1BIT_BIN_MAX_IDX; // for null if (!tuple.isBlankOrNull(sortKeyId)) { key = 2 - ((PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)) & 0xFFFF) >> 15); } return key; }
/** * Get a 16-bit radix key from a column values of the given tuple. * The return key is an unsigned short value. * * @param tuple * @param sortKeyId * @param pass * @return */ static int ascNullFirst16RadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = _16BIT_NULL_FIRST_IDX; // for null if (!tuple.isBlankOrNull(sortKeyId)) { key = 1 + (PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)) & SHORT_UNSIGNED_MASK); } return key; }
/** * Get a 16-bit radix key from a column values of the given tuple. * The return key is an unsigned short value. * * @param tuple * @param sortKeyId * @param pass * @return */ static int ascNullLast16RadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = _16BIT_NULL_LAST_IDX; // for null if (!tuple.isBlankOrNull(sortKeyId)) { key = 1 + (PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)) & SHORT_UNSIGNED_MASK); } return key; }
/** * Get a 1-bit radix key from a column values of the given tuple. * The keys of 0 and 3 are reserved for null values. * * @param tuple * @param sortKeyId * @param pass * @return */ static int ascNullFirst1bRadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = 0; // for null if (!tuple.isBlankOrNull(sortKeyId)) { key = 2 - ((PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)) & 0xFFFF) >> 15); } return key; }
/** * Get a 1-bit radix key from a column values of the given tuple. * The keys of 0 and 3 are reserved for null values. * * @param tuple * @param sortKeyId * @param pass * @return */ static int descNullLast1bRadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = _1BIT_BIN_MAX_IDX; // for null if (!tuple.isBlankOrNull(sortKeyId)) { key = 1 + ((PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)) & 0xFFFF) >> 15); } return key; }
/** * Get a 16-bit radix key from a column values of the given tuple. * The sign of the column value should be considered. * * @param tuple * @param sortKeyId * @param pass * @return */ static int descNullLastSignConsidered16RadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = _16BIT_NULL_LAST_IDX; // for null if (!tuple.isBlankOrNull(sortKeyId)) { // For positive values, the key should be 1 ~ 32768. For negative values, the key should be 32769 ~ 65536. key = _16BIT_FIRST_HALF_END_IDX - PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)); } return key; }
/** * Get a 16-bit radix key from a column values of the given tuple. * The return key is an unsigned short value. * * @param tuple * @param sortKeyId * @param pass * @return */ static int descNullLast16RadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = _16BIT_NULL_LAST_IDX; // for null if (!tuple.isBlankOrNull(sortKeyId)) { key = _16BIT_MAX_BIN_IDX - (PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)) & SHORT_UNSIGNED_MASK); } return key; }
/** * Get a 16-bit radix key from a column values of the given tuple. * The return key is an unsigned short value. * * @param tuple * @param sortKeyId * @param pass * @return */ static int descNullFirst16RadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = _16BIT_NULL_FIRST_IDX; // for null if (!tuple.isBlankOrNull(sortKeyId)) { key = _16BIT_MAX_BIN_IDX - (PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)) & SHORT_UNSIGNED_MASK); } return key; }
/** * Get a 1-bit radix key from a column values of the given tuple. * The keys of 0 and 3 are reserved for null values. * * @param tuple * @param sortKeyId * @param pass * @return */ static int descNullFirst1bRadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = 0; // for null if (!tuple.isBlankOrNull(sortKeyId)) { key = 1 + ((PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)) & 0xFFFF) >> 15); } return key; }
/** * Get a radix key from a column values of the given tuple. * The sign of the column value should be considered. * * @param tuple * @param sortKeyId * @param pass * @return */ static int ascNullLastSignConsidered16RadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = _16BIT_NULL_LAST_IDX; // for null if (!tuple.isBlankOrNull(sortKeyId)) { // For negative values, the key should be 1 ~ 32768. For positive values, the key should be 32769 ~ 65536. key = PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)) + _16BIT_SECOND_HALF_START_IDX; } return key; }
/** * Get a 16-bit radix key from a column values of the given tuple. * The sign of the column value should be considered. * * @param tuple * @param sortKeyId * @param pass * @return */ static int ascNullFirstSignConsidered16RadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = _16BIT_NULL_FIRST_IDX; // for null if (!tuple.isBlankOrNull(sortKeyId)) { // For negative values, the key should be 1 ~ 32768. For positive values, the key should be 32769 ~ 65536. key = PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)) + _16BIT_SECOND_HALF_START_IDX; } return key; }
/** * Get a 16-bit radix key from a column values of the given tuple. * The sign of the column value should be considered. * * @param tuple * @param sortKeyId * @param pass * @return */ static int descNullFirstSignConsidered16RadixKey(UnSafeTuple tuple, int sortKeyId, int pass) { int key = _16BIT_NULL_FIRST_IDX; // for null if (!tuple.isBlankOrNull(sortKeyId)) { // For positive values, the key should be 1 ~ 32768. For negative values, the key should be 32769 ~ 65536. key = _16BIT_FIRST_HALF_END_IDX - PlatformDependent.getShort(getFieldAddr(tuple.address(), sortKeyId) + (pass)); } return key; }
public static final int compareColumn(UnSafeTuple tuple1, UnSafeTuple tuple2, int index, TajoDataTypes.Type type, boolean ascending, boolean nullFirst) { final boolean n1 = tuple1.isBlankOrNull(index); final boolean n2 = tuple2.isBlankOrNull(index); if (n1 && n2) { return 0;
public static final int compareColumn(UnSafeTuple tuple1, UnSafeTuple tuple2, int index, TajoDataTypes.Type type, boolean ascending, boolean nullFirst) { final boolean n1 = tuple1.isBlankOrNull(index); final boolean n2 = tuple2.isBlankOrNull(index); if (n1 && n2) { return 0;
@Override public Datum asDatum(int fieldId) { if (isBlankOrNull(fieldId)) { return NullDatum.get();
@Override public Datum asDatum(int fieldId) { if (isBlankOrNull(fieldId)) { return NullDatum.get();