@Override public long checksum() { return XxHash64.hash(Slices.wrappedIntArray(positionLinks)); } };
public WriteChecksum build() { return new WriteChecksum( totalRowCount, stripeHash.hash(), columnHashes.stream() .map(XxHash64::hash) .collect(toImmutableList())); } }
@ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType(StandardTypes.REAL) long value) { return XxHash64.hash(floatToIntBits(intBitsToFloat((int) value))); }
@ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType(StandardTypes.DOUBLE) double value) { return XxHash64.hash(Double.doubleToLongBits(value)); } }
@ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType(StandardTypes.TIME) long value) { return XxHash64.hash(value); }
@ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType(StandardTypes.BIGINT) long value) { return XxHash64.hash(value); }
@LiteralParameters({"p", "s"}) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType("decimal(p, s)") long value) { return XxHash64.hash(value); }
@ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType(StandardTypes.TIMESTAMP) long value) { return XxHash64.hash(value); } }
@ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType(StandardTypes.DATE) long value) { return XxHash64.hash(value); } }
@ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType(StandardTypes.VARBINARY) Slice value) { return XxHash64.hash(value); }
@Override public long hash(int position, int offset, int length) { checkReadablePosition(position); return XxHash64.hash(getRawSlice(position), getPositionOffset(position) + offset, length); }
@LiteralParameters({"p", "s"}) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType("decimal(p, s)") Slice value) { return XxHash64.hash(value); } }
@ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType(StandardTypes.INTEGER) long value) { return XxHash64.hash(value); } }
@ScalarOperator(HASH_CODE) @SqlType(StandardTypes.BIGINT) public static long hashCode(@SqlType(StandardTypes.IPADDRESS) Slice value) { return XxHash64.hash(value); }
@ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType(StandardTypes.IPADDRESS) Slice value) { return XxHash64.hash(value); }
@ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType(StandardTypes.SMALLINT) long value) { return XxHash64.hash(value); } }
@ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType(StandardTypes.TIMESTAMP_WITH_TIME_ZONE) long value) { return XxHash64.hash(unpackMillisUtc(value)); }
@LiteralParameters("x") @ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType("char(x)") Slice slice) { return XxHash64.hash(slice); }
@Override public long hash(int position, int offset, int length) { checkReadablePosition(position); if (isNull(position)) { return 0; } return XxHash64.hash(getRawSlice(), valueOffset(position) + offset, length); }
@LiteralParameters("x") @ScalarOperator(XX_HASH_64) @SqlType(StandardTypes.BIGINT) public static long xxHash64(@SqlType("varchar(x)") Slice slice) { return XxHash64.hash(slice); }