Search in sources :

Example 6 with BucketFunction

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);
}
Also used : BucketFunction(com.facebook.presto.spi.BucketFunction) Test(org.testng.annotations.Test)

Aggregations

BucketFunction (com.facebook.presto.spi.BucketFunction)6 Test (org.testng.annotations.Test)4 PartitionFunction (com.facebook.presto.operator.PartitionFunction)2 ConnectorNodePartitioningProvider (com.facebook.presto.spi.connector.ConnectorNodePartitioningProvider)1