You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "chenglei (Jira)" <ji...@apache.org> on 2020/06/21 11:30:00 UTC

[jira] [Comment Edited] (PHOENIX-5897) SingleKeyValueTuple.toString() returns unexpected result

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

chenglei edited comment on PHOENIX-5897 at 6/21/20, 11:29 AM:
--------------------------------------------------------------

Added unit tests for the patch.
[~fengchen8086], thank you for the patch, pushed to 4.x and master.


was (Author: comnetwork):
Added unit tests for the patch.

> SingleKeyValueTuple.toString() returns unexpected result
> --------------------------------------------------------
>
>                 Key: PHOENIX-5897
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5897
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 5.0.0-alpha
>            Reporter: Chen Feng
>            Assignee: Chen Feng
>            Priority: Minor
>             Fix For: 5.1.0
>
>         Attachments: PHOENIX-5897-v1.patch, PHOENIX-5897_v1-4.x.patch
>
>
> In SingleKeyValueTuple.toString(), the code is shown as follows.
> return "SingleKeyValueTuple[" + cell == null ? keyPtr.get() == UNITIALIZED_KEY_BUFFER ? "null" : Bytes.toStringBinary(keyPtr.get(),keyPtr.getOffset(),keyPtr.getLength()) : cell.toString() + "]";
> actually, the code runs in the following order.
> ("SingleKeyValueTuple[" + cell) == null ? keyPtr.get() == UNITIALIZED_KEY_BUFFER ? "null" : Bytes.toStringBinary() : (cell.toString() + "]");
> Therefore the result is weird.
> BTW, value = condition1 ? condition2 ? X : Y : Z is also confusing, using if can be more clear.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)