-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
Search before asking
- I had searched in the issues 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
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
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?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels