-
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?
Changes from 2 commits
e2cf15b
bfac713
410bfc0
a56794b
b7d4f2a
0555761
49c9dcb
23125c2
4aa2124
570b070
37fdb92
5482db4
f13dee2
ee4e066
40d4fe1
cb704e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,11 +35,11 @@ | |
| import org.apache.lens.api.query.QueryStatus; | ||
| import org.apache.lens.server.api.error.LensException; | ||
| import org.apache.lens.server.api.query.FinishedLensQuery; | ||
| import org.apache.lens.server.api.query.PreparedLensQuery; | ||
| import org.apache.lens.server.api.query.PreparedQueryContext; | ||
| import org.apache.lens.server.api.query.QueryContext; | ||
| import org.apache.lens.server.session.LensSessionImpl; | ||
| import org.apache.lens.server.util.UtilityMethods; | ||
|
|
||
| import org.apache.commons.codec.binary.Base64; | ||
| import org.apache.commons.dbutils.*; | ||
| import org.apache.commons.dbutils.handlers.BeanHandler; | ||
|
|
@@ -868,4 +868,18 @@ public void insertPreparedQuery(PreparedQueryContext preparedQueryContext) throw | |
| DbUtils.closeQuietly(conn); | ||
| } | ||
| } | ||
|
|
||
| public PreparedLensQuery getPreparedQuery(String handle) { | ||
| ResultSetHandler<PreparedLensQuery> rsh = new BeanHandler<>(PreparedLensQuery.class, | ||
| new BasicRowProcessor(new FinishedLensQueryBeanProcessor())); | ||
|
||
| String sql = "select * from prepared_queries where handle=?"; | ||
| QueryRunner runner = new QueryRunner(ds); | ||
| try { | ||
| PreparedLensQuery preparedLensQuery = runner.query(sql, rsh, handle); | ||
| return preparedLensQuery; | ||
| } 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.
Not sure why changes are done in estimate, when you are fixing bug in prepareQuery.
Uh oh!
There was an error while loading. Please reload this page.
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