mirror of
https://github.com/apache/druid.git
synced 2025-02-27 22:09:12 +00:00
fix AssertionError of semi join query (#6244)
This commit is contained in:
parent
d957295b98
commit
a879022bc8
@ -44,6 +44,7 @@ import org.apache.calcite.rel.metadata.RelMetadataQuery;
|
||||
import org.apache.calcite.rel.type.RelDataType;
|
||||
import org.apache.calcite.rex.RexInputRef;
|
||||
import org.apache.calcite.rex.RexNode;
|
||||
import org.apache.calcite.rex.RexUtil;
|
||||
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -345,12 +346,15 @@ public class DruidSemiJoin extends DruidRel<DruidSemiJoin>
|
||||
newWhereFilter = whereFilter.copy(
|
||||
whereFilter.getTraitSet(),
|
||||
whereFilter.getInput(),
|
||||
makeAnd(ImmutableList.of(whereFilter.getCondition(), makeOr(conditions)))
|
||||
RexUtil.flatten(
|
||||
getCluster().getRexBuilder(),
|
||||
makeAnd(ImmutableList.of(whereFilter.getCondition(), makeOr(conditions)))
|
||||
)
|
||||
);
|
||||
} else {
|
||||
newWhereFilter = LogicalFilter.create(
|
||||
leftPartialQuery.getScan(),
|
||||
makeOr(conditions)
|
||||
makeOr(conditions) // already in flattened form
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -4658,7 +4658,7 @@ public class CalciteQueryTest extends CalciteTestBase
|
||||
+ " FROM druid.foo\n"
|
||||
+ " WHERE SUBSTRING(dim2, 1, 1) IN (\n"
|
||||
+ " SELECT SUBSTRING(dim1, 1, 1) FROM druid.foo WHERE dim1 <> ''\n"
|
||||
+ " )\n"
|
||||
+ " ) AND __time >= '2000-01-01' AND __time < '2002-01-01'\n"
|
||||
+ ")",
|
||||
ImmutableList.of(
|
||||
GroupByQuery.builder()
|
||||
@ -4678,7 +4678,7 @@ public class CalciteQueryTest extends CalciteTestBase
|
||||
new QueryDataSource(
|
||||
GroupByQuery.builder()
|
||||
.setDataSource(CalciteTests.DATASOURCE1)
|
||||
.setInterval(QSS(Filtration.eternity()))
|
||||
.setInterval(QSS(Intervals.of("2000-01-01/2002-01-01")))
|
||||
.setGranularity(Granularities.ALL)
|
||||
.setDimFilter(IN(
|
||||
"dim2",
|
||||
|
Loading…
x
Reference in New Issue
Block a user