forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature](nereids) Multi table materialized view init
- Loading branch information
Showing
22 changed files
with
1,246 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
.../org/apache/doris/nereids/rules/exploration/mv/AbstractMaterializedViewAggregateRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package org.apache.doris.nereids.rules.exploration.mv; | ||
|
||
/** | ||
* AbstractMaterializedViewAggregateRule | ||
* This is responsible for common aggregate rewriting | ||
* */ | ||
public abstract class AbstractMaterializedViewAggregateRule extends AbstractMaterializedViewRule { | ||
} |
62 changes: 62 additions & 0 deletions
62
.../java/org/apache/doris/nereids/rules/exploration/mv/AbstractMaterializedViewJoinRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package org.apache.doris.nereids.rules.exploration.mv; | ||
|
||
import org.apache.doris.nereids.trees.expressions.NamedExpression; | ||
import org.apache.doris.nereids.trees.plans.Plan; | ||
import org.apache.doris.nereids.trees.plans.logical.LogicalProject; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* AbstractMaterializedViewJoinRule | ||
* This is responsible for common join rewriting | ||
*/ | ||
public abstract class AbstractMaterializedViewJoinRule extends AbstractMaterializedViewRule { | ||
|
||
@Override | ||
protected Plan rewriteQueryByView(MatchMode matchMode, | ||
StructInfo queryStructInfo, | ||
StructInfo viewStructInfo, | ||
RelationMapping queryToViewTableMappings, | ||
Plan tempRewritedPlan) { | ||
|
||
// Rewrite top projects, represent the query projects by view | ||
List<NamedExpression> expressions = rewriteExpression( | ||
queryStructInfo.getExpressions(), | ||
queryStructInfo, | ||
viewStructInfo, | ||
queryToViewTableMappings, | ||
tempRewritedPlan | ||
); | ||
// Can not rewrite, bail out | ||
if (expressions == null) { | ||
return null; | ||
} | ||
return new LogicalProject<>(expressions, tempRewritedPlan); | ||
} | ||
|
||
// Check join is whether valid or not. Support join's input can not contain aggregate | ||
// Only support project, filter, join, logical relation node and | ||
// join condition should be slot reference equals currently | ||
@Override | ||
protected boolean isPatternSupport(StructInfo structInfo) { | ||
// TODO Should get struct info from hyper graph and check | ||
return false; | ||
} | ||
} |
Oops, something went wrong.