Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-5897

SingleKeyValueTuple.toString() returns unexpected result

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 5.0.0-alpha
    • 5.1.0, 4.16.0
    • None
    • None

    Description

      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.

      Attachments

        1. PHOENIX-5897_v1-4.x.patch
          6 kB
          chenglei
        2. PHOENIX-5897-v1.patch
          2 kB
          Chen Feng

        Activity

          People

            fengchen8086 Chen Feng
            fengchen8086 Chen Feng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: