Skip to content

branch-4.0: [fix](repeat plan) fix repeat output slot order inconsistent with its input expression #60045#60190

Closed
yujun777 wants to merge 2 commits into
apache:branch-4.0from
yujun777:pick_60045_to_upstream_branch-4.0
Closed

branch-4.0: [fix](repeat plan) fix repeat output slot order inconsistent with its input expression #60045#60190
yujun777 wants to merge 2 commits into
apache:branch-4.0from
yujun777:pick_60045_to_upstream_branch-4.0

Conversation

@yujun777

Copy link
Copy Markdown
Contributor

cherry pick from #60045

… input expression (apache#60045)

maybe relate PR: apache#21168

BE requires that the repeat node's output slot order should be
inconsistent with its input expressions.
That is output slots = input expressions + GroupingID + other grouping
functions.
But physical translator not ensure this requirement. Then sometimes the
repeat may have bad cast exception.

for sql:
SELECT 100000
FROM db2.table_9_50_undef_partitions2_keys3_properties4_distributed_by5
GROUP BY GROUPING SETS (
        (col_datetime_6__undef_signed, col_varchar_50__undef_signed)
        , ()
        , (col_varchar_50__undef_signed)
        , (col_datetime_6__undef_signed, col_varchar_50__undef_signed)
);

the above sql will have wrong ouput slot order

then BE will have exceptions:
(1105, 'errCode = 2, detailMessage = (172.20.57.146)
[E-7412]assert cast err:[E-7412] Bad cast from type:doris::vectorized::ColumnVector<(doris::PrimitiveType)26> to doris::vectorized::ColumnStr<unsigned int>
0#doris::Exception::Exception(int, std::basic_string_view<char, std::char_traits<char> > const&, bool) at /home/zcp/repo_center/doris_master/doris/be/src/common/exception.cpp:0\n\t1#
...
@yujun777
yujun777 requested a review from yiguolei as a code owner January 23, 2026 11:02
@yujun777

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

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?

@yujun777
yujun777 marked this pull request as draft January 23, 2026 11:16
@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (21/21) 🎉
Increment coverage report
Complete coverage report

@yujun777
yujun777 marked this pull request as ready for review January 26, 2026 08:02
@yujun777

Copy link
Copy Markdown
Contributor Author

run buildall

@yujun777
yujun777 marked this pull request as draft January 26, 2026 08:40
@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 95.24% (20/21) 🎉
Increment coverage report
Complete coverage report

@yujun777
yujun777 marked this pull request as ready for review January 27, 2026 02:54
@yujun777
yujun777 marked this pull request as draft January 28, 2026 02:17
@yujun777

Copy link
Copy Markdown
Contributor Author

4.0 没有relate PR #59116, 先不合了

@yujun777 yujun777 closed this Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants