phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yuhao Bi <byh0...@gmail.com>
Subject Re: Setting a TTL in an upsert
Date Wed, 23 Sep 2015 07:31:09 GMT
Hi,

As I know, we can only set a ttl in create table stage corresponding to
HBase table ttl.

CREATE TABLE IF NOT EXISTS my_schema.my_table (
    org_id CHAR(15), entity_id CHAR(15), payload binary(1000),
    CONSTRAINT pk PRIMARY KEY (org_id, entity_id) )
    TTL=86400
See http://phoenix.apache.org/language/index.html#create_table for more
grammar detail.


Thanks,

2015-09-23 15:11 GMT+08:00 Alex Loffler <Alex.Loffler@telus.com>:

> Hi,
>
>
>
> Is it possible to define the TTL of a row (or even each cell in the row)
> during an upsert e.g:
>
>
>
> upsert into test values(1,2,3) TTL=1442988643355;
>
>
>
> Assuming the table has a TTL this would allow per-row retention policies
> (with automatic garbage-collection by HBase) by e.g. setting the upsert TTL
> to a time in the future.
>
>
>
> For example if the TTL on the table is set to 60 (seconds), a row with a
> desired retention policy of 1 year could be upserted with a TTL=now() + 1
> year.
>
>
>
> Thanks in advance,
>
> -Alex.
>

Mime
View raw message