Skip to content

[Bug] base of 25451 issue , use union all will influence result #25452

@riruigit

Description

@riruigit

Search before asking

  • I had searched in the issues and found no similar issues.

Version

2.0.1 and doris-2.0.2-rc05

What's Wrong?

image

result 1 is error , but result 2 and 3 is right , if you use union all , result 1 , 2 , 3 all error

What You Expected?

because of union all ,result 1 keep error , but result 2 and 3 will > 0

How to Reproduce?

csv data link : https://pan.baidu.com/s/1f8JWCEPdwotnWkaCem-JQw?pwd=fpax 提取码: fpax

create table ddl :
CREATE TABLE doris_decimal_sum_error(FQTYDECIMAL(23, 10) NULL,FPRICEDECIMAL(23, 10) NULL,FEXCHANGERATE DECIMAL(23, 10) NULL ) ENGINE=OLAP DUPLICATE KEY(FQTY, FPRICE) COMMENT 'OLAP' DISTRIBUTED BY HASH(FQTY) BUCKETS 10 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "is_being_synced" = "false", "storage_format" = "V2", "light_schema_change" = "true", "disable_auto_compaction" = "false", "enable_single_replica_compaction" = "false" );

run sql :
SELECT sum(FQTY * FPRICE * FEXCHANGERATE) as result1 FROM doris_decimal_sum_error WHERE FQTY > 0 and FPRICE > 0 and FEXCHANGERATE > 0 union all SELECT sum( cast( (FQTY * FPRICE * FEXCHANGERATE) as DECIMAL(23,10) )) as result2 FROM doris_decimal_sum_error WHERE FQTY > 0 and FPRICE > 0 and FEXCHANGERATE > 0 union all SELECT sum( cast(FQTY as DECIMAL(12,4)) * cast(FPRICE as DECIMAL(12,4)) * cast(FEXCHANGERATE as DECIMAL(12,4)) ) as result2 FROM doris_decimal_sum_error WHERE FQTY > 0 and FPRICE > 0 and FEXCHANGERATE > 0

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions