Zoltán Borók-Nagy created IMPALA-12811:
------------------------------------------

             Summary: Exception during re-analysis can be lost
                 Key: IMPALA-12811
                 URL: https://issues.apache.org/jira/browse/IMPALA-12811
             Project: IMPALA
          Issue Type: Bug
          Components: Frontend
            Reporter: Zoltán Borók-Nagy


The problem is that while we handle an exception, we throw another:
{noformat}
    } catch (AnalysisException e) {
      LOG.error(String.format("Error analyzing the rewritten query.\n" +
          "Original SQL: %s\nRewritten SQL: %s", analysisResult_.stmt_.toSql(), 
  // <== toSql() throws another exception, so we lose the original one
          analysisResult_.stmt_.toSql(REWRITTEN)), e);
      throw e;
    }
{noformat}
https://github.com/apache/impala/blob/49d37cfef2e1aef611330489082e12e3c0c63347/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java#L649

Statement.toSql() assumes that the statement is analyzed, but here we are 
handling an AnalysisException, so there's good chance that the analysis of 
statement failed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to