You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "jacktengg (via GitHub)" <gi...@apache.org> on 2026/04/07 02:54:33 UTC

[PR] [opt](explode) Optimize explode_outer and posexplode (#62069) [doris]

jacktengg opened a new pull request, #62145:
URL: https://github.com/apache/doris/pull/62145

   Issue Number: Pick #62069
   
   Related PR: #xxx
   
   Problem Summary:
   
   Improvement of #60352, optimize explode_outer, posexplode and posexplode_outer.
   
   The approach is a single-pass algorithm: walk through child rows, accumulating contiguous segments into the output, then when hitting a null/empty row or reaching the end, flush the segment using bulk operations. For outer-null rows, insert a NULL and copy the non-table-function columns directly. This naturally handles both outer and
   non-outer modes since non-outer mode just won't produce any null outputs. For posexplode, generate position indices alongside this.
   
   Performance test result.
   Create and populate a large test table. Use 100,000,000 base rows, each with an array of 10 INT elements, producing 1,000,000,000 total exploded output rows.
   
   | Function | slow path | optimized | SpeedUp|
   | --------- |---------- |-----------|----------|
   | explode | 9734 ms | 5105 ms |90%|
   | explode_outer | 9685 ms | 5064 ms |91%|
   | posexplode | 11021 ms | 5963 ms |84%|
   | posexplode_outer | 14088 ms | 5903 ms |138%|
   
   None
   
   - Test <!-- At least one of them must be included. -->
       - [ ] 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 <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [ ] No.
   - [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 -->
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
   
   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   ### Release note
   
   None
   
   ### 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)
       - [ ] 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 <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [ ] No.
       - [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/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 -->
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [opt](explode) Optimize explode_outer and posexplode (#62069) [doris]

Posted by "Thearas (via GitHub)" <gi...@apache.org>.
Thearas commented on PR #62145:
URL: https://github.com/apache/doris/pull/62145#issuecomment-4196181684

   
   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/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?
       


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [opt](explode) Optimize explode_outer and posexplode (#62069) [doris]

Posted by "jacktengg (via GitHub)" <gi...@apache.org>.
jacktengg commented on PR #62145:
URL: https://github.com/apache/doris/pull/62145#issuecomment-4196181939

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [opt](explode) Optimize explode_outer and posexplode (#62069) [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #62145:
URL: https://github.com/apache/doris/pull/62145#issuecomment-4197232547

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [opt](explode) Optimize explode_outer and posexplode (#62069) [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #62145:
URL: https://github.com/apache/doris/pull/62145#issuecomment-4197232788

   PR approved by anyone and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [opt](explode) Optimize explode_outer and posexplode (#62069) [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #62145:
URL: https://github.com/apache/doris/pull/62145#issuecomment-4198000060

   # BE Regression && UT Coverage Report
   Increment line coverage `87.10% (189/217)` :tada:
   
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/62145_f773e4a4b2ae5192651f0d880265acb4083c98d1_merge/increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/62145_f773e4a4b2ae5192651f0d880265acb4083c98d1_merge/report/index.html)
   | Category          | Coverage           |
   |-------------------|--------------------|
   | Function Coverage | 73.18% (26799/36620) |
   | Line Coverage     | 56.62% (288393/509304) |
   | Region Coverage   | 54.19% (241148/445019) |
   | Branch Coverage   | 55.81% (104606/187426) |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [opt](explode) Optimize explode_outer and posexplode (#62069) [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #62145:
URL: https://github.com/apache/doris/pull/62145#issuecomment-4197954808

   # BE UT Coverage Report
   Increment line coverage `88.72% (118/133)` :tada:
   
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/f773e4a4b2ae5192651f0d880265acb4083c98d1_f773e4a4b2ae5192651f0d880265acb4083c98d1/increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/f773e4a4b2ae5192651f0d880265acb4083c98d1_f773e4a4b2ae5192651f0d880265acb4083c98d1/report/index.html)
   | Category          | Coverage           |
   |-------------------|--------------------|
   | Function Coverage | 52.96% (19828/37438) |
   | Line Coverage     | 36.46% (186446/511326) |
   | Region Coverage   | 32.72% (144409/441323) |
   | Branch Coverage   | 33.90% (63394/186990) |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [opt](explode) Optimize explode_outer and posexplode (#62069) [doris]

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #62145:
URL: https://github.com/apache/doris/pull/62145


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org