You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Chinmay Kulkarni (Jira)" <ji...@apache.org> on 2020/07/01 19:03:00 UTC
[jira] [Resolved] (PHOENIX-5982) Overall query metrics not updated
if rs.next is called just once
[ https://issues.apache.org/jira/browse/PHOENIX-5982?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chinmay Kulkarni resolved PHOENIX-5982.
---------------------------------------
Resolution: Not A Problem
> Overall query metrics not updated if rs.next is called just once
> ----------------------------------------------------------------
>
> Key: PHOENIX-5982
> URL: https://issues.apache.org/jira/browse/PHOENIX-5982
> Project: Phoenix
> Issue Type: Improvement
> Affects Versions: 4.15.0
> Reporter: Chinmay Kulkarni
> Priority: Major
> Labels: phoenix-hardening, quality-improvement
> Fix For: 4.16.0
>
>
> The generic method to issue queries is a variation of the following:
> {code:java}
> try (Connection conn = DriverManager.getConnection(url);
> Statement stmt = conn.createStatement()) {
> ResultSet rs = stmt.executeQuery("select * from t");
> while(rs.next()) {
> // do something
> }
> }
> {code}
> 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|https://github.com/apache/phoenix/blob/dcc88af8acc2ba8df10d2e9d498ab3646fdf0a78/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java#L878-L881]).
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)