use of com.facebook.presto.spi.BucketFunction in project presto by prestodb.
the class TestRaptorBucketFunction method testVarcharBigint.
@Test
public void testVarcharBigint() {
BucketFunction function = bucketFunction(50, createUnboundedVarcharType(), BIGINT);
assertEquals(getBucket(function, createStringsBlock("lorem ipsum"), createLongsBlock(123456789012L)), 24);
assertEquals(getBucket(function, createStringsBlock("lorem"), createLongsBlock(454345325)), 32);
assertEquals(getBucket(function, createStringsBlock("ipsum"), createLongsBlock(365363)), 21);
assertEquals(getBucket(function, createStringsBlock("hello"), createLongsBlock(45645747)), 34);
assertEquals(getBucket(function, createStringsBlock("world"), createLongsBlock(3244)), 4);
}
Aggregations