From user-return-56839-apmail-hbase-user-archive=hbase.apache.org@hbase.apache.org Fri Nov 20 09:36:28 2020 Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by minotaur.apache.org (Postfix) with ESMTP id CB5A91A775 for ; Fri, 20 Nov 2020 09:36:27 +0000 (UTC) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 92BD1691E2 for ; Fri, 20 Nov 2020 09:36:26 +0000 (UTC) Received: (qmail 98364 invoked by uid 500); 20 Nov 2020 09:36:16 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 98053 invoked by uid 500); 20 Nov 2020 09:36:16 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 98030 invoked by uid 99); 20 Nov 2020 09:36:15 -0000 Received: from ec2-52-204-25-47.compute-1.amazonaws.com (HELO mailrelay1-ec2-va.apache.org) (52.204.25.47) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Nov 2020 09:36:15 +0000 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) by mailrelay1-ec2-va.apache.org (ASF Mail Server at mailrelay1-ec2-va.apache.org) with ESMTPSA id D30433E92A; Fri, 20 Nov 2020 09:36:15 +0000 (UTC) Received: by mail-ot1-f44.google.com with SMTP id n12so4630077otk.0; Fri, 20 Nov 2020 01:36:15 -0800 (PST) X-Gm-Message-State: AOAM530I/DLB8Wkto+OdznrqgdXjEiPHSrwX+zhnflEQB+0AQtVNJ2Ff sUmKXsN54AT17s7ekF/RvjCjN31erF0lDrosIds= X-Google-Smtp-Source: ABdhPJzChtkpXZB4L3cCmJAynpA/f/LIdmdsjpMfV2Hki0nUbolLjy3sWwovOSBnV2Hm2nAMX0Nu0UVchseT/TckbgM= X-Received: by 2002:a9d:1b2:: with SMTP id e47mr12695569ote.45.1605864975363; Fri, 20 Nov 2020 01:36:15 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Viraj Jasani Date: Fri, 20 Nov 2020 15:06:04 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [DISCUSS] HBASE-25299 Scan#setRowPrefixFilter Unexpected behavior To: dev@hbase.apache.org Cc: Hbase-User Content-Type: multipart/alternative; boundary="00000000000069f5a505b48693ce" --00000000000069f5a505b48693ce Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable +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 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. > > =E5=94=90=E5=A4=A9=E8=88=AA =E4=BA=8E2020=E5= =B9=B411=E6=9C=8819=E6=97=A5=E5=91=A8=E5=9B=9B =E4=B8=8A=E5=8D=8812:45=E5= =86=99=E9=81=93=EF=BC=9A > > > Hi, > > I have opened an issue 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 =3D=3D 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 > > > --00000000000069f5a505b48693ce--