Skip to content

[Fix](func) fix element_at return err when short-circuit evaluation passes empty input#60570

Open
linrrzqqq wants to merge 1 commit intoapache:masterfrom
linrrzqqq:fix-element-at
Open

[Fix](func) fix element_at return err when short-circuit evaluation passes empty input#60570
linrrzqqq wants to merge 1 commit intoapache:masterfrom
linrrzqqq:fix-element-at

Conversation

@linrrzqqq
Copy link
Contributor

@linrrzqqq linrrzqqq commented Feb 6, 2026

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

The element_at branch is completely short-circuited, causing rows == 0. The original line of code throws an error when rows <= 0

Release note

None

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

@linrrzqqq linrrzqqq requested a review from zclllyybb as a code owner February 6, 2026 08:11
@hello-stephen
Copy link
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?

@linrrzqqq
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 30416 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 44f58209196d50b7ca7311ce9629a8bb5df5db26, data reload: false

------ Round 1 ----------------------------------
q1	17641	4478	4300	4300
q2	2034	351	237	237
q3	10135	1284	759	759
q4	10197	783	303	303
q5	7502	2154	1939	1939
q6	194	178	146	146
q7	889	731	599	599
q8	9254	1373	1111	1111
q9	4627	4665	4650	4650
q10	6770	1923	1544	1544
q11	538	301	292	292
q12	334	380	221	221
q13	17783	4020	3239	3239
q14	241	236	213	213
q15	879	821	799	799
q16	694	708	612	612
q17	696	881	452	452
q18	6581	5718	5932	5718
q19	1410	1052	629	629
q20	591	545	445	445
q21	2726	1976	1912	1912
q22	382	334	296	296
Total cold run time: 102098 ms
Total hot run time: 30416 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4613	4539	4703	4539
q2	272	355	247	247
q3	2331	2971	2417	2417
q4	1436	1904	1418	1418
q5	4712	4535	4745	4535
q6	226	177	135	135
q7	1989	1902	1772	1772
q8	2533	2488	2634	2488
q9	7475	7629	7390	7390
q10	3016	2999	2583	2583
q11	542	484	467	467
q12	711	788	626	626
q13	3900	4323	3572	3572
q14	300	319	293	293
q15	825	827	832	827
q16	678	717	642	642
q17	1077	1260	1360	1260
q18	7430	7390	7246	7246
q19	912	779	794	779
q20	1947	2081	1868	1868
q21	4534	4301	4042	4042
q22	565	555	519	519
Total cold run time: 52024 ms
Total hot run time: 49665 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 28.38 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 44f58209196d50b7ca7311ce9629a8bb5df5db26, data reload: false

query1	0.05	0.04	0.05
query2	0.10	0.05	0.05
query3	0.26	0.09	0.09
query4	1.61	0.11	0.11
query5	0.28	0.25	0.24
query6	1.17	0.69	0.69
query7	0.03	0.03	0.03
query8	0.06	0.05	0.03
query9	0.58	0.51	0.50
query10	0.54	0.55	0.54
query11	0.14	0.09	0.09
query12	0.14	0.11	0.10
query13	0.62	0.61	0.62
query14	1.06	1.04	1.02
query15	0.88	0.86	0.88
query16	0.39	0.38	0.41
query17	1.11	1.06	1.13
query18	0.24	0.21	0.21
query19	2.03	2.01	1.95
query20	0.02	0.01	0.01
query21	15.44	0.26	0.15
query22	5.33	0.06	0.05
query23	15.98	0.29	0.11
query24	1.13	0.47	0.54
query25	0.11	0.06	0.11
query26	0.15	0.14	0.14
query27	0.07	0.06	0.06
query28	4.41	1.15	0.96
query29	12.57	3.96	3.18
query30	0.28	0.12	0.11
query31	2.81	0.64	0.39
query32	3.23	0.60	0.49
query33	3.18	3.24	3.22
query34	16.30	5.43	4.72
query35	4.80	4.80	4.79
query36	0.65	0.48	0.48
query37	0.12	0.07	0.07
query38	0.07	0.05	0.04
query39	0.04	0.03	0.03
query40	0.19	0.16	0.15
query41	0.09	0.04	0.03
query42	0.05	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 98.35 s
Total hot run time: 28.38 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.61% (19409/36894)
Line Coverage 36.12% (180573/499962)
Region Coverage 32.45% (139949/431253)
Branch Coverage 33.47% (60607/181089)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.73% (25933/36155)
Line Coverage 54.36% (271133/498738)
Region Coverage 51.86% (225917/435637)
Branch Coverage 53.31% (96919/181797)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.70% (25923/36155)
Line Coverage 54.33% (270955/498738)
Region Coverage 51.80% (225674/435637)
Branch Coverage 53.28% (96857/181797)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants