HBase
  1. HBase
  2. HBASE-5999

AggregationClient throws an exception when startRow is set and stopRow is not set in scan object.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Not a Problem
    • Affects Version/s: 0.92.0, 0.92.1
    • Fix Version/s: None
    • Component/s: Client, Coprocessors
    • Labels:
      None

      Description

      AggregationClient throws an exception when the startRow is set and stopRow is not set in scan object. AggregationClient should not throw the exception in this case because the user might want to scan the entire table starting from the startRow.

        Activity

        Hide
        Ted Yu added a comment -

        I think we can relax the original constraint by checking scan.hasFilter()
        If a filter is present, there is no need to set stopRow.

        Show
        Ted Yu added a comment - I think we can relax the original constraint by checking scan.hasFilter() If a filter is present, there is no need to set stopRow.
        Hide
        Anil Gupta added a comment -

        Hi Zhihong,

        I have got the fix for it and I discussed my fix with Ted Yu and he seemed ok with that. I just need to create a patch. Please refer to user mailing list discussion between me and Ted.
        Essentially this is the change required in validateParameter method in AggregationClient class:
        if (scan == null || (Bytes.equals(scan.getStartRow(), scan.getStopRow()) && !Bytes.equals(scan.getStartRow(), HConstants.EMPTY_START_ROW)) || (Bytes.compareTo(scan.getStartRow(), scan.getStopRow()) > 0 && !Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW) ))

        !Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW) is the additional condition required to handle this case. I have tested my code and it works fine. Please let me know if this solution is not right.

        Thanks,
        Anil Gupta

        Show
        Anil Gupta added a comment - Hi Zhihong, I have got the fix for it and I discussed my fix with Ted Yu and he seemed ok with that. I just need to create a patch. Please refer to user mailing list discussion between me and Ted. Essentially this is the change required in validateParameter method in AggregationClient class: if (scan == null || (Bytes.equals(scan.getStartRow(), scan.getStopRow()) && !Bytes.equals(scan.getStartRow(), HConstants.EMPTY_START_ROW)) || (Bytes.compareTo(scan.getStartRow(), scan.getStopRow()) > 0 && !Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW) )) !Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW) is the additional condition required to handle this case. I have tested my code and it works fine. Please let me know if this solution is not right. Thanks, Anil Gupta
        Hide
        Ted Yu added a comment -

        This has been fixed in 0.92, etc

        Show
        Ted Yu added a comment - This has been fixed in 0.92, etc

          People

          • Assignee:
            Unassigned
            Reporter:
            Anil Gupta
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development