[Refine](sql block)unify exception catching for sql block (#17879)

currently, the AnalysisException throw by matchSql will catch immediately.
however, the AnalysisException throws by checkLimitations will catch as UserException.
This commit is contained in:
GoGoWen
2023-04-09 20:09:16 +08:00
committed by GitHub
parent d749c23bcd
commit 266d54bb39

View File

@ -464,14 +464,8 @@ public class StmtExecutor implements ProfileWriter {
}
private boolean checkBlockRules() throws AnalysisException {
try {
Env.getCurrentEnv().getSqlBlockRuleMgr().matchSql(
originStmt.originStmt, context.getSqlHash(), context.getQualifiedUser());
} catch (AnalysisException e) {
LOG.warn(e.getMessage());
context.getState().setError(e.getMysqlErrorCode(), e.getMessage());
return true;
}
Env.getCurrentEnv().getSqlBlockRuleMgr().matchSql(
originStmt.originStmt, context.getSqlHash(), context.getQualifiedUser());
// limitations: partition_num, tablet_num, cardinality
List<ScanNode> scanNodeList = planner.getScanNodes();