Search in sources :

Example 11 with ColumnCapabilities

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

the class ColumnSelectorBitmapIndexSelector method hasMultipleValues.

@Override
public ColumnCapabilities.Capable hasMultipleValues(final String dimension) {
    if (isVirtualColumn(dimension)) {
        VirtualColumn virtualColumn = virtualColumns.getVirtualColumn(dimension);
        ColumnCapabilities virtualCapabilities = null;
        if (virtualColumn != null) {
            virtualCapabilities = virtualColumn.capabilities(QueryableIndexStorageAdapter.getColumnInspectorForIndex(index), dimension);
        }
        return virtualCapabilities != null ? virtualCapabilities.hasMultipleValues() : ColumnCapabilities.Capable.FALSE;
    }
    final ColumnHolder columnHolder = index.getColumnHolder(dimension);
    // the empty bitmap will be used
    return columnHolder != null ? columnHolder.getCapabilities().hasMultipleValues() : ColumnCapabilities.Capable.FALSE;
}
Also used : ColumnHolder(org.apache.druid.segment.column.ColumnHolder) ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities)

Example 12 with ColumnCapabilities

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

the class IndexedTableJoinableTest method getColumnCapabilitiesForLongColumn.

@Test
public void getColumnCapabilitiesForLongColumn() {
    final ColumnCapabilities capabilities = target.getColumnCapabilities("long");
    Assert.assertEquals(ValueType.LONG, capabilities.getType());
    Assert.assertFalse(capabilities.isDictionaryEncoded().isTrue());
    Assert.assertFalse(capabilities.hasBitmapIndexes());
    Assert.assertFalse(capabilities.hasMultipleValues().isMaybeTrue());
    Assert.assertFalse(capabilities.hasSpatialIndexes());
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) Test(org.junit.Test)

Example 13 with ColumnCapabilities

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

the class IndexedTableJoinableTest method getColumnCapabilitiesForStringColumn.

@Test
public void getColumnCapabilitiesForStringColumn() {
    final ColumnCapabilities capabilities = target.getColumnCapabilities("str");
    Assert.assertEquals(ValueType.STRING, capabilities.getType());
    Assert.assertTrue(capabilities.isDictionaryEncoded().isTrue());
    Assert.assertFalse(capabilities.hasBitmapIndexes());
    Assert.assertFalse(capabilities.hasMultipleValues().isMaybeTrue());
    Assert.assertFalse(capabilities.hasSpatialIndexes());
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) Test(org.junit.Test)

Example 14 with ColumnCapabilities

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

the class IndexedTableJoinableTest method getColumnCapabilitiesForNonexistentColumnShouldReturnNull.

@Test
public void getColumnCapabilitiesForNonexistentColumnShouldReturnNull() {
    final ColumnCapabilities capabilities = target.getColumnCapabilities("nonexistent");
    Assert.assertNull(capabilities);
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) Test(org.junit.Test)

Example 15 with ColumnCapabilities

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

the class HashJoinSegmentStorageAdapterTest method test_getColumnCapabilities_factToCountryNonexistentJoinColumn.

@Test
public void test_getColumnCapabilities_factToCountryNonexistentJoinColumn() {
    final ColumnCapabilities capabilities = makeFactToCountrySegment().getColumnCapabilities(FACT_TO_COUNTRY_ON_ISO_CODE_PREFIX + "nonexistent");
    Assert.assertNull(capabilities);
}
Also used : ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) 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