killxdcj opened a new issue #7084: URL: https://github.com/apache/incubator-doris/issues/7084
### 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 doris-0.14.0 ### What's Wrong? When partition_cache is enabled, if Query's aggregate columns contain expression, CacheAnalyzer will throw exception and causes the query to fail. ### What You Expected? should not throw exception ### How to Reproduce? 1. Create a table with more then one partition, and insert some data to the table. CREATE TABLE test ( k1 bigint(20) NOT NULL COMMENT "", k2 varchar(255) NOT NULL COMMENT "", k3 date NOT NULL COMMENT "", v1 varchar(255) NOT NULL COMMENT "" ) ENGINE=OLAP DUPLICATE KEY(k1, k2, k3) COMMENT "OLAP" PARTITION BY RANGE(k3) (PARTITION p20210519 VALUES [('2021-05-19'), ('2021-05-20')), PARTITION p20210520 VALUES [('2021-05-20'), ('2021-05-21')), PARTITION p20210521 VALUES [('2021-05-21'), ('2021-05-22')) DISTRIBUTED BY HASH(k1, k2) BUCKETS 3 PROPERTIES ( "replication_num" = "3" ); 2. set enable_partition_cache=true and execute the flowing query. `select char_length(k1) as len, sum(1) from test group by len` 3. Exception in FE log 2021-11-10 16:38:35,012 WARN (doris-mysql-nio-pool-6|326) [StmtExecutor.execute():369] execute Exception java.lang.ClassCastException: class org.apache.doris.analysis.FunctionCallExpr cannot be cast to class org.apache.doris.analysis.SlotRef (org.apache.doris.analysis.FunctionCallExpr and org.apache.doris.analysis.SlotRef are in unnamed module of loader 'app') at org.apache.doris.qe.cache.CacheAnalyzer.checkGroupByPartitionKey(CacheAnalyzer.java:385) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.cache.CacheAnalyzer.innerCheckCacheMode(CacheAnalyzer.java:251) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.cache.CacheAnalyzer.getCacheData(CacheAnalyzer.java:272) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.handleCacheStmt(StmtExecutor.java:778) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.handleQueryStmt(StmtExecutor.java:875) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:305) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:255) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:240) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:381) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:585) ~[palo-fe.jar:3.4.0] at org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:50) ~[palo-fe.jar:3.4.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:834) [?:?] ### 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: [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]
