Search in sources :

Example 11 with BucketFunction

use of io.trino.spi.connector.BucketFunction in project trino by trinodb.

the class TestRaptorBucketFunction method testInteger.

@Test
public void testInteger() {
    BucketFunction function = bucketFunction(50, INTEGER);
    assertEquals(getBucket(function, createIntsBlock(454345325)), 16);
    assertEquals(getBucket(function, createIntsBlock(365363)), 42);
    assertEquals(getBucket(function, createIntsBlock(45645747)), 41);
    assertEquals(getBucket(function, createIntsBlock(3244)), 29);
}
Also used : BucketFunction(io.trino.spi.connector.BucketFunction) Test(org.testng.annotations.Test)

Aggregations

BucketFunction (io.trino.spi.connector.BucketFunction)11 Test (org.testng.annotations.Test)8 Page (io.trino.spi.Page)4 ImmutableList (com.google.common.collect.ImmutableList)2 BlockAssertions.createLongRepeatBlock (io.trino.block.BlockAssertions.createLongRepeatBlock)2 BlockAssertions.createLongsBlock (io.trino.block.BlockAssertions.createLongsBlock)2 CatalogName (io.trino.connector.CatalogName)2 BucketPartitionFunction (io.trino.operator.BucketPartitionFunction)2 Block (io.trino.spi.block.Block)2 BlockBuilder (io.trino.spi.block.BlockBuilder)2 ConnectorNodePartitioningProvider (io.trino.spi.connector.ConnectorNodePartitioningProvider)2 BIGINT (io.trino.spi.type.BigintType.BIGINT)2 Type (io.trino.spi.type.Type)2 TypeOperators (io.trino.spi.type.TypeOperators)2 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 Assert.assertEquals (org.testng.Assert.assertEquals)2