Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/701#discussion_r99650496
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
 ---
    @@ -50,13 +47,56 @@
       private DrillSqlWorker() {
       }
     
    +  /**
    +   * Converts sql query string into query physical plan.
    +   *
    +   * @param context query context
    +   * @param sql sql query
    +   * @return query physical plan
    +   */
       public static PhysicalPlan getPlan(QueryContext context, String sql) 
throws SqlParseException, ValidationException,
           ForemanSetupException {
         return getPlan(context, sql, null);
       }
     
    +  /**
    +   * Converts sql query string into query physical plan.
    +   * In case of any errors (that might occur due to missing function 
implementation),
    +   * checks if local function registry should be synchronized with remote 
function registry.
    +   * If sync took place, reloads drill operator table
    +   * (since functions were added to / removed from local function registry)
    +   * and attempts to converts sql query string into query physical plan 
one more time.
    +   *
    +   * @param context query context
    +   * @param sql sql query
    +   * @param textPlan text plan
    +   * @return query physical plan
    +   */
       public static PhysicalPlan getPlan(QueryContext context, String sql, 
Pointer<String> textPlan)
           throws ForemanSetupException {
    +    Pointer<String> textPlanCopy = textPlan == null ? null : new 
Pointer<>(textPlan.value);
    +    try {
    +      return getQueryPlan(context, sql, textPlan);
    +    } catch (Exception e) {
    --- End diff --
    
    Should we be more specific in the error we catch? Wouldn't this mean that, 
even for a simple syntax error, we'd resync and retry? Can we catch only the 
specific function error of interest?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to