-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](Nereids) handle continuous filter or project in plan #40176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
starocean999
merged 1 commit into
apache:master
from
morrySnow:prevent_continuous_filter_or_project
Sep 10, 2024
Merged
[fix](Nereids) handle continuous filter or project in plan #40176
starocean999
merged 1 commit into
apache:master
from
morrySnow:prevent_continuous_filter_or_project
Sep 10, 2024
Conversation
This file contains hidden or 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
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 38091 ms |
e5fe1d4 to
2eef885
Compare
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 38347 ms |
TPC-DS: Total hot run time: 188187 ms |
ClickBench: Total hot run time: 31.78 s |
2eef885 to
669d07c
Compare
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 38472 ms |
TPC-DS: Total hot run time: 188701 ms |
ClickBench: Total hot run time: 32.87 s |
669d07c to
5eb13c8
Compare
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 38192 ms |
TPC-DS: Total hot run time: 188294 ms |
ClickBench: Total hot run time: 32.52 s |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 38842 ms |
TPC-DS: Total hot run time: 192111 ms |
ClickBench: Total hot run time: 32.5 s |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 38171 ms |
TPC-DS: Total hot run time: 193835 ms |
ClickBench: Total hot run time: 32.6 s |
Contributor
Author
|
run cloud_p0 |
if we meet continuous project or filter in translator, we try to
generate SelectNode as far as possible to avoid generate invalid plan
for example
```
Filter(conjuncts 1)
+-- Limit (limit 10)
+-- Filter(conjuncts 2)
+-- Aggregate
```
will be translated to
```
SELECT_NODE (conjuncts 1)
+-- AGGREGATE_NODE (conjuncts 2) (limit 10)
```
5eb13c8 to
20271f6
Compare
Contributor
Author
|
run buildall |
dataroaring
pushed a commit
that referenced
this pull request
Oct 9, 2024
if we meet continuous project or filter in translator, we try to
generate SelectNode as far as possible to avoid generate invalid plan
for example
```
Filter(conjuncts 1)
+-- Limit (limit 10)
+-- Filter(conjuncts 2)
+-- Aggregate
```
will be translated to
```
SELECT_NODE (conjuncts 1)
+-- AGGREGATE_NODE (conjuncts 2) (limit 10)
```
morrySnow
pushed a commit
that referenced
this pull request
Oct 17, 2024
…#41218) In the previous FileScanNode, some parts that used conjuncts for predicate conversion were placed in the init phase. However, for the Nereids planner, pushing the filter down to the scan happens in the Translator, which means that the ScanNode can only get the complete conjuncts in the finalized phase. Therefore, in this PR, I have removed all conjuncts variables in External for the Nereids planner. They no longer need to store conjuncts themselves or add them to the ScanNode. Instead, all places in the ScanNode that use conjuncts should be moved to the finalized phase. This refactor also fix a performance issue introduced from #40176 After introducing the change of generating SelectNode for consecutive projects or filters, FileScan still adds conjuncts too early in the init phase, resulting in the discovery of consecutive filters when the upper layer continues to translate, a selectnode was unexpectedly generated on the scannode, causing the project to be unable to prune the scannode columns. However, the Project node trims columns of SelectNode and ScanNode differently, which causes ScanNode to scan unnecessary columns. My modification removes the addition of conjuncts in the scannode step, so that we can keep the structure from ScanNode to Project and achieve correct column trimming.
zy-kkk
added a commit
to zy-kkk/doris
that referenced
this pull request
Oct 22, 2024
…apache#41218) In the previous FileScanNode, some parts that used conjuncts for predicate conversion were placed in the init phase. However, for the Nereids planner, pushing the filter down to the scan happens in the Translator, which means that the ScanNode can only get the complete conjuncts in the finalized phase. Therefore, in this PR, I have removed all conjuncts variables in External for the Nereids planner. They no longer need to store conjuncts themselves or add them to the ScanNode. Instead, all places in the ScanNode that use conjuncts should be moved to the finalized phase. This refactor also fix a performance issue introduced from apache#40176 After introducing the change of generating SelectNode for consecutive projects or filters, FileScan still adds conjuncts too early in the init phase, resulting in the discovery of consecutive filters when the upper layer continues to translate, a selectnode was unexpectedly generated on the scannode, causing the project to be unable to prune the scannode columns. However, the Project node trims columns of SelectNode and ScanNode differently, which causes ScanNode to scan unnecessary columns. My modification removes the addition of conjuncts in the scannode step, so that we can keep the structure from ScanNode to Project and achieve correct column trimming.
morningman
pushed a commit
that referenced
this pull request
Oct 22, 2024
… Scan (#42261) pick (#41218) In the previous FileScanNode, some parts that used conjuncts for predicate conversion were placed in the init phase. However, for the Nereids planner, pushing the filter down to the scan happens in the Translator, which means that the ScanNode can only get the complete conjuncts in the finalized phase. Therefore, in this PR, I have removed all conjuncts variables in External for the Nereids planner. They no longer need to store conjuncts themselves or add them to the ScanNode. Instead, all places in the ScanNode that use conjuncts should be moved to the finalized phase. This refactor also fix a performance issue introduced from #40176 After introducing the change of generating SelectNode for consecutive projects or filters, FileScan still adds conjuncts too early in the init phase, resulting in the discovery of consecutive filters when the upper layer continues to translate, a selectnode was unexpectedly generated on the scannode, causing the project to be unable to prune the scannode columns. However, the Project node trims columns of SelectNode and ScanNode differently, which causes ScanNode to scan unnecessary columns. My modification removes the addition of conjuncts in the scannode step, so that we can keep the structure from ScanNode to Project and achieve correct column trimming.
zy-kkk
added a commit
to zy-kkk/doris
that referenced
this pull request
Oct 31, 2024
…apache#41218) In the previous FileScanNode, some parts that used conjuncts for predicate conversion were placed in the init phase. However, for the Nereids planner, pushing the filter down to the scan happens in the Translator, which means that the ScanNode can only get the complete conjuncts in the finalized phase. Therefore, in this PR, I have removed all conjuncts variables in External for the Nereids planner. They no longer need to store conjuncts themselves or add them to the ScanNode. Instead, all places in the ScanNode that use conjuncts should be moved to the finalized phase. This refactor also fix a performance issue introduced from apache#40176 After introducing the change of generating SelectNode for consecutive projects or filters, FileScan still adds conjuncts too early in the init phase, resulting in the discovery of consecutive filters when the upper layer continues to translate, a selectnode was unexpectedly generated on the scannode, causing the project to be unable to prune the scannode columns. However, the Project node trims columns of SelectNode and ScanNode differently, which causes ScanNode to scan unnecessary columns. My modification removes the addition of conjuncts in the scannode step, so that we can keep the structure from ScanNode to Project and achieve correct column trimming.
morningman
pushed a commit
that referenced
this pull request
Oct 31, 2024
… Scan (#43018) bp (#41218) In the previous FileScanNode, some parts that used conjuncts for predicate conversion were placed in the init phase. However, for the Nereids planner, pushing the filter down to the scan happens in the Translator, which means that the ScanNode can only get the complete conjuncts in the finalized phase. Therefore, in this PR, I have removed all conjuncts variables in External for the Nereids planner. They no longer need to store conjuncts themselves or add them to the ScanNode. Instead, all places in the ScanNode that use conjuncts should be moved to the finalized phase. This refactor also fix a performance issue introduced from #40176 After introducing the change of generating SelectNode for consecutive projects or filters, FileScan still adds conjuncts too early in the init phase, resulting in the discovery of consecutive filters when the upper layer continues to translate, a selectnode was unexpectedly generated on the scannode, causing the project to be unable to prune the scannode columns. However, the Project node trims columns of SelectNode and ScanNode differently, which causes ScanNode to scan unnecessary columns. My modification removes the addition of conjuncts in the scannode step, so that we can keep the structure from ScanNode to Project and achieve correct column trimming.
yujun777
pushed a commit
to yujun777/doris
that referenced
this pull request
Aug 15, 2025
) if we meet continuous project or filter in translator, we try to generate SelectNode as far as possible to avoid generate invalid plan for example ``` Filter(conjuncts 1) +-- Limit (limit 10) +-- Filter(conjuncts 2) +-- Aggregate ``` will be translated to ``` SELECT_NODE (conjuncts 1) +-- AGGREGATE_NODE (conjuncts 2) (limit 10) ```
This was referenced Aug 15, 2025
github-actions bot
pushed a commit
that referenced
this pull request
Aug 15, 2025
if we meet continuous project or filter in translator, we try to
generate SelectNode as far as possible to avoid generate invalid plan
for example
```
Filter(conjuncts 1)
+-- Limit (limit 10)
+-- Filter(conjuncts 2)
+-- Aggregate
```
will be translated to
```
SELECT_NODE (conjuncts 1)
+-- AGGREGATE_NODE (conjuncts 2) (limit 10)
```
3 tasks
924060929
pushed a commit
that referenced
this pull request
Aug 21, 2025
yujun777
added a commit
to yujun777/doris
that referenced
this pull request
Aug 21, 2025
yujun777
added a commit
to yujun777/doris
that referenced
this pull request
Aug 21, 2025
yiguolei
pushed a commit
that referenced
this pull request
Aug 22, 2025
morrySnow
pushed a commit
that referenced
this pull request
Aug 22, 2025
dataroaring
pushed a commit
that referenced
this pull request
Aug 24, 2025
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
approved
Indicates a PR has been approved by one committer.
dev/2.1.12-merged
dev/3.0.3-merged
dev/3.1.0-merged
reviewed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
if we meet continuous project or filter in translator, we try to generate SelectNode as far as possible to avoid generate invalid plan
for example
will be translated to