-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat](Nereids) add join hints (#27819)
* [Feat](Nereids) Add leading and ordered hint (#22057) Add leading hint and ordered hint. Usage: select /*+ ordered / * from a join b on xxx; which will limit join order to original order select /+ leading ({b a}) */ from a join b on xxx; which will change join order to b join a. * [Fix](Nereids) fix test leading change disable join reorder parameter (#23657) Problem: when running pipeline, we get randomly failed of test_leading Reason: physical distribute was generated and choosed to be the best plan because we can not get any statistic information of empty table. So we would get some unexpect result because we can not expect the order in memo Solved: Add statistic of columns used in test_leading, try repeatly in pipeline * [Fix](Nereids) fix test leading suite and add tpch shape checking base on leading (#25842) - fix test leading suite caused by sessionvariable setting error - add tpch shape checking base on leading * [Feat](Nereids) join hint support stage one (#27378) support view as a independent unit of leading hint add random test check of leading hint query add more test with data of leading hint query add random test check of distribute hint * [Fix](Nereids) fix leading rebase problems
- Loading branch information
1 parent
4b25611
commit 8eefd58
Showing
76 changed files
with
11,006 additions
and
168 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
85 changes: 85 additions & 0 deletions
85
fe/fe-core/src/main/java/org/apache/doris/nereids/hint/Hint.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,85 @@ | ||
// 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.hint; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* select hint. | ||
* e.g. set_var(query_timeout='1800', exec_mem_limit='2147483648') | ||
*/ | ||
public class Hint { | ||
// e.g. set_var | ||
private String hintName; | ||
|
||
private HintStatus status; | ||
|
||
private String errorMessage = ""; | ||
|
||
/** | ||
* hint status which need to show in explain when it is not used or have syntax error | ||
*/ | ||
public enum HintStatus { | ||
UNUSED, | ||
SYNTAX_ERROR, | ||
SUCCESS | ||
} | ||
|
||
public Hint(String hintName) { | ||
this.hintName = Objects.requireNonNull(hintName, "hintName can not be null"); | ||
this.status = HintStatus.UNUSED; | ||
} | ||
|
||
public void setHintName(String hintName) { | ||
this.hintName = hintName; | ||
} | ||
|
||
public void setStatus(HintStatus status) { | ||
this.status = status; | ||
} | ||
|
||
public HintStatus getStatus() { | ||
return status; | ||
} | ||
|
||
public boolean isSuccess() { | ||
return getStatus() == HintStatus.SUCCESS; | ||
} | ||
|
||
public boolean isSyntaxError() { | ||
return getStatus() == HintStatus.SYNTAX_ERROR; | ||
} | ||
|
||
public String getHintName() { | ||
return hintName; | ||
} | ||
|
||
public String getErrorMessage() { | ||
return errorMessage; | ||
} | ||
|
||
public void setErrorMessage(String errorMessage) { | ||
this.errorMessage = errorMessage; | ||
} | ||
|
||
public String getExplainString() { | ||
StringBuilder out = new StringBuilder(); | ||
out.append("\nHint:\n"); | ||
return out.toString(); | ||
} | ||
} |
Oops, something went wrong.