ankitkailaswar commented on a change in pull request #34: [LENS-1545]: Fixed a
Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r301535590
##########
File path:
lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
##########
@@ -735,7 +738,7 @@ private PreparedStatement
prepareInternal(AbstractQueryContext pContext,
// Only create a prepared statement and then close it
MethodMetricsContext sqlRewriteGauge =
MethodMetricsFactory.createMethodGauge(pContext.getDriverConf(this), true,
metricCallStack + COLUMNAR_SQL_REWRITE_GAUGE);
- String rewrittenQuery = rewriteQuery(pContext);
Review comment:
rewrite query is called for estimate, prepare, explain etc. In this case
estimate will work fine. explain will fail to initialize "String
rewrittenQuery" since rewriteQuery was never called and
pContext.getSelectedDriverQuery(); will be null.
Exsisting unit test must have failed for this scenario. Please run unit
tests.
Also I wouldnt recoomend this approach since we have to call rewrite for
estimate/prepare/explaing etc.
Please make it config driven in estimate call.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services