@Override public int hashCode() { return (int) type.hash(block, 0); }
@Override public int hashCode() { return Long.hashCode(type.hash(block, position)); }
@Override public int hashCode() { int hash = Objects.hash(type, bound); if (valueBlock.isPresent()) { hash = hash * 31 + (int) type.hash(valueBlock.get(), 0); } return hash; }
@Override public int hashCode() { int hash = Objects.hash(type); if (value != null) { hash = hash * 31 + (int) type.hash(Utils.nativeValueToBlock(type, value), 0); } return hash; }
public static long hashPosition(Type type, Block block, int position) { if (block.isNull(position)) { return NULL_HASH_CODE; } return type.hash(block, position); }
static long hashPosition(Type type, Block block, int position) { if (block.isNull(position)) { return NULL_HASH_CODE; } return type.hash(block, position); }
@UsedByGeneratedCode public static long hash(Type rowType, Block block) { BlockBuilder blockBuilder = rowType.createBlockBuilder(null, 1); blockBuilder.appendStructure(block); return rowType.hash(blockBuilder.build(), 0); } }
public static void input(Type type, NullableLongState state, Block block, int position) { state.setNull(false); if (block.isNull(position)) { state.setLong(state.getLong() + PRIME64); } else { state.setLong(state.getLong() + type.hash(block, position) * PRIME64); } }
return type.hash(block, position);
return type.hash(block, position);
private static SqlVarbinary expectedChecksum(Type type, Block block) { long result = 0; for (int i = 0; i < block.getPositionCount(); i++) { if (block.isNull(i)) { result += PRIME64; } else { result += type.hash(block, i) * PRIME64; } } return new SqlVarbinary(wrappedLongArray(result).getBytes()); } }
@TypeParameter("T") @SqlType(StandardTypes.BIGINT) public static long oldHash( @OperatorDependency(operator = HASH_CODE, returnType = StandardTypes.BIGINT, argumentTypes = "T") MethodHandle hashFunction, @TypeParameter("T") Type type, @SqlType("array(T)") Block block) { int hash = 0; for (int i = 0; i < block.getPositionCount(); i++) { checkElementNotNull(block.isNull(i), ARRAY_NULL_ELEMENT_MSG); hash = (int) getHash(hash, type.hash(block, i)); } return hash; } }
type.hash(block, position); fail("Expected UnsupportedOperationException");
@Override public int hashCode() { return type.hash(block, position); }
@Override public int hashCode() { return (int) type.hash(block, 0); }
@Override public int hashCode() { int hash = Objects.hash(type); if (value != null) { hash = hash * 31 + (int) type.hash(Utils.nativeValueToBlock(type, value), 0); } return hash; }
public static int hashPosition(Type type, Block block, int position) { if (block.isNull(position)) { return NULL_HASH_CODE; } return type.hash(block, position); }
@Override public int hash(Block block, int position) { Block arrayBlock = block.getObject(position, Block.class); int result = 1; for (int i = 0; i < arrayBlock.getPositionCount(); i++) { checkElementNotNull(arrayBlock.isNull(i)); Type elementType = fields.get(i).getType(); result = 31 * result + elementType.hash(arrayBlock, i); } return result; }
@Override public int hash(Block block, int position) { Block array = getObject(block, position); int hash = 0; for (int i = 0; i < array.getPositionCount(); i++) { checkElementNotNull(array.isNull(i), ARRAY_NULL_ELEMENT_MSG); hash = (int) CombineHashFunction.getHash(hash, elementType.hash(array, i)); } return hash; }