Skip to content

Commit

Permalink
[feature](nereids) Support inner join query rewrite by materialized view
Browse files Browse the repository at this point in the history
# Conflicts:
#	fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
  • Loading branch information
seawinde committed Dec 5, 2023
1 parent b794640 commit d2497b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ public ExpressionMapping(Multimap<? extends Expression, ? extends Expression> ex
*/
public List<Map<? extends Expression, ? extends Expression>> flattenMap() {
List<List<Pair<Expression, Expression>>> tmpExpressionPairs = new ArrayList<>(this.expressionMapping.size());
Map<? extends Expression, ? extends Collection<? extends Expression>> map = expressionMapping.asMap();
for (Map.Entry<? extends Expression, ? extends Collection<? extends Expression>> entry : map.entrySet()) {
List<Pair<Expression, Expression>> valueList = new ArrayList<>(entry.getValue().size());
Map<? extends Expression, ? extends Collection<? extends Expression>> expressionMappingMap =
expressionMapping.asMap();
for (Map.Entry<? extends Expression, ? extends Collection<? extends Expression>> entry
: expressionMappingMap.entrySet()) {
List<Pair<Expression, Expression>> targetExpressionList = new ArrayList<>(entry.getValue().size());
for (Expression valueExpression : entry.getValue()) {
valueList.add(Pair.of(entry.getKey(), valueExpression));
targetExpressionList.add(Pair.of(entry.getKey(), valueExpression));
}
tmpExpressionPairs.add(valueList);
tmpExpressionPairs.add(targetExpressionList);
}
List<List<Pair<Expression, Expression>>> cartesianExpressionMap = Lists.cartesianProduct(tmpExpressionPairs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@
import org.apache.doris.nereids.glue.LogicalPlanAdapter;
import org.apache.doris.nereids.minidump.MinidumpUtils;
import org.apache.doris.nereids.parser.NereidsParser;
import org.apache.doris.nereids.rules.exploration.mv.InitMaterializationContextHook;
import org.apache.doris.nereids.stats.StatsErrorEstimator;
import org.apache.doris.nereids.trees.plans.commands.BatchInsertIntoTableCommand;
import org.apache.doris.nereids.rules.exploration.mv.InitMaterializationContextHook;
import org.apache.doris.nereids.trees.plans.commands.Command;
import org.apache.doris.nereids.trees.plans.commands.CreateTableCommand;
import org.apache.doris.nereids.trees.plans.commands.Forward;
Expand Down

0 comments on commit d2497b3

Please sign in to comment.