[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-08-19 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=297201=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-297201
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 19/Aug/19 15:17
Start Date: 19/Aug/19 15:17
Worklog Time Spent: 10m 
  Work Description: billson87 commented on issue #35: [LENS-1545]: Fixed 
Bug in Prepared Query.
URL: https://github.com/apache/lens/pull/35#issuecomment-522623805
 
 
   Like always. Fantastim
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 297201)
Time Spent: 3.5h  (was: 3h 20m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-08-14 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=294665=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-294665
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 14/Aug/19 10:15
Start Date: 14/Aug/19 10:15
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #35: 
[LENS-1545]: Fixed Bug in Prepared Query.
URL: https://github.com/apache/lens/pull/35#discussion_r313801600
 
 

 ##
 File path: 
lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
 ##
 @@ -556,6 +556,8 @@ public String getPlan() {
   public QueryCost estimate(AbstractQueryContext qctx) throws LensException {
 MethodMetricsContext validateGauge = 
MethodMetricsFactory.createMethodGauge(qctx.getDriverConf(this), true,
   VALIDATE_GAUGE);
+String rewrittenQuery = rewriteQuery(qctx);
 
 Review comment:
   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
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 294665)
Time Spent: 3h 20m  (was: 3h 10m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-08-14 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=294664=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-294664
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 14/Aug/19 10:13
Start Date: 14/Aug/19 10:13
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #35: 
[LENS-1545]: Fixed Bug in Prepared Query.
URL: https://github.com/apache/lens/pull/35#discussion_r313801600
 
 

 ##
 File path: 
lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
 ##
 @@ -556,6 +556,8 @@ public String getPlan() {
   public QueryCost estimate(AbstractQueryContext qctx) throws LensException {
 MethodMetricsContext validateGauge = 
MethodMetricsFactory.createMethodGauge(qctx.getDriverConf(this), true,
   VALIDATE_GAUGE);
+String rewrittenQuery = rewriteQuery(qctx);
 
 Review comment:
   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 
   
https://github.com/apache/lens/blob/master/lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java#L728
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 294664)
Time Spent: 3h 10m  (was: 3h)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-08-14 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=294636=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-294636
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 14/Aug/19 09:18
Start Date: 14/Aug/19 09:18
Worklog Time Spent: 10m 
  Work Description: Amareshwari commented on pull request #35: [LENS-1545]: 
Fixed Bug in Prepared Query.
URL: https://github.com/apache/lens/pull/35#discussion_r313780258
 
 

 ##
 File path: 
lens-driver-jdbc/src/main/java/org/apache/lens/driver/jdbc/JDBCDriver.java
 ##
 @@ -556,6 +556,8 @@ public String getPlan() {
   public QueryCost estimate(AbstractQueryContext qctx) throws LensException {
 MethodMetricsContext validateGauge = 
MethodMetricsFactory.createMethodGauge(qctx.getDriverConf(this), true,
   VALIDATE_GAUGE);
+String rewrittenQuery = rewriteQuery(qctx);
 
 Review comment:
   Not sure why changes are done in estimate, when you are fixing bug in 
prepareQuery. 
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 294636)
Time Spent: 3h  (was: 2h 50m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 3h
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-24 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=281541=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-281541
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 24/Jul/19 06:23
Start Date: 24/Jul/19 06:23
Worklog Time Spent: 10m 
  Work Description: Amareshwari commented on pull request #34: [LENS-1545]: 
Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34
 
 
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 281541)
Time Spent: 2h 50m  (was: 2h 40m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-22 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=280377=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-280377
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 22/Jul/19 12:52
Start Date: 22/Jul/19 12:52
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r305828088
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
 ##
 @@ -2054,7 +2057,12 @@ public QueryPrepareHandle prepare(LensSessionHandle 
sessionHandle, String query,
   acquire(sessionHandle);
   prepared = prepareQuery(sessionHandle, query, lensConf, 
SubmitOp.PREPARE);
   prepared.setQueryName(queryName);
-  prepared.getSelectedDriver().prepare(prepared);
+  try {
+lensServerDao.insertPreparedQuery(prepared);
+  } catch (Exception e) {
+incrCounter(PREPARED_QUERY_INSERT_COUNTER);
 
 Review comment:
   the counter name was wrong, i have renamed it to 
PREPARED_QUERY_INSERT_ERROR_COUNTER and also throwed the exception.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 280377)
Time Spent: 2.5h  (was: 2h 20m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-22 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=280378=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-280378
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 22/Jul/19 12:52
Start Date: 22/Jul/19 12:52
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r305828131
 
 

 ##
 File path: 
lens-cube/src/main/java/org/apache/lens/cube/metadata/CubeMetastoreClient.java
 ##
 @@ -1830,30 +1830,19 @@ public XFact getXFactTable(FactTable ft) throws 
LensException {
 for (UpdatePeriod updatePeriod : updatePeriods) {
   tableNames.add(updatePeriodToTableMap.get(updatePeriod));
 }
-if (tableNames.size() <= 1) {
-  XStorageTableElement tblElement = 
JAXBUtils.getXStorageTableFromHiveTable(
-
getHiveTable(MetastoreUtil.getFactOrDimtableStorageTableName(cft.getName(), 
storageName)));
-  tblElement.setStorageName(storageName);
-  for (UpdatePeriod p : updatePeriods) {
-
tblElement.getUpdatePeriods().getUpdatePeriod().add(XUpdatePeriod.valueOf(p.name()));
-  }
-  factTable.getStorageTables().getStorageTable().add(tblElement);
-} else {
-  // Multiple storage tables.
-  XStorageTableElement tblElement = new XStorageTableElement();
-  tblElement.setStorageName(storageName);
-  XUpdatePeriods xUpdatePeriods = new XUpdatePeriods();
-  tblElement.setUpdatePeriods(xUpdatePeriods);
-  for (Map.Entry entry : updatePeriodToTableMap.entrySet()) {
-XUpdatePeriodTableDescriptor updatePeriodTableDescriptor = new 
XUpdatePeriodTableDescriptor();
-
updatePeriodTableDescriptor.setTableDesc(getStorageTableDescFromHiveTable(
+XStorageTableElement tblElement = new XStorageTableElement();
 
 Review comment:
   done.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 280378)
Time Spent: 2h 40m  (was: 2.5h)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-22 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=280376=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-280376
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 22/Jul/19 12:51
Start Date: 22/Jul/19 12:51
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r305827383
 
 

 ##
 File path: 
lens-cube/src/main/java/org/apache/lens/cube/metadata/CubeMetastoreClient.java
 ##
 @@ -1830,30 +1830,19 @@ public XFact getXFactTable(FactTable ft) throws 
LensException {
 for (UpdatePeriod updatePeriod : updatePeriods) {
   tableNames.add(updatePeriodToTableMap.get(updatePeriod));
 }
-if (tableNames.size() <= 1) {
-  XStorageTableElement tblElement = 
JAXBUtils.getXStorageTableFromHiveTable(
-
getHiveTable(MetastoreUtil.getFactOrDimtableStorageTableName(cft.getName(), 
storageName)));
-  tblElement.setStorageName(storageName);
-  for (UpdatePeriod p : updatePeriods) {
-
tblElement.getUpdatePeriods().getUpdatePeriod().add(XUpdatePeriod.valueOf(p.name()));
-  }
-  factTable.getStorageTables().getStorageTable().add(tblElement);
-} else {
-  // Multiple storage tables.
-  XStorageTableElement tblElement = new XStorageTableElement();
-  tblElement.setStorageName(storageName);
-  XUpdatePeriods xUpdatePeriods = new XUpdatePeriods();
-  tblElement.setUpdatePeriods(xUpdatePeriods);
-  for (Map.Entry entry : updatePeriodToTableMap.entrySet()) {
-XUpdatePeriodTableDescriptor updatePeriodTableDescriptor = new 
XUpdatePeriodTableDescriptor();
-
updatePeriodTableDescriptor.setTableDesc(getStorageTableDescFromHiveTable(
+XStorageTableElement tblElement = new XStorageTableElement();
 
 Review comment:
   added it.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 280376)
Time Spent: 2h 20m  (was: 2h 10m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-19 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=279547=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-279547
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 19/Jul/19 07:02
Start Date: 19/Jul/19 07:02
Worklog Time Spent: 10m 
  Work Description: Amareshwari commented on pull request #34: [LENS-1545]: 
Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r305224564
 
 

 ##
 File path: 
lens-cube/src/main/java/org/apache/lens/cube/metadata/CubeMetastoreClient.java
 ##
 @@ -1830,30 +1830,19 @@ public XFact getXFactTable(FactTable ft) throws 
LensException {
 for (UpdatePeriod updatePeriod : updatePeriods) {
   tableNames.add(updatePeriodToTableMap.get(updatePeriod));
 }
-if (tableNames.size() <= 1) {
-  XStorageTableElement tblElement = 
JAXBUtils.getXStorageTableFromHiveTable(
-
getHiveTable(MetastoreUtil.getFactOrDimtableStorageTableName(cft.getName(), 
storageName)));
-  tblElement.setStorageName(storageName);
-  for (UpdatePeriod p : updatePeriods) {
-
tblElement.getUpdatePeriods().getUpdatePeriod().add(XUpdatePeriod.valueOf(p.name()));
-  }
-  factTable.getStorageTables().getStorageTable().add(tblElement);
-} else {
-  // Multiple storage tables.
-  XStorageTableElement tblElement = new XStorageTableElement();
-  tblElement.setStorageName(storageName);
-  XUpdatePeriods xUpdatePeriods = new XUpdatePeriods();
-  tblElement.setUpdatePeriods(xUpdatePeriods);
-  for (Map.Entry entry : updatePeriodToTableMap.entrySet()) {
-XUpdatePeriodTableDescriptor updatePeriodTableDescriptor = new 
XUpdatePeriodTableDescriptor();
-
updatePeriodTableDescriptor.setTableDesc(getStorageTableDescFromHiveTable(
+XStorageTableElement tblElement = new XStorageTableElement();
 
 Review comment:
   Can a unit test be added for the bug fixed here?
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 279547)
Time Spent: 2h 10m  (was: 2h)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-19 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=279546=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-279546
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 19/Jul/19 07:02
Start Date: 19/Jul/19 07:02
Worklog Time Spent: 10m 
  Work Description: Amareshwari commented on pull request #34: [LENS-1545]: 
Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r305223812
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
 ##
 @@ -2054,7 +2057,12 @@ public QueryPrepareHandle prepare(LensSessionHandle 
sessionHandle, String query,
   acquire(sessionHandle);
   prepared = prepareQuery(sessionHandle, query, lensConf, 
SubmitOp.PREPARE);
   prepared.setQueryName(queryName);
-  prepared.getSelectedDriver().prepare(prepared);
+  try {
+lensServerDao.insertPreparedQuery(prepared);
+  } catch (Exception e) {
+incrCounter(PREPARED_QUERY_INSERT_COUNTER);
 
 Review comment:
   This should be a failed counter? Also why is exception eaten up?
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 279546)
Time Spent: 2h  (was: 1h 50m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-16 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=277398=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-277398
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 16/Jul/19 10:27
Start Date: 16/Jul/19 10:27
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r303835743
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/LensServerDAO.java
 ##
 @@ -821,4 +823,32 @@ public boolean deleteActiveSession(LensSessionHandle 
sessionId) throws LensExcep
 
 return result;
   }
+
+  /**
+   * DAO method to insert a new Prepared query into Table.
+   *
+   * @param preparedQueryContext to be inserted
+   * @throws SQLException the exception
+   */
+  public void insertPreparedQuery(PreparedQueryContext preparedQueryContext) 
throws SQLException {
 
 Review comment:
   anyways I have added unit test case.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 277398)
Time Spent: 1h 50m  (was: 1h 40m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-15 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=276677=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-276677
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 15/Jul/19 12:46
Start Date: 15/Jul/19 12:46
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r303416232
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/LensServerDAO.java
 ##
 @@ -821,4 +823,32 @@ public boolean deleteActiveSession(LensSessionHandle 
sessionId) throws LensExcep
 
 return result;
   }
+
+  /**
+   * DAO method to insert a new Prepared query into Table.
+   *
+   * @param preparedQueryContext to be inserted
+   * @throws SQLException the exception
+   */
+  public void insertPreparedQuery(PreparedQueryContext preparedQueryContext) 
throws SQLException {
 
 Review comment:
   Some one calling once/twice/zero times is not part of unit testing. It is a 
overkill to unnecessarily mock and unit test.
   In this code snippet, it is making a call to a external system and it 
returns void.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 276677)
Time Spent: 1h 40m  (was: 1.5h)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-15 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=276672=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-276672
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 15/Jul/19 12:33
Start Date: 15/Jul/19 12:33
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r303411451
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
 ##
 @@ -2054,8 +2056,14 @@ public QueryPrepareHandle prepare(LensSessionHandle 
sessionHandle, String query,
   acquire(sessionHandle);
   prepared = prepareQuery(sessionHandle, query, lensConf, 
SubmitOp.PREPARE);
   prepared.setQueryName(queryName);
-  prepared.getSelectedDriver().prepare(prepared);
+  try {
 
 Review comment:
   This is already happening. All the public methods of QueryServiceResource 
histograms are already pushed by default.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 276672)
Time Spent: 1.5h  (was: 1h 20m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-15 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=276534=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-276534
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 15/Jul/19 07:45
Start Date: 15/Jul/19 07:45
Worklog Time Spent: 10m 
  Work Description: ankitkailaswar commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r303312442
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/LensServerDAO.java
 ##
 @@ -821,4 +823,32 @@ public boolean deleteActiveSession(LensSessionHandle 
sessionId) throws LensExcep
 
 return result;
   }
+
+  /**
+   * DAO method to insert a new Prepared query into Table.
+   *
+   * @param preparedQueryContext to be inserted
+   * @throws SQLException the exception
+   */
+  public void insertPreparedQuery(PreparedQueryContext preparedQueryContext) 
throws SQLException {
 
 Review comment:
   I am asking or unit test around new snippet of code written here and unit 
test is not only around return  value. 
   Consider a scenario where in future any user wants to use this function and 
end up calling "insert prepare" twice from his code then this code is expected 
throw exception in the second call. A developer will not come to know this at 
build time unless unit tests are added. There can be many such scenarios 
unknown now.
   Also please add checks and unit tests for invalid values of 
preparedQueryContext. It can cause runtime exception. rethrow LensException 
instead.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 276534)
Time Spent: 1h 20m  (was: 1h 10m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-15 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=276535=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-276535
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 15/Jul/19 07:45
Start Date: 15/Jul/19 07:45
Worklog Time Spent: 10m 
  Work Description: ankitkailaswar commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r303304202
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
 ##
 @@ -2054,8 +2056,14 @@ public QueryPrepareHandle prepare(LensSessionHandle 
sessionHandle, String query,
   acquire(sessionHandle);
   prepared = prepareQuery(sessionHandle, query, lensConf, 
SubmitOp.PREPARE);
   prepared.setQueryName(queryName);
-  prepared.getSelectedDriver().prepare(prepared);
+  try {
 
 Review comment:
   I assume we are capturing query prepare time for lens query to monitor its 
performance. If that's the case its always better to emit metric that indicates 
average prepare query time over last 5 mins, 60 min, etc. 
PREPARED_QUERIES_COUNTER is different counter I am asking you to emit one for 
prepare time with aggregation that can be used to raise an alert. To monitor 
performance by looking into db is not good practice. It is being used mostly 
for bookkeeping. 
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 276535)
Time Spent: 1h 20m  (was: 1h 10m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-15 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=276533=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-276533
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 15/Jul/19 07:44
Start Date: 15/Jul/19 07:44
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r303315570
 
 

 ##
 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:
   Explain also works fine because of the below stack trace:
   JDBCDriver.rewriteQuery(AbstractQueryContext) line: 529  
   JDBCDriver.explain(AbstractQueryContext) line: 582   
   QueryExecutionServiceImpl.explain(String, LensSessionHandle, String, 
LensConf) line: 3141
   
   Explain was also try to make JDBC connection, I have stopped this using 
JDBC_VALIDATE_THROUGH_PREPARE(I have renamed this variable to 
JDBC_VALIDATE_THROUGH_PREPARE_OR_EXPLAIN).
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 276533)
Time Spent: 1h 10m  (was: 1h)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-12 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=275866=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-275866
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 12/Jul/19 12:31
Start Date: 12/Jul/19 12:31
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r302960364
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/LensServerDAO.java
 ##
 @@ -821,4 +823,32 @@ public boolean deleteActiveSession(LensSessionHandle 
sessionId) throws LensExcep
 
 return result;
   }
+
+  /**
+   * DAO method to insert a new Prepared query into Table.
+   *
+   * @param preparedQueryContext to be inserted
+   * @throws SQLException the exception
+   */
+  public void insertPreparedQuery(PreparedQueryContext preparedQueryContext) 
throws SQLException {
 
 Review comment:
   This is a void method, and anyways it calls external system to insert data, 
I don't think we should be unit-testing here.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 275866)
Time Spent: 1h  (was: 50m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-12 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=275848=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-275848
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 12/Jul/19 11:59
Start Date: 12/Jul/19 11:59
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r302950272
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
 ##
 @@ -2054,8 +2056,14 @@ public QueryPrepareHandle prepare(LensSessionHandle 
sessionHandle, String query,
   acquire(sessionHandle);
   prepared = prepareQuery(sessionHandle, query, lensConf, 
SubmitOp.PREPARE);
   prepared.setQueryName(queryName);
-  prepared.getSelectedDriver().prepare(prepared);
+  try {
 
 Review comment:
   For the prepared query, I am inserting start_time and timeTaken(this can 
deduce the end_time if needed).
   Regarding the NumberOfPrepared queries, it is already being emitted 
PREPARED_QUERIES_COUNTER.  Regarding the query prepare time is already present 
in  database.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 275848)
Time Spent: 50m  (was: 40m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-12 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=275834=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-275834
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 12/Jul/19 11:28
Start Date: 12/Jul/19 11:28
Worklog Time Spent: 10m 
  Work Description: RajashekharChoukimath commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r302941779
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/LensServerDAO.java
 ##
 @@ -821,4 +823,32 @@ public boolean deleteActiveSession(LensSessionHandle 
sessionId) throws LensExcep
 
 return result;
   }
+
 
 Review comment:
   We don't update the prepared query, we insert only prepared query, so it is 
not needed.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 275834)
Time Spent: 40m  (was: 0.5h)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-10 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=274801=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-274801
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 10/Jul/19 11:33
Start Date: 10/Jul/19 11:33
Worklog Time Spent: 10m 
  Work Description: ankitkailaswar commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r301517807
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/LensServerDAO.java
 ##
 @@ -821,4 +823,32 @@ public boolean deleteActiveSession(LensSessionHandle 
sessionId) throws LensExcep
 
 return result;
   }
+
 
 Review comment:
   add update prepare query also
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 274801)
Time Spent: 20m  (was: 10m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-10 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=274800=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-274800
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 10/Jul/19 11:33
Start Date: 10/Jul/19 11:33
Worklog Time Spent: 10m 
  Work Description: ankitkailaswar commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r301521569
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
 ##
 @@ -2054,8 +2056,14 @@ public QueryPrepareHandle prepare(LensSessionHandle 
sessionHandle, String query,
   acquire(sessionHandle);
   prepared = prepareQuery(sessionHandle, query, lensConf, 
SubmitOp.PREPARE);
   prepared.setQueryName(queryName);
-  prepared.getSelectedDriver().prepare(prepared);
+  try {
 
 Review comment:
   push start time and end time for prepared query in db and emit metric for 
query prepare time.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 274800)
Time Spent: 20m  (was: 10m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-10 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=274802=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-274802
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 10/Jul/19 11:33
Start Date: 10/Jul/19 11:33
Worklog Time Spent: 10m 
  Work Description: ankitkailaswar commented on pull request #34: 
[LENS-1545]: Fixed a Bug and made changes for PreparedQuery.
URL: https://github.com/apache/lens/pull/34#discussion_r301517943
 
 

 ##
 File path: 
lens-server/src/main/java/org/apache/lens/server/query/LensServerDAO.java
 ##
 @@ -821,4 +823,32 @@ public boolean deleteActiveSession(LensSessionHandle 
sessionId) throws LensExcep
 
 return result;
   }
+
+  /**
+   * DAO method to insert a new Prepared query into Table.
+   *
+   * @param preparedQueryContext to be inserted
+   * @throws SQLException the exception
+   */
+  public void insertPreparedQuery(PreparedQueryContext preparedQueryContext) 
throws SQLException {
 
 Review comment:
   add unit tests
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 274802)
Time Spent: 0.5h  (was: 20m)

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (LENS-1545) Fixed a Bug and made changes for PreparedQuery

2019-07-10 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/LENS-1545?focusedWorklogId=274799=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-274799
 ]

ASF GitHub Bot logged work on LENS-1545:


Author: ASF GitHub Bot
Created on: 10/Jul/19 11:33
Start Date: 10/Jul/19 11:33
Worklog Time Spent: 10m 
  Work Description: ankitkailaswar commented on 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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 274799)
Time Spent: 10m
Remaining Estimate: 0h

> Fixed a Bug and made changes for PreparedQuery
> --
>
> Key: LENS-1545
> URL: https://issues.apache.org/jira/browse/LENS-1545
> Project: Apache Lens
>  Issue Type: Improvement
>  Components: api, cube, server
>Reporter: Rajashekhar
>Assignee: Amareshwari Sriramadasu
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Fixed following Issues in Lens for Azure Migrations
>  # Bug in Lens-Metastore for single fact granularity -- 
> https://issues.apache.org/jira/browse/LENS-1544. Explaination: This had a 
> special case for handling facts with one-update-period and 
> multiple-update-periods. The case which handled one-update-period had a bug 
> while generating the name of the hive table whole format is 
> update_period-fact_name, the update_period was coming as null.
>  # JDBCDriver.java was invoking JDBC Driver while validating the prepared 
> query, I don't need this functionality so blocking this via already existing 
> config parameter JDBC_VALIDATE_THROUGH_PREPARE.
> 2a) Old Flow:
> {code}
> esitmate()
> --- | --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> |--> rewrite -- Rewritting take place
> {code}
> 2b) New Flow:
> {code}
> esitmate()
> ---| --> rewrite -- Rewritting take place
> ---| --> validate
> -| --> JDBC_VALIDATE_THROUGH_PREPARE condition to prepare through if 
> condition
> -|--> prepareInternal()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)