You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "Richárd Antal (Jira)" <ji...@apache.org> on 2021/05/31 07:29:00 UTC
[jira] [Commented] (PHOENIX-6481) Strange behavior in
upserting-deleting-upserting when primary key contains a ROW TIMESTAMP
field
[ https://issues.apache.org/jira/browse/PHOENIX-6481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17354258#comment-17354258 ]
Richárd Antal commented on PHOENIX-6481:
----------------------------------------
It can be reproduced on the master branch as well. I think 5.1 and 5.1.1 is affected as well.
> Strange behavior in upserting-deleting-upserting when primary key contains a ROW TIMESTAMP field
> ------------------------------------------------------------------------------------------------
>
> Key: PHOENIX-6481
> URL: https://issues.apache.org/jira/browse/PHOENIX-6481
> Project: Phoenix
> Issue Type: Bug
> Components: core
> Affects Versions: 5.0.0
> Reporter: Davide Vergari
> Priority: Major
>
> Hello,
> we found a strange behavior in upserting -> deleting -> upserting again a row in a phoenix table when the primary key contains a ROW_TIMESTAMP field.
>
> If you upsert a record, than you delete this record and upsert the same record again, the latest operation does not take effect.
>
> Steps to reproduce:
>
> {code:java}
> 0: jdbc:phoenix:> drop table if exists t1;
> No rows affected (0.66 seconds)
> 0: jdbc:phoenix:> create table t1 (c1 timestamp not null, c2 integer constraint pk primary key (c1 row_timestamp));
> No rows affected (0.75 seconds)
> 0: jdbc:phoenix:> upsert into t1 (c1, c2) values (to_timestamp('2021-05-28 00:00:00.000', 'yyyy-MM-dd HH:mm:SS.ssss', 'UTC+2'), 1);
> 1 row affected (0.008 seconds)
> 0: jdbc:phoenix:> select * from t1;
> +--------------------------+-----+
> | C1 | C2 |
> +--------------------------+-----+
> | 2021-05-28 00:00:00.000 | 1 |
> +--------------------------+-----+
> 1 row selected (0.041 seconds)
> 0: jdbc:phoenix:> delete from t1 where c1 = to_timestamp('2021-05-28 00:00:00.000', 'yyyy-MM-dd HH:mm:SS.ssss', 'UTC+2');
> 1 row affected (0.007 seconds)
> 0: jdbc:phoenix:> upsert into t1 (c1, c2) values (to_timestamp('2021-05-28 00:00:00.000', 'yyyy-MM-dd HH:mm:SS.ssss', 'UTC+2'), 1);
> 1 row affected (0.007 seconds)
> 0: jdbc:phoenix:> select * from t1;
> +-----+-----+
> | C1 | C2 |
> +-----+-----+
> +-----+-----+
> No rows selected (0.027 seconds)
> 0: jdbc:phoenix:>
> {code}
> If I upsert a new row with a different ROW_TIMESTAMP everything works as expected.
>
> The same issue there is also if the PK is a composed one, but with a ROW_TIMESTAMP in it.
>
> I'm using HBase 2.0.2 and Phoenix 5.0.0-Hbase-2.0
> {color:#6897bb} {color}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)