qidaye opened a new issue #7104: URL: https://github.com/apache/incubator-doris/issues/7104
### 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 f93dae98e41752663ff12a443c5a46914c7aae7a ### What's Wrong? When enable both `sql_cache` and `profile`, sql stmt is throw `NullPointerException` except the first time. ```sql mysql> show variables like '%cache%'; +------------------------+---------+ | Variable_name | Value | +------------------------+---------+ | enable_partition_cache | false | | enable_sql_cache | true | | query_cache_size | 1048576 | | query_cache_type | 0 | +------------------------+---------+ 4 rows in set (0.00 sec) mysql> show variables like '%profile%'; +----------------+-------+ | Variable_name | Value | +----------------+-------+ | enable_profile | true | +----------------+-------+ 1 row in set (0.00 sec) mysql> select c3, sum(c4) from (select c1, c2, c3, c4 from tb_test_1 where c1 = 1)a where c2=3 group by c3; ERROR 1064 (HY000): NullPointerException, msg: null ``` ### What You Expected? Query successfully. ### How to Reproduce? 1. `set enable_sql_cache=true;` 2. `set enable_profile=true;` 3. execute sql stmt `select c3, sum(c4) from (select c1, c2, c3, c4 from tb_test_1 where c1 = 1)a where c2=3 group by c3;` the first is success. 4. Execute once, error. ### Anything Else? Error log in FE: ```log 2021-11-12 15:19:39,757 WARN (doris-mysql-nio-pool-0|179) [StmtExecutor.execute():409] execute Exception java.lang.NullPointerException: null at org.apache.doris.qe.StmtExecutor.initProfile(StmtExecutor.java:230) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.writeProfile(StmtExecutor.java:475) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:346) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:288) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:217) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:353) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:554) ~[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) [?:?] ``` ### 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]
