+1 to deprecating setRowPrefixFilter. PR looks good, as I commented
yesterday, if you could include your nice example as a unit test with this
PR, that would be really great.
Thanks for this nice find!


On Thu, 19 Nov 2020 at 6:02 AM, Guanghao Zhang <zghao...@gmail.com> wrote:

> I am +1 to deprecated setRowPrefixFilter method. This method name is
> setRowPrefixFilter but not use filter and only set start row and end row. I
> thought this could be done by user.
>
> 唐天航 <tangtianhang...@gmail.com> 于2020年11月19日周四 上午12:45写道:
>
> > Hi,
> >   I have opened an issue HBASE-25299
> > <https://issues.apache.org/jira/browse/HBASE-25299> about
> > Scan#setRowPrefixFilter
> > Unexpected behavior.
> >
> > e.g.
> >
> > startRow : "112"
> >
> > rowPrefixFilter : "11"
> >
> > The Result of this scan might contain : "111", which is unexpected.
> >
> >   public Scan setRowPrefixFilter(byte[] rowPrefix) {
> >     if (rowPrefix == null) {
> >       setStartRow(HConstants.EMPTY_START_ROW);
> >       setStopRow(HConstants.EMPTY_END_ROW);
> >     } else {
> >       this.setStartRow(rowPrefix);
> >       this.setStopRow(calculateTheClosestNextRowKeyForPrefix(rowPrefix));
> >     }
> >     return this;
> >   }
> >
> >  Scan#setRowPrefixFilter achieves this function by setting startRow and
> > stopRow, ignoring the situation that startRow may have been set.
> >
> >
> > I have discussed this issue with @infraio and he suggested to deprecate
> > this method because modifying it may cause compatibility issues.
> >
> > Is this plan acceptable? Hope to get some suggestions.
> >
> >
> > Thank you. Regards
> >
>

Reply via email to