Skip to content

[Feature](runtime-filter) support rf on set operator: be part#49679

Merged
BiteTheDDDDt merged 4 commits intoapache:masterfrom
BiteTheDDDDt:dev_0331
Apr 3, 2025
Merged

[Feature](runtime-filter) support rf on set operator: be part#49679
BiteTheDDDDt merged 4 commits intoapache:masterfrom
BiteTheDDDDt:dev_0331

Conversation

@BiteTheDDDDt
Copy link
Copy Markdown
Contributor

@BiteTheDDDDt BiteTheDDDDt commented Mar 31, 2025

What problem does this PR solve?

support rf on set operator: be part

create table tx (
	k1 int null,
	k2 int not null,
	k3 bigint null,
  k4 varchar(100) null
)
duplicate key (k1)
properties("replication_num" = "1");

insert into tx select e1,e1,e1,e1 from (select 1 k1) as t lateral view explode_numbers(x) tmp1 as e1;


select k1 from t1000 intersect select k1 from t10000000;
10.03 sec -> 0.13 sec

select k1 from t1000 intersect select k1 from t1000000;
1.17 sec  -> 0.13 sec

select k1 from t10000 intersect select k1 from t100000;
0.23 sec -> 0.18 sec

select k1 from t10000 intersect select * from( select k1 from t100000 where k1 > 10000)t;
0.15 sec -> 0.16 sec

select k1 from t10000 intersect select * from( select k1 from t100000 where k1 < 10000)t;
0.13sec -> 0.18sec

part of #49573

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Mar 31, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@BiteTheDDDDt
Copy link
Copy Markdown
Contributor Author

run buildall

@BiteTheDDDDt
Copy link
Copy Markdown
Contributor Author

run beut

: RuntimeFilterWrapper::State::READY;
if (!wake_up_early) {
// Hash table is completed and runtime filter has a global size now.
uint64_t hash_table_size = block ? block->rows() : 0;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why use set hash table size. more correct

return Status::OK();
}

if (!_runtime_filter_producer_helper || state->is_cancelled() || !_eos) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (_runtime_filter_producer_helper && state->ok() && _eos) {
try {
RETURN_IF_ERROR(
_runtime_filter_producer_helper->process(state, &_shared_state->build_block));
} catch (Exception& e) {
return Status::InternalError(
"rf process meet error: {}, wake_up_early: {}, _finish_dependency: {}",
e.to_string(), state->get_task()->wake_up_early(),
_finish_dependency->debug_string());
}
}
return Base::close(state, exec_status);

@BiteTheDDDDt
Copy link
Copy Markdown
Contributor Author

run buildall

@BiteTheDDDDt
Copy link
Copy Markdown
Contributor Author

run buildall

@BiteTheDDDDt
Copy link
Copy Markdown
Contributor Author

run buildall

Copy link
Copy Markdown
Contributor

@Gabriel39 Gabriel39 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly suggest to use a common interface to unify RuntimeFilterProducerHelper/RuntimeFilterProducerHelperCross/RuntimeFilterProducerHelperSet

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2025

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added approved Indicates a PR has been approved by one committer. reviewed labels Apr 3, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2025

PR approved by anyone and no changes requested.

Copy link
Copy Markdown
Contributor

@HappenLee HappenLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BiteTheDDDDt BiteTheDDDDt merged commit 226dbd0 into apache:master Apr 3, 2025
23 of 26 checks passed
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
…#49679)

### What problem does this PR solve?
support rf on set operator: be part

```sql
create table tx (
	k1 int null,
	k2 int not null,
	k3 bigint null,
  k4 varchar(100) null
)
duplicate key (k1)
properties("replication_num" = "1");

insert into tx select e1,e1,e1,e1 from (select 1 k1) as t lateral view explode_numbers(x) tmp1 as e1;


select k1 from t1000 intersect select k1 from t10000000;
10.03 sec -> 0.13 sec

select k1 from t1000 intersect select k1 from t1000000;
1.17 sec  -> 0.13 sec

select k1 from t10000 intersect select k1 from t100000;
0.23 sec -> 0.18 sec

select k1 from t10000 intersect select * from( select k1 from t100000 where k1 > 10000)t;
0.15 sec -> 0.16 sec

select k1 from t10000 intersect select * from( select k1 from t100000 where k1 < 10000)t;
0.13sec -> 0.18sec
```

part of apache#49573
### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [x] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [x] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [x] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
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. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants