Search in sources :

Example 31 with ColumnCapabilitiesImpl

use of org.apache.druid.segment.column.ColumnCapabilitiesImpl in project druid by druid-io.

the class GroupByQueryEngineV2Test method testCanPushDownLimitForSegmentStringSelector.

@Test
public void testCanPushDownLimitForSegmentStringSelector() {
    ColumnCapabilities capabilities = new ColumnCapabilitiesImpl().setType(ColumnType.STRING).setHasBitmapIndexes(true).setHasMultipleValues(false).setDictionaryEncoded(true).setDictionaryValuesSorted(true).setDictionaryValuesUnique(true);
    EasyMock.expect(factory.getColumnCapabilities(DIM)).andReturn(capabilities).once();
    EasyMock.replay(factory);
    Assert.assertTrue(GroupByQueryEngineV2.canPushDownLimit(factory, DIM));
    EasyMock.verify(factory);
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) ColumnCapabilitiesImpl(org.apache.druid.segment.column.ColumnCapabilitiesImpl) Test(org.junit.Test)

Example 32 with ColumnCapabilitiesImpl

use of org.apache.druid.segment.column.ColumnCapabilitiesImpl in project druid by druid-io.

the class GroupByQueryEngineV2Test method testCanPushDownLimitForJoinStringSelector.

@Test
public void testCanPushDownLimitForJoinStringSelector() {
    ColumnCapabilities capabilities = new ColumnCapabilitiesImpl().setType(ColumnType.STRING).setHasBitmapIndexes(false).setHasMultipleValues(false).setDictionaryEncoded(true).setDictionaryValuesSorted(false).setDictionaryValuesUnique(false);
    EasyMock.expect(factory.getColumnCapabilities(DIM)).andReturn(capabilities).once();
    EasyMock.replay(factory);
    Assert.assertFalse(GroupByQueryEngineV2.canPushDownLimit(factory, DIM));
    EasyMock.verify(factory);
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) ColumnCapabilitiesImpl(org.apache.druid.segment.column.ColumnCapabilitiesImpl) Test(org.junit.Test)

Example 33 with ColumnCapabilitiesImpl

use of org.apache.druid.segment.column.ColumnCapabilitiesImpl in project druid by druid-io.

the class GroupByQueryEngineV2Test method testCanPushDownLimitForIncrementalStringSelector.

@Test
public void testCanPushDownLimitForIncrementalStringSelector() {
    ColumnCapabilities capabilities = new ColumnCapabilitiesImpl().setType(ColumnType.STRING).setHasBitmapIndexes(false).setHasMultipleValues(false).setDictionaryEncoded(false).setDictionaryValuesSorted(false).setDictionaryValuesUnique(true);
    EasyMock.expect(factory.getColumnCapabilities(DIM)).andReturn(capabilities).once();
    EasyMock.replay(factory);
    Assert.assertFalse(GroupByQueryEngineV2.canPushDownLimit(factory, DIM));
    EasyMock.verify(factory);
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) ColumnCapabilitiesImpl(org.apache.druid.segment.column.ColumnCapabilitiesImpl) Test(org.junit.Test)

Example 34 with ColumnCapabilitiesImpl

use of org.apache.druid.segment.column.ColumnCapabilitiesImpl in project druid by druid-io.

the class GroupByQueryEngineV2Test method testCanPushDownLimitForNumericSelector.

@Test
public void testCanPushDownLimitForNumericSelector() {
    ColumnCapabilitiesImpl capabilities = new ColumnCapabilitiesImpl().setType(ColumnType.LONG).setHasBitmapIndexes(false).setHasMultipleValues(false).setDictionaryEncoded(false).setDictionaryValuesSorted(false).setDictionaryValuesUnique(false);
    EasyMock.expect(factory.getColumnCapabilities(DIM)).andReturn(capabilities).anyTimes();
    EasyMock.replay(factory);
    Assert.assertTrue(GroupByQueryEngineV2.canPushDownLimit(factory, DIM));
    capabilities.setType(ColumnType.DOUBLE);
    Assert.assertTrue(GroupByQueryEngineV2.canPushDownLimit(factory, DIM));
    capabilities.setType(ColumnType.FLOAT);
    Assert.assertTrue(GroupByQueryEngineV2.canPushDownLimit(factory, DIM));
    EasyMock.verify(factory);
}
Also used : ColumnCapabilitiesImpl(org.apache.druid.segment.column.ColumnCapabilitiesImpl) Test(org.junit.Test)

Aggregations

ColumnCapabilitiesImpl (org.apache.druid.segment.column.ColumnCapabilitiesImpl)34 Test (org.junit.Test)20 ColumnSelectorFactory (org.apache.druid.segment.ColumnSelectorFactory)11 Before (org.junit.Before)10 InitializedNullHandlingTest (org.apache.druid.testing.InitializedNullHandlingTest)9 ColumnCapabilities (org.apache.druid.segment.column.ColumnCapabilities)8 VectorColumnSelectorFactory (org.apache.druid.segment.vector.VectorColumnSelectorFactory)8 VectorValueSelector (org.apache.druid.segment.vector.VectorValueSelector)7 IdLookup (org.apache.druid.segment.IdLookup)5 SingleValueDimensionVectorSelector (org.apache.druid.segment.vector.SingleValueDimensionVectorSelector)4 Nullable (javax.annotation.Nullable)3 ColumnType (org.apache.druid.segment.column.ColumnType)3 ByteBuffer (java.nio.ByteBuffer)2 BufferAggregator (org.apache.druid.query.aggregation.BufferAggregator)2 TestLongColumnSelector (org.apache.druid.query.aggregation.TestLongColumnSelector)2 DimensionSpec (org.apache.druid.query.dimension.DimensionSpec)2 ValueMatcher (org.apache.druid.query.filter.ValueMatcher)2 RuntimeShapeInspector (org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector)2 IndexedInts (org.apache.druid.segment.data.IndexedInts)2 Predicate (com.google.common.base.Predicate)1