Search in sources :

Example 31 with ColumnCapabilities

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

the class RowBasedColumnSelectorFactoryTest method testCapabilitiesLong.

@Test
public void testCapabilitiesLong() {
    ColumnCapabilities caps = RowBasedColumnSelectorFactory.getColumnCapabilities(ROW_SIGNATURE, LONG_COLUMN_NAME);
    Assert.assertEquals(ValueType.LONG, caps.getType());
    Assert.assertFalse(caps.hasBitmapIndexes());
    Assert.assertFalse(caps.isDictionaryEncoded().isTrue());
    Assert.assertFalse(caps.areDictionaryValuesSorted().isTrue());
    Assert.assertFalse(caps.areDictionaryValuesUnique().isTrue());
    Assert.assertFalse(caps.hasMultipleValues().isMaybeTrue());
    Assert.assertFalse(caps.hasSpatialIndexes());
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) InitializedNullHandlingTest(org.apache.druid.testing.InitializedNullHandlingTest) Test(org.junit.Test)

Example 32 with ColumnCapabilities

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

the class RowBasedColumnSelectorFactoryTest method testCapabilitiesComplex.

@Test
public void testCapabilitiesComplex() {
    ColumnCapabilities caps = RowBasedColumnSelectorFactory.getColumnCapabilities(ROW_SIGNATURE, COMPLEX_COLUMN_NAME);
    Assert.assertEquals(SOME_COMPLEX, caps.toColumnType());
    Assert.assertFalse(caps.hasBitmapIndexes());
    Assert.assertFalse(caps.isDictionaryEncoded().isTrue());
    Assert.assertFalse(caps.areDictionaryValuesSorted().isTrue());
    Assert.assertFalse(caps.areDictionaryValuesUnique().isTrue());
    Assert.assertTrue(caps.hasMultipleValues().isUnknown());
    Assert.assertFalse(caps.hasSpatialIndexes());
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) InitializedNullHandlingTest(org.apache.druid.testing.InitializedNullHandlingTest) Test(org.junit.Test)

Example 33 with ColumnCapabilities

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

the class RowBasedColumnSelectorFactoryTest method testCapabilitiesDouble.

@Test
public void testCapabilitiesDouble() {
    ColumnCapabilities caps = RowBasedColumnSelectorFactory.getColumnCapabilities(ROW_SIGNATURE, DOUBLE_COLUMN_NAME);
    Assert.assertEquals(ValueType.DOUBLE, caps.getType());
    Assert.assertFalse(caps.hasBitmapIndexes());
    Assert.assertFalse(caps.isDictionaryEncoded().isTrue());
    Assert.assertFalse(caps.areDictionaryValuesSorted().isTrue());
    Assert.assertFalse(caps.areDictionaryValuesUnique().isTrue());
    Assert.assertFalse(caps.hasMultipleValues().isMaybeTrue());
    Assert.assertFalse(caps.hasSpatialIndexes());
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) InitializedNullHandlingTest(org.apache.druid.testing.InitializedNullHandlingTest) Test(org.junit.Test)

Example 34 with ColumnCapabilities

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

the class RowBasedColumnSelectorFactoryTest method testCapabilitiesStringArray.

@Test
public void testCapabilitiesStringArray() {
    ColumnCapabilities caps = RowBasedColumnSelectorFactory.getColumnCapabilities(ROW_SIGNATURE, STRING_ARRAY_COLUMN_NAME);
    Assert.assertEquals(ColumnType.STRING_ARRAY, caps.toColumnType());
    Assert.assertFalse(caps.hasBitmapIndexes());
    Assert.assertFalse(caps.isDictionaryEncoded().isTrue());
    Assert.assertFalse(caps.areDictionaryValuesSorted().isTrue());
    Assert.assertFalse(caps.areDictionaryValuesUnique().isTrue());
    Assert.assertTrue(caps.hasMultipleValues().isFalse());
    Assert.assertFalse(caps.hasSpatialIndexes());
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) InitializedNullHandlingTest(org.apache.druid.testing.InitializedNullHandlingTest) Test(org.junit.Test)

Example 35 with ColumnCapabilities

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

the class RowBasedColumnSelectorFactoryTest method testCapabilitiesTime.

@Test
public void testCapabilitiesTime() {
    // time column takes a special path
    ColumnCapabilities caps = RowBasedColumnSelectorFactory.getColumnCapabilities(ROW_SIGNATURE, ColumnHolder.TIME_COLUMN_NAME);
    Assert.assertEquals(ValueType.LONG, caps.getType());
    Assert.assertFalse(caps.hasBitmapIndexes());
    Assert.assertFalse(caps.isDictionaryEncoded().isTrue());
    Assert.assertFalse(caps.areDictionaryValuesSorted().isTrue());
    Assert.assertFalse(caps.areDictionaryValuesUnique().isTrue());
    Assert.assertFalse(caps.hasMultipleValues().isMaybeTrue());
    Assert.assertFalse(caps.hasSpatialIndexes());
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) InitializedNullHandlingTest(org.apache.druid.testing.InitializedNullHandlingTest) Test(org.junit.Test)

Aggregations

ColumnCapabilities (org.apache.druid.segment.column.ColumnCapabilities)78 Test (org.junit.Test)52 InitializedNullHandlingTest (org.apache.druid.testing.InitializedNullHandlingTest)29 ColumnCapabilitiesImpl (org.apache.druid.segment.column.ColumnCapabilitiesImpl)9 ArrayList (java.util.ArrayList)4 Nullable (javax.annotation.Nullable)4 AggregatorFactory (org.apache.druid.query.aggregation.AggregatorFactory)4 DimensionSpec (org.apache.druid.query.dimension.DimensionSpec)4 ColumnValueSelector (org.apache.druid.segment.ColumnValueSelector)4 QueryableIndex (org.apache.druid.segment.QueryableIndex)4 ColumnHolder (org.apache.druid.segment.column.ColumnHolder)4 ColumnType (org.apache.druid.segment.column.ColumnType)4 RowSignature (org.apache.druid.segment.column.RowSignature)4 ValueType (org.apache.druid.segment.column.ValueType)4 List (java.util.List)3 NullHandlingTest (org.apache.druid.common.config.NullHandlingTest)3 ISE (org.apache.druid.java.util.common.ISE)3 DefaultDimensionSpec (org.apache.druid.query.dimension.DefaultDimensionSpec)3 VectorValueSelector (org.apache.druid.segment.vector.VectorValueSelector)3 Before (org.junit.Before)3