Reminiscent opened a new pull request, #19695: URL: https://github.com/apache/doris/pull/19695
# Proposed changes In the nereids. Before this PR: when we access some unexists tables. It will report the exception as follows: ``` mysql> select * from tt; ERROR 1105 (HY000): errCode = 2, detailMessage = Unexpected exception: null ``` After this PR, it will get the following results: ``` mysql> select * from tt; ERROR 1105 (HY000): errCode = 2, detailMessage = Unexpected exception: Table [tt] does not exist in database [default_cluster:test]. ``` ## Problem summary It is because in this [function](https://github.com/Reminiscent/doris/blob/f5af07f7b218ad2c1266626970b31dd9a9ee72d4/fe/fe-core/src/main/java/org/apache/doris/nereids/CascadesContext.java#L328), we ignore the exception. So the size of `tables` in `CascadesContext` is zero not null. So we can only get null after `table = cascadesContext.getTableByName(tableName);`. Describe your changes. If we find `table == null`, we will check the catalog. It's very safe and can avoid such problems. ## Checklist(Required) * [ ] Does it affect the original behavior * [ ] Has unit tests been added * [ ] Has document been added or modified * [ ] Does it need to update dependencies * [ ] Is this PR support rollback (If NO, please explain WHY) ## Further comments If this is a relatively large or complex change, kick off the discussion at [d...@doris.apache.org](mailto:d...@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc... -- 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 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