vvysotskyi commented on code in PR #2655: URL: https://github.com/apache/drill/pull/2655#discussion_r981705289
########## exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java: ########## @@ -130,11 +132,18 @@ private static PhysicalPlan convertPlan(QueryContext context, String sql, Pointe logger.trace("There was an error during conversion into physical plan. " + "Will sync remote and local function registries if needed and retry " + "in case if issue was due to missing function implementation.", e); - // it is prohibited to retry query planning for ANALYZE statement since it changes - // query-level option values and will fail when rerunning with updated values - if (context.getFunctionRegistry().syncWithRemoteRegistry( - context.getDrillOperatorTable().getFunctionRegistryVersion()) - && context.getSQLStatementType() != SqlStatementType.ANALYZE) { + + int funcRegVer = context.getDrillOperatorTable().getFunctionRegistryVersion(); + // We do not retry conversion if the error is a UserException of type RESOURCE + boolean isResourceErr = e instanceof UserException && ((UserException) e).getErrorType() == RESOURCE; Review Comment: Yes, it would be a more reliable approach. Initially, I was looking for a way how to pass it properly, one of the options is to use the query option, but it will be tricky to set it in the place where plugins could be disabled with this feature. -- 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: dev-unsubscr...@drill.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org