You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Chen Feng (Jira)" <ji...@apache.org> on 2020/05/15 07:22:00 UTC
[jira] [Created] (PHOENIX-5897) SingleKeyValueTuple.toString()
returns unexpected result
Chen Feng created PHOENIX-5897:
----------------------------------
Summary: SingleKeyValueTuple.toString() returns unexpected result
Key: PHOENIX-5897
URL: https://issues.apache.org/jira/browse/PHOENIX-5897
Project: Phoenix
Issue Type: Improvement
Reporter: Chen Feng
Assignee: Chen Feng
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)