Search in sources :

Example 11 with Filtration

use of org.apache.druid.sql.calcite.filtration.Filtration in project druid by druid-io.

the class DruidQueryTest method test_filtration_joinDataSource_intervalInBaseTableFilter_right.

@Test
public void test_filtration_joinDataSource_intervalInBaseTableFilter_right() {
    DataSource dataSource = join(JoinType.RIGHT, filterWithInterval);
    DataSource expectedDataSource = join(JoinType.RIGHT, selectorFilter);
    Pair<DataSource, Filtration> pair = DruidQuery.getFiltration(dataSource, otherFilter, VirtualColumnRegistry.create(RowSignature.empty(), TestExprMacroTable.INSTANCE));
    verify(pair, expectedDataSource, otherFilter, Intervals.utc(100, 200));
}
Also used : Filtration(org.apache.druid.sql.calcite.filtration.Filtration) DataSource(org.apache.druid.query.DataSource) TableDataSource(org.apache.druid.query.TableDataSource) JoinDataSource(org.apache.druid.query.JoinDataSource) Test(org.junit.Test)

Example 12 with Filtration

use of org.apache.druid.sql.calcite.filtration.Filtration in project druid by druid-io.

the class DruidQueryTest method test_filtration_joinDataSource_intervalInQueryFilter.

@Test
public void test_filtration_joinDataSource_intervalInQueryFilter() {
    DataSource dataSource = join(JoinType.INNER, otherFilter);
    Pair<DataSource, Filtration> pair = DruidQuery.getFiltration(dataSource, filterWithInterval, VirtualColumnRegistry.create(RowSignature.empty(), TestExprMacroTable.INSTANCE));
    verify(pair, dataSource, selectorFilter, Intervals.utc(100, 200));
}
Also used : Filtration(org.apache.druid.sql.calcite.filtration.Filtration) DataSource(org.apache.druid.query.DataSource) TableDataSource(org.apache.druid.query.TableDataSource) JoinDataSource(org.apache.druid.query.JoinDataSource) Test(org.junit.Test)

Example 13 with Filtration

use of org.apache.druid.sql.calcite.filtration.Filtration in project druid by druid-io.

the class DruidQueryTest method test_filtration_joinDataSource_intervalInBaseTableFilter_full.

@Test
public void test_filtration_joinDataSource_intervalInBaseTableFilter_full() {
    DataSource dataSource = join(JoinType.FULL, filterWithInterval);
    DataSource expectedDataSource = join(JoinType.FULL, selectorFilter);
    Pair<DataSource, Filtration> pair = DruidQuery.getFiltration(dataSource, otherFilter, VirtualColumnRegistry.create(RowSignature.empty(), TestExprMacroTable.INSTANCE));
    verify(pair, expectedDataSource, otherFilter, Intervals.utc(100, 200));
}
Also used : Filtration(org.apache.druid.sql.calcite.filtration.Filtration) DataSource(org.apache.druid.query.DataSource) TableDataSource(org.apache.druid.query.TableDataSource) JoinDataSource(org.apache.druid.query.JoinDataSource) Test(org.junit.Test)

Aggregations

JoinDataSource (org.apache.druid.query.JoinDataSource)13 Filtration (org.apache.druid.sql.calcite.filtration.Filtration)13 DataSource (org.apache.druid.query.DataSource)12 TableDataSource (org.apache.druid.query.TableDataSource)8 Test (org.junit.Test)8 IntArrayList (it.unimi.dsi.fastutil.ints.IntArrayList)4 ArrayList (java.util.ArrayList)4 Nullable (javax.annotation.Nullable)4 QueryDataSource (org.apache.druid.query.QueryDataSource)4 PostAggregator (org.apache.druid.query.aggregation.PostAggregator)4 HashMap (java.util.HashMap)3 Granularity (org.apache.druid.java.util.common.granularity.Granularity)3 DimensionExpression (org.apache.druid.sql.calcite.aggregation.DimensionExpression)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 TimeseriesQuery (org.apache.druid.query.timeseries.TimeseriesQuery)2 Preconditions (com.google.common.base.Preconditions)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableSortedMap (com.google.common.collect.ImmutableSortedMap)1 Iterables (com.google.common.collect.Iterables)1 Iterators (com.google.common.collect.Iterators)1