Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Conversation

@RajashekharChoukimath
Copy link

@RajashekharChoukimath RajashekharChoukimath commented Aug 6, 2019

  1. JDBCDriver.java: Changes in JDBCDriver.java was supposed to happen in [LENS-1545]: Fixed a Bug and made changes for PreparedQuery. #34, I had even mentioned in the comment section of that PR(see item 2). Some how I forgot to checkin this line.

@RajashekharChoukimath RajashekharChoukimath changed the title Prepared Query should come from DB after 10 minutes. [LENS-1546] Prepared Query should come from DB after 10 minutes. Aug 6, 2019

public PreparedLensQuery getPreparedQuery(String handle) {
ResultSetHandler<PreparedLensQuery> rsh = new BeanHandler<>(PreparedLensQuery.class,
new BasicRowProcessor(new FinishedLensQueryBeanProcessor()));
Copy link
Contributor

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 ?

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) {
Copy link
Contributor

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?

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;
Copy link
Contributor

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?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it.

@RajashekharChoukimath RajashekharChoukimath changed the title [LENS-1546] Prepared Query should come from DB after 10 minutes. [LENS-1545]: Fixed Bug in Prepared Query. Aug 13, 2019
public QueryCost estimate(AbstractQueryContext qctx) throws LensException {
MethodMetricsContext validateGauge = MethodMetricsFactory.createMethodGauge(qctx.getDriverConf(this), true,
VALIDATE_GAUGE);
String rewrittenQuery = rewriteQuery(qctx);
Copy link
Contributor

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.

Copy link
Author

@RajashekharChoukimath RajashekharChoukimath Aug 14, 2019

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

@billson87
Copy link

Like always. Fantastim

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants