HBase
  1. HBase
  2. HBASE-1837

Fix results contract (If row has no results, return null, if Result has no results return null or empty Sets and Arrays?)

    Details

    • Type: Task Task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Make sure we are consistent regards results contract. As jgray says:

      17:47 < jgray> decisions are things like, if the result is empty do we return nulls or do we return empty 
                     lists/0-length arrays
      17:47 < jgray> if result is empty, do we return null for row?
      17:47 < jgray> and if row is the null row, we then return zero-length byte[0]
      17:48 < St^Ack_> So, if row is empty, we return null (I believe)
      17:48 < jgray> yes
      17:49 < St^Ack_> If you have a result, up to this, if empty, it would not return null stuff.
      17:49 < jgray> no it did return null stuff
      17:49 < jgray> at least many of them did
      17:49 < St^Ack_> oh.. ok.
      17:49 < jgray> but then my result delayed deserialization broke that on one case
      17:49 < St^Ack_> I thought I'd added it w/ 1836?
      17:49 < jgray> yeah u fixed what i broke, i think
      17:50 < jgray> but we should nail down the contract, specify what it is in javadoc, and add unit tests to verify such
      ...
      

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          2034d 6h 43m 1 Andrew Purtell 11/Apr/15 01:37
          Andrew Purtell made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Incomplete [ 4 ]
          stack made changes -
          Fix Version/s 0.92.0 [ 12314223 ]
          Hide
          stack added a comment -

          Moving out of 0.92.0. Pull it back in if you think different.

          Show
          stack added a comment - Moving out of 0.92.0. Pull it back in if you think different.
          Hide
          Joe Pallas added a comment -

          Current behavior is both confusing and not documented.

          "Effective Java" recommends returning empty collections instead of null, in general. I understand the argument about distinguishing between empty and missing from HBASE-1028, but with a Bigtable-style dynamic schema, there are cases where there simply is no difference. In those cases, an empty collection seems a much better choice for clients.

          Show
          Joe Pallas added a comment - Current behavior is both confusing and not documented. "Effective Java" recommends returning empty collections instead of null, in general. I understand the argument about distinguishing between empty and missing from HBASE-1028 , but with a Bigtable-style dynamic schema, there are cases where there simply is no difference. In those cases, an empty collection seems a much better choice for clients.
          Joe Pallas made changes -
          Link This issue relates to HBASE-1028 [ HBASE-1028 ]
          Joe Pallas made changes -
          Link This issue relates to HBASE-176 [ HBASE-176 ]
          Joe Pallas made changes -
          Link This issue relates to HBASE-1301 [ HBASE-1301 ]
          stack made changes -
          Field Original Value New Value
          Fix Version/s 0.22.0 [ 12314223 ]
          Fix Version/s 0.21.0 [ 12313607 ]
          Hide
          stack added a comment -

          Moved from 0.21 to 0.22 just after merge of old 0.20 branch into TRUNK.

          Show
          stack added a comment - Moved from 0.21 to 0.22 just after merge of old 0.20 branch into TRUNK.
          stack created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              stack
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development