mirror of
https://github.com/apache/druid.git
synced 2025-02-17 07:25:02 +00:00
Add test for join on __time column (#11289)
This commit is contained in:
parent
b517c3339b
commit
6c7177714f
@ -17491,4 +17491,36 @@ public class CalciteQueryTest extends BaseCalciteQueryTest
|
|||||||
ImmutableList.of()
|
ImmutableList.of()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testJoinWithTimeDimension() throws Exception
|
||||||
|
{
|
||||||
|
testQuery(
|
||||||
|
PLANNER_CONFIG_DEFAULT,
|
||||||
|
QUERY_CONTEXT_DEFAULT,
|
||||||
|
"SELECT count(*) FROM druid.foo t1 inner join druid.foo t2 on t1.__time = t2.__time",
|
||||||
|
CalciteTests.REGULAR_USER_AUTH_RESULT,
|
||||||
|
ImmutableList.of(Druids.newTimeseriesQueryBuilder()
|
||||||
|
.dataSource(JoinDataSource.create(new TableDataSource(CalciteTests.DATASOURCE1),
|
||||||
|
new QueryDataSource(
|
||||||
|
Druids.newScanQueryBuilder()
|
||||||
|
.dataSource(CalciteTests.DATASOURCE1)
|
||||||
|
.intervals(querySegmentSpec(Filtration.eternity()))
|
||||||
|
.resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST)
|
||||||
|
.columns("__time")
|
||||||
|
.legacy(false)
|
||||||
|
.context(QUERY_CONTEXT_DEFAULT)
|
||||||
|
.build()),
|
||||||
|
"j0.",
|
||||||
|
"(\"__time\" == \"j0.__time\")",
|
||||||
|
JoinType.INNER,
|
||||||
|
null,
|
||||||
|
ExprMacroTable.nil()))
|
||||||
|
.intervals(querySegmentSpec(Filtration.eternity()))
|
||||||
|
.granularity(Granularities.ALL)
|
||||||
|
.aggregators(aggregators(new CountAggregatorFactory("a0")))
|
||||||
|
.context(QUERY_CONTEXT_DEFAULT)
|
||||||
|
.build()),
|
||||||
|
ImmutableList.of(new Object[]{6L}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user