Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
ghx-label-2
Description
The problem is that while we handle an exception, we throw another:
} 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; }
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.