You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2017/08/14 16:01:01 UTC

[jira] [Commented] (PHOENIX-4083) Incorrect conditional when including OFFSET into explain plan

    [ https://issues.apache.org/jira/browse/PHOENIX-4083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16125873#comment-16125873 ] 

James Taylor commented on PHOENIX-4083:
---------------------------------------

FYI, [~ankit@apache.org]

> Incorrect conditional when including OFFSET into explain plan
> -------------------------------------------------------------
>
>                 Key: PHOENIX-4083
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4083
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: JC
>            Priority: Trivial
>
> Hi
> I've found a suspicious code in a recent github repo.
> Path: phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
> {code:java}
> 292     public void explain(List<String> planSteps) {
> 293         delegate.explain(planSteps);
> 294         planSteps.add("CLIENT" + (offset != null ? "" : " OFFSET " + offset)
> 295                 + (limit == null ? "" : " TOP " + limit + " ROW" + (limit == 1 ? "" : "S")) + " SORTED BY "
> 296                 + orderByExpressions.toString());
> 297     }
> {code}
> In Line 294, the condition, `offset != null', should be `offset == null'? Otherwise, the string value willl be `CLIENT OFFSET null' only when the offset is null. (c.f. limit returns an empty string when it is null.) Since I don't have domain knowledge of this project, I have no idea if this is intended. But I wanted to report this just in case.
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)