morrySnow opened a new issue, #9599: URL: https://github.com/apache/incubator-doris/issues/9599
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues. ### Version master ### What's Wrong? Unnecessary cast will be added on CaseExpr's children when do analyze on it sometimes. This results in unequal results being returned when comparing two equal cast expressions. ### What You Expected? Do not add unnecessary cast on its children ### How to Reproduce? - Create 2 tables ```sql CREATE TABLE tbl1(k1 INT, v1 INT) DISTRIBUTED BY hash(k1) PROPERTIES("replication_num" = "1"); CREATE TABLE tbl2(k2 INT, v2 INT) DISTRIBUTED BY hash(k2) PROPERTIES("replication_num" = "1"); ``` - restart fe - execute query ```sql SELECT k1, sum(CASE WHEN v2 < 10 THEN v1 ELSE 0 END) s FROM tbl1, tbl2 GROUP BY k1; ``` query analyzed failed and return ``` select list expression not produced by aggregation output (missing from GROUP BY clause?): ... ``` ### Anything Else? _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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-unsubscr...@doris.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org