use of org.apache.druid.query.DataSource in project druid by druid-io.
the class DruidQueryTest method test_filtration_noJoinAndInterval.
@Test
public void test_filtration_noJoinAndInterval() {
DataSource dataSource = new TableDataSource("test");
Pair<DataSource, Filtration> pair = DruidQuery.getFiltration(dataSource, selectorFilter, VirtualColumnRegistry.create(RowSignature.empty(), TestExprMacroTable.INSTANCE));
verify(pair, dataSource, selectorFilter, Intervals.ETERNITY);
}
use of org.apache.druid.query.DataSource 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));
}
use of org.apache.druid.query.DataSource 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));
}
use of org.apache.druid.query.DataSource in project druid by druid-io.
the class DruidSchemaTestCommon method setUpCommon.
@Before
public void setUpCommon() {
segmentDataSourceNames = Sets.newConcurrentHashSet();
joinableDataSourceNames = Sets.newConcurrentHashSet();
segmentManager = new SegmentManager(EasyMock.createMock(SegmentLoader.class)) {
@Override
public Set<String> getDataSourceNames() {
getDatasourcesLatch.countDown();
return segmentDataSourceNames;
}
};
globalTableJoinable = new JoinableFactory() {
@Override
public boolean isDirectlyJoinable(DataSource dataSource) {
return dataSource instanceof GlobalTableDataSource && joinableDataSourceNames.contains(((GlobalTableDataSource) dataSource).getName());
}
@Override
public Optional<Joinable> build(DataSource dataSource, JoinConditionAnalysis condition) {
return Optional.empty();
}
};
}
use of org.apache.druid.query.DataSource 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));
}
Aggregations