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_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


With regards,
Apache Git Services

Reply via email to