Skip to content

Conversation

@jacktengg
Copy link
Contributor

@jacktengg jacktengg commented Oct 11, 2025

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

When casting Decimal256 to float, sometimes it result in false overflow error:

[E-255]Arithmetic overflow when converting value 9999999999999999.999999999999999999999999999999999999999999999999999999999999 from type Decimal(76, 60) to type Float32, src to float is 1e+76, multiplier is 1e+60, div result is 1e+16, result is -nan, result value range: [-3.4028235e+38, 3.4028235e+38]

Not sure of the root cause for now, maybe related to casting long double to float type. This PR use double instead of long double to avoid this problem temporarily.

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

@Thearas
Copy link
Contributor

Thearas commented Oct 11, 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?

@jacktengg
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.10	0.05	0.06
query3	0.25	0.08	0.08
query4	1.62	0.12	0.12
query5	0.28	0.27	0.25
query6	1.17	0.65	0.65
query7	0.03	0.03	0.03
query8	0.06	0.04	0.05
query9	0.63	0.53	0.51
query10	0.60	0.58	0.58
query11	0.17	0.11	0.11
query12	0.16	0.12	0.12
query13	0.64	0.61	0.62
query14	1.03	1.04	1.04
query15	0.87	0.85	0.88
query16	0.39	0.40	0.39
query17	1.06	1.04	1.05
query18	0.22	0.21	0.20
query19	1.91	1.86	1.82
query20	0.01	0.01	0.01
query21	15.45	0.97	0.57
query22	0.77	1.36	0.72
query23	14.76	1.38	0.65
query24	9.25	0.76	0.34
query25	0.46	0.12	0.09
query26	0.76	0.17	0.13
query27	0.07	0.07	0.05
query28	8.15	1.28	0.93
query29	12.67	3.94	3.25
query30	0.28	0.12	0.11
query31	2.83	0.60	0.39
query32	3.26	0.57	0.48
query33	3.03	3.10	3.10
query34	16.18	5.42	4.85
query35	4.94	4.88	4.92
query36	0.69	0.51	0.50
query37	0.10	0.07	0.07
query38	0.06	0.04	0.04
query39	0.03	0.03	0.03
query40	0.18	0.15	0.15
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 105.35 s
Total hot run time: 29.98 s

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

yiguolei
yiguolei previously approved these changes Oct 11, 2025
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Oct 11, 2025
@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Oct 12, 2025
@jacktengg
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.09	0.06	0.05
query3	0.25	0.08	0.08
query4	1.61	0.11	0.11
query5	0.28	0.26	0.27
query6	1.18	0.66	0.65
query7	0.03	0.03	0.03
query8	0.06	0.04	0.05
query9	0.66	0.53	0.52
query10	0.57	0.59	0.58
query11	0.17	0.12	0.12
query12	0.16	0.12	0.13
query13	0.64	0.62	0.63
query14	1.03	1.03	1.01
query15	0.88	0.87	0.87
query16	0.41	0.42	0.40
query17	1.09	1.10	1.06
query18	0.21	0.20	0.19
query19	1.96	1.91	1.80
query20	0.02	0.01	0.01
query21	15.46	0.96	0.59
query22	0.77	1.36	0.74
query23	14.74	1.40	0.63
query24	7.62	1.24	0.84
query25	0.48	0.18	0.10
query26	0.52	0.16	0.14
query27	0.07	0.06	0.06
query28	9.84	1.34	0.94
query29	12.55	3.98	3.23
query30	0.27	0.13	0.12
query31	2.84	0.61	0.39
query32	3.24	0.56	0.49
query33	3.03	3.06	3.09
query34	16.10	5.49	4.79
query35	4.95	4.92	4.93
query36	0.70	0.52	0.51
query37	0.10	0.08	0.07
query38	0.06	0.05	0.04
query39	0.03	0.03	0.03
query40	0.19	0.15	0.14
query41	0.09	0.04	0.04
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 105.1 s
Total hot run time: 30.5 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (2/2) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.53% (17751/33793)
Line Coverage 37.71% (161205/427453)
Region Coverage 32.18% (123056/382406)
Branch Coverage 33.58% (53988/160753)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (2/2) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.25% (23590/33111)
Line Coverage 57.70% (246404/427043)
Region Coverage 52.85% (204656/387238)
Branch Coverage 54.65% (88301/161568)

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Oct 13, 2025
@github-actions
Copy link
Contributor

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

@yiguolei yiguolei merged commit e917c59 into apache:master Oct 13, 2025
26 of 27 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 13, 2025
yiguolei pushed a commit that referenced this pull request Oct 14, 2025
…g decimal256 to float #56848 (#56886)

Cherry-picked from #56848

Co-authored-by: TengJianPing <[email protected]>
jacktengg added a commit to jacktengg/incubator-doris that referenced this pull request Oct 30, 2025
morrySnow pushed a commit that referenced this pull request Nov 4, 2025
@yiguolei yiguolei mentioned this pull request Nov 5, 2025
Hastyshell pushed a commit to Hastyshell/doris that referenced this pull request Nov 12, 2025
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/3.1.3-merged dev/4.0.1-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants