Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Not A Problem
-
4.15.0
-
None
-
None
Description
The generic method to issue queries is a variation of the following:
try (Connection conn = DriverManager.getConnection(url); Statement stmt = conn.createStatement()) { ResultSet rs = stmt.executeQuery("select * from t"); while(rs.next()) { // do something } }
However, a client that issues a point lookup may just call rs.next() without the while loop. In that case, overallQueryMetrics will not be updated due to the current logic (see this).
In this case, it may be better to move this logic to PhoenixResultSet.close() which is a more obvious restriction we can impose on end-client behavior as opposed to a seemingly unnecessary while loop.