-
Notifications
You must be signed in to change notification settings - Fork 93
[LENS-1545]: Fixed Bug in Prepared Query. #35
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| public PreparedLensQuery getPreparedQuery(String handle) { | ||
| ResultSetHandler<PreparedLensQuery> rsh = new BeanHandler<>(PreparedLensQuery.class, | ||
| new BasicRowProcessor(new FinishedLensQueryBeanProcessor())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is FinishedLensQueryBeanProcessor created for Prepared query ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it.
| try { | ||
| PreparedLensQuery preparedLensQuery = runner.query(sql, rsh, handle); | ||
| return preparedLensQuery; | ||
| } catch (SQLException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is exception eaten up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it.
| } catch (SQLException e) { | ||
| log.error("SQL exception while executing query.", e); | ||
| } | ||
| return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you returning null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it.
| public QueryCost estimate(AbstractQueryContext qctx) throws LensException { | ||
| MethodMetricsContext validateGauge = MethodMetricsFactory.createMethodGauge(qctx.getDriverConf(this), true, | ||
| VALIDATE_GAUGE); | ||
| String rewrittenQuery = rewriteQuery(qctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why changes are done in estimate, when you are fixing bug in prepareQuery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the azure-world, we are not going to have Lens interacting with the actual underlying drivers. https://docs.google.com/document/d/1K5Q3ZQZAEGkf472DZ_zuLbHZ9ycx86YAEhqbxO0o-aA/edit#
The cleaner way for me is to remove driverconnection which Lens is making for the explain part in prepareInternal Method
https://github.com/apache/lens/blob/master/lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java#L728
|
Like always. Fantastim |
… are present, then selected driver's query should be finally set
Uh oh!
There was an error while loading. Please reload this page.