beauli opened a new issue, #58937: URL: https://github.com/apache/doris/issues/58937
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version doris-4.0.1-rc02-791725594d ### What's Wrong? When I run sql using Having clause with subquery filter, it will throw exception: SQL Error [1105] [HY000]: errCode = 2, detailMessage = class org.apache.doris.nereids.trees.expressions.literal.NullLiteral cannot be cast to class org.apache.doris.nereids.trees.expressions.Slot (org.apache.doris.nereids.trees.expressions.literal.NullLiteral and org.apache.doris.nereids.trees.expressions.Slot are in unnamed module of loader 'app') ### What You Expected? This should ran success as 3.x ### How to Reproduce? 1. create test table `create table test (period varchar(10))` 2. insert data `insert into test values('202501')` 3. run query `select period from test group by period HAVING COUNT(DISTINCT period) = (SELECT COUNT(DISTINCT period) FROM test WHERE period IN ('202501') )` 4. got error: SQL Error [1105] [HY000]: errCode = 2, detailMessage = class org.apache.doris.nereids.trees.expressions.literal.NullLiteral cannot be cast to class org.apache.doris.nereids.trees.expressions.Slot (org.apache.doris.nereids.trees.expressions.literal.NullLiteral and org.apache.doris.nereids.trees.expressions.Slot are in unnamed module of loader 'app') ### Anything Else? _No response_ ### Are you willing to submit PR? - [ ] 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
