From dev-return-49775-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Thu Mar 1 03:54:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6D2C0180657 for ; Thu, 1 Mar 2018 03:54:05 +0100 (CET) Received: (qmail 4255 invoked by uid 500); 1 Mar 2018 02:54:04 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 4241 invoked by uid 99); 1 Mar 2018 02:54:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2018 02:54:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 7FA3BC0040 for ; Thu, 1 Mar 2018 02:54:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id RA7bS0OSb8p3 for ; Thu, 1 Mar 2018 02:54:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 6491E5F340 for ; Thu, 1 Mar 2018 02:54:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id AC9CAE0217 for ; Thu, 1 Mar 2018 02:54:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3B41724386 for ; Thu, 1 Mar 2018 02:54:00 +0000 (UTC) Date: Thu, 1 Mar 2018 02:54:00 +0000 (UTC) From: "chenglei (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-4630) Reverse scan with row_timestamp does not working MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PHOENIX-4630?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 381435#comment-16381435 ]=20 chenglei commented on PHOENIX-4630: ----------------------------------- Applied the patch to 4.x-HBase-1.3 and ran all the unit tests and IT tests = in my local machine, the tests are all successful. > Reverse scan with row_timestamp does not working > ------------------------------------------------ > > Key: PHOENIX-4630 > URL: https://issues.apache.org/jira/browse/PHOENIX-4630 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.13.0, 4.13.1, 4.13.2, 4.13.2-cdh5.11.2 > Reporter: JeongMin Ju > Priority: Critical > Attachments: PHOENIX-4630_v1.patch > > > In version 4.13, if the query plan is a reverse scan, an error or incorre= ct data is returned. > This is a problem that occurs when the query plan is a reverse range scan= in the case of an "order by desc" query for the row key. > The table schem is as follows. > {code:java} > create table if not exists app_log ( > app_tag varchar not null, > timestamp date not null, > uuid varchar not null, > log varchar > constraint pk primary key(app_tag, timestamp row_timestamp, uuid) > ) > data_block_encoding=3D'FAST_DIFF', > compression=3D'LZ4', > update_cache_frequency=3D600000, > column_encoded_bytes =3D 1, > ttl=3D2592000, > salt_buckets=3D50 > ; > {code} > The current data is as follows. > {code:java} > upsert into app_log values ('test', now(), 'test', 'test'); > ... > select * from app_log order by timestamp; > +-----------+--------------------------+-------+-------+ > | APP_TAG | TIMESTAMP | UUID | LOG | > +-----------+--------------------------+-------+-------+ > | test | 2018-02-28 01:02:16.985 | test | test | > | test | 2018-02-28 01:02:19.472 | test | test | > | test | 2018-02-28 01:02:21.568 | test | test | > | test | 2018-02-28 01:02:23.332 | test | test | > | test | 2018-02-28 01:02:25.200 | test | test | > | test | 2018-02-28 01:02:27.055 | test | test | > | test | 2018-02-28 01:02:29.008 | test | test | > | test | 2018-02-28 01:02:30.911 | test | test | > | test | 2018-02-28 01:02:32.775 | test | test | > | test | 2018-02-28 01:02:34.663 | test | test | > +-----------+--------------------------+-------+-------+ > {code} > You can see errors if you run a simple query after adding some data. > Depending on the data, an error may occur and incorrect data may be outpu= t. > {code:java} > select * from app_log where app_tag =3D 'test' and timestamp between to_d= ate('2018-02-28 01:02:16') and to_date('2018-02-28 01:02:34') order by time= stamp desc; > Error: org.apache.phoenix.exception.PhoenixIOException: org.apache.hadoop= .hbase.DoNotRetryIOException: APP_LOG,\x0D\x00\x00\x00\x00\x00\x00\x00\x00\= x00\x00,1519778082466.6dd30a7d7a26a38c5c06d63008bbff3d.: seekToPreviousRow = must not be called on a non-reversed scanner > at org.apache.phoenix.util.ServerUtil.createIOException(ServerUtil.java:9= 6) > at org.apache.phoenix.util.ServerUtil.throwIOException(ServerUtil.java:62= ) > at org.apache.phoenix.iterate.RegionScannerFactory$1.nextRaw(RegionScanne= rFactory.java:212) > at org.apache.phoenix.coprocessor.DelegateRegionScanner.nextRaw(DelegateR= egionScanner.java:82) > at org.apache.phoenix.coprocessor.DelegateRegionScanner.nextRaw(DelegateR= egionScanner.java:82) > at org.apache.phoenix.coprocessor.BaseScannerRegionObserver$RegionScanner= Holder.nextRaw(BaseScannerRegionObserver.java:293) > at org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.= java:2561) > at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$= 2.callBlockingMethod(ClientProtos.java:33648) > at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2183) > at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:112) > at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:1= 85) > at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:1= 65) > Caused by: org.apache.commons.lang.NotImplementedException: seekToPreviou= sRow must not be called on a non-reversed scanner > at org.apache.hadoop.hbase.regionserver.NonReversedNonLazyKeyValueScanner= .seekToPreviousRow(NonReversedNonLazyKeyValueScanner.java:44) > at org.apache.hadoop.hbase.regionserver.ReversedKeyValueHeap.seekToPrevio= usRow(ReversedKeyValueHeap.java:89) > at org.apache.hadoop.hbase.regionserver.ReversedRegionScannerImpl.nextRow= (ReversedRegionScannerImpl.java:71) > at org.apache.hadoop.hbase.regionserver.HRegion$RegionScannerImpl.nextInt= ernal(HRegion.java:5938) > at org.apache.hadoop.hbase.regionserver.HRegion$RegionScannerImpl.nextRaw= (HRegion.java:5673) > at org.apache.hadoop.hbase.regionserver.HRegion$RegionScannerImpl.nextRaw= (HRegion.java:5659) > at org.apache.phoenix.iterate.RegionScannerFactory$1.nextRaw(RegionScanne= rFactory.java:175) > ... 9 more (state=3D08000,code=3D101) > {code} > =C2=A0Query plan is as follow. > {code:java} > explain select * from app_log where app_tag =3D 'test' and timestamp betw= een to_date('2018-02-28 01:02:20') and to_date('2018-02-28 01:02:30') order= by timestamp desc; > +------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------+-----------------+----------------+--------------+ > | = PLAN = | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS | > +------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------+-----------------+----------------+--------------+ > | CLIENT 14-CHUNK PARALLEL 14-WAY REVERSE RANGE SCAN OVER APP_LOG [0,'tes= t','2018-02-28 01:02:20.000'] - [49,'test','2018-02-28 01:02:30.000'] | nu= ll | null | null | > | ROW TIMESTAMP FILTER [1519779740000, 1519779750001) = = | null | null | null | > | CLIENT MERGE SORT = = | null | null | null | > +------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------+-----------------+----------------+--------------+ > {code} > Notice that the query plan is REVERSE RANGE SCAN. > Refer to my comment on PHOENIX-4622 for causes and solutions. -- This message was sent by Atlassian JIRA (v7.6.3#76005)