Re: default_time_to_live vs TTL on insert statement

2018-07-12 Thread Nitan Kainth
Okay so it means regular update and any ttl set with write overrides default 
setting. Which means datastax documentation is incorrect and should be updated.

Sent from my iPhone

> On Jul 12, 2018, at 9:35 AM, DuyHai Doan  wrote:
> 
> To set TTL on a column only and not on the whole CQL row, use UPDATE
> instead:
> 
> UPDATE  USING TTL xxx SET = WHERE partition=yyy
> 
>> On Thu, Jul 12, 2018 at 2:42 PM, Nitan Kainth  wrote:
>> 
>> Kurt,
>> 
>> It is same mentioned on apache docuemtation too, I am not able to f

-
To unsubscribe, e-mail: user-unsubscr...@cassandra.apache.org
For additional commands, e-mail: user-h...@cassandra.apache.org



Re: default_time_to_live vs TTL on insert statement

2018-07-12 Thread DuyHai Doan
To set TTL on a column only and not on the whole CQL row, use UPDATE
instead:

UPDATE  USING TTL xxx SET = WHERE partition=yyy

On Thu, Jul 12, 2018 at 2:42 PM, Nitan Kainth  wrote:

> Kurt,
>
> It is same mentioned on apache docuemtation too, I am not able to find it
> right now.
>
> But my question is:
> How to set TTL for a whole column?
>
> On Wed, Jul 11, 2018 at 11:36 PM, kurt greaves 
> wrote:
>
>> The Datastax documentation is wrong. It won't error, and it shouldn't. If
>> you want to fix that documentation I suggest contacting Datastax.
>>
>> On 11 July 2018 at 19:56, Nitan Kainth  wrote:
>>
>>> Hi DuyHai,
>>>
>>> Could you please explain in what case C* will error based on documented
>>> statement:
>>>
>>> You can set a default TTL for an entire table by setting the table's
>>> default_time_to_live
>>> 
>>>  property. If you try to set a TTL for a specific column that is longer
>>> than the time defined by the table TTL, Cassandra returns an error.
>>>
>>>
>>>
>>> On Wed, Jul 11, 2018 at 2:34 PM, DuyHai Doan 
>>> wrote:
>>>
 default_time_to_live
 
  property applies if you don't specify any TTL on your CQL statement

 However you can always override the default_time_to_live
 
  property by specifying a custom value for each CQL statement

 The behavior is correct, nothing wrong here

 On Wed, Jul 11, 2018 at 7:31 PM, Nitan Kainth 
 wrote:

> Hi,
>
> As per document: https://docs.datastax.com/en/cql/3.3/cql/cql_using
> /useExpireExample.html
>
>
>-
>
>You can set a default TTL for an entire table by setting the
>table's default_time_to_live
>
> 
> property. If you try to set a TTL for a specific column that is
>longer than the time defined by the table TTL, Cassandra returns an 
> error.
>
>
> When I tried to test this statement, i found, we can insert data with
> TTL greater than default_time_to_live. Is the document needs correction, 
> or
> am I mis-understanding it?
>
> CREATE TABLE test (
>
> name text PRIMARY KEY,
>
> description text
>
> ) WITH bloom_filter_fp_chance = 0.01
>
> AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>
> AND comment = ''
>
> AND compaction = {'class': 'org.apache.cassandra.db.compa
> ction.SizeTieredCompactionStrategy', 'max_threshold': '32',
> 'min_threshold': '4'}
>
> AND compression = {'chunk_length_in_kb': '64', 'class': '
> org.apache.cassandra.io.compress.LZ4Compressor'}
>
> AND crc_check_chance = 1.0
>
> AND dclocal_read_repair_chance = 0.1
>
> AND default_time_to_live = 240
>
> AND gc_grace_seconds = 864000
>
> AND max_index_interval = 2048
>
> AND memtable_flush_period_in_ms = 0
>
> AND min_index_interval = 128
>
> AND read_repair_chance = 0.0
>
> AND speculative_retry = '99PERCENTILE';
>
> insert into test (name, description) values ('name5', 'name
> description5') using ttl 360;
>
> select * from test ;
>
>
>  name  | description
>
> ---+---
>
>  name5 | name description5
>
>
> SELECT TTL (description) from test;
>
>
>  ttl(description)
>
> --
>
>  351
>
> Can someone please clear this for me?
>
>
>
>
>
>

>>>
>>
>


Re: default_time_to_live vs TTL on insert statement

2018-07-12 Thread Nitan Kainth
Kurt,

It is same mentioned on apache docuemtation too, I am not able to find it
right now.

But my question is:
How to set TTL for a whole column?

On Wed, Jul 11, 2018 at 11:36 PM, kurt greaves  wrote:

> The Datastax documentation is wrong. It won't error, and it shouldn't. If
> you want to fix that documentation I suggest contacting Datastax.
>
> On 11 July 2018 at 19:56, Nitan Kainth  wrote:
>
>> Hi DuyHai,
>>
>> Could you please explain in what case C* will error based on documented
>> statement:
>>
>> You can set a default TTL for an entire table by setting the table's
>> default_time_to_live
>> 
>>  property. If you try to set a TTL for a specific column that is longer
>> than the time defined by the table TTL, Cassandra returns an error.
>>
>>
>>
>> On Wed, Jul 11, 2018 at 2:34 PM, DuyHai Doan 
>> wrote:
>>
>>> default_time_to_live
>>> 
>>>  property applies if you don't specify any TTL on your CQL statement
>>>
>>> However you can always override the default_time_to_live
>>> 
>>>  property by specifying a custom value for each CQL statement
>>>
>>> The behavior is correct, nothing wrong here
>>>
>>> On Wed, Jul 11, 2018 at 7:31 PM, Nitan Kainth 
>>> wrote:
>>>
 Hi,

 As per document: https://docs.datastax.com/en/cql/3.3/cql/cql_using
 /useExpireExample.html


-

You can set a default TTL for an entire table by setting the table's
 default_time_to_live

 
 property. If you try to set a TTL for a specific column that is
longer than the time defined by the table TTL, Cassandra returns an 
 error.


 When I tried to test this statement, i found, we can insert data with
 TTL greater than default_time_to_live. Is the document needs correction, or
 am I mis-understanding it?

 CREATE TABLE test (

 name text PRIMARY KEY,

 description text

 ) WITH bloom_filter_fp_chance = 0.01

 AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}

 AND comment = ''

 AND compaction = {'class': 'org.apache.cassandra.db.compa
 ction.SizeTieredCompactionStrategy', 'max_threshold': '32',
 'min_threshold': '4'}

 AND compression = {'chunk_length_in_kb': '64', 'class': '
 org.apache.cassandra.io.compress.LZ4Compressor'}

 AND crc_check_chance = 1.0

 AND dclocal_read_repair_chance = 0.1

 AND default_time_to_live = 240

 AND gc_grace_seconds = 864000

 AND max_index_interval = 2048

 AND memtable_flush_period_in_ms = 0

 AND min_index_interval = 128

 AND read_repair_chance = 0.0

 AND speculative_retry = '99PERCENTILE';

 insert into test (name, description) values ('name5', 'name
 description5') using ttl 360;

 select * from test ;


  name  | description

 ---+---

  name5 | name description5


 SELECT TTL (description) from test;


  ttl(description)

 --

  351

 Can someone please clear this for me?






>>>
>>
>


Re: default_time_to_live vs TTL on insert statement

2018-07-11 Thread kurt greaves
The Datastax documentation is wrong. It won't error, and it shouldn't. If
you want to fix that documentation I suggest contacting Datastax.

On 11 July 2018 at 19:56, Nitan Kainth  wrote:

> Hi DuyHai,
>
> Could you please explain in what case C* will error based on documented
> statement:
>
> You can set a default TTL for an entire table by setting the table's
> default_time_to_live
> 
>  property. If you try to set a TTL for a specific column that is longer
> than the time defined by the table TTL, Cassandra returns an error.
>
>
>
> On Wed, Jul 11, 2018 at 2:34 PM, DuyHai Doan  wrote:
>
>> default_time_to_live
>> 
>>  property applies if you don't specify any TTL on your CQL statement
>>
>> However you can always override the default_time_to_live
>> 
>>  property by specifying a custom value for each CQL statement
>>
>> The behavior is correct, nothing wrong here
>>
>> On Wed, Jul 11, 2018 at 7:31 PM, Nitan Kainth 
>> wrote:
>>
>>> Hi,
>>>
>>> As per document: https://docs.datastax.com/en/cql/3.3/cql/cql_using
>>> /useExpireExample.html
>>>
>>>
>>>-
>>>
>>>You can set a default TTL for an entire table by setting the table's
>>>default_time_to_live
>>>
>>> 
>>> property. If you try to set a TTL for a specific column that is
>>>longer than the time defined by the table TTL, Cassandra returns an 
>>> error.
>>>
>>>
>>> When I tried to test this statement, i found, we can insert data with
>>> TTL greater than default_time_to_live. Is the document needs correction, or
>>> am I mis-understanding it?
>>>
>>> CREATE TABLE test (
>>>
>>> name text PRIMARY KEY,
>>>
>>> description text
>>>
>>> ) WITH bloom_filter_fp_chance = 0.01
>>>
>>> AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>>>
>>> AND comment = ''
>>>
>>> AND compaction = {'class': 'org.apache.cassandra.db.compa
>>> ction.SizeTieredCompactionStrategy', 'max_threshold': '32',
>>> 'min_threshold': '4'}
>>>
>>> AND compression = {'chunk_length_in_kb': '64', 'class': '
>>> org.apache.cassandra.io.compress.LZ4Compressor'}
>>>
>>> AND crc_check_chance = 1.0
>>>
>>> AND dclocal_read_repair_chance = 0.1
>>>
>>> AND default_time_to_live = 240
>>>
>>> AND gc_grace_seconds = 864000
>>>
>>> AND max_index_interval = 2048
>>>
>>> AND memtable_flush_period_in_ms = 0
>>>
>>> AND min_index_interval = 128
>>>
>>> AND read_repair_chance = 0.0
>>>
>>> AND speculative_retry = '99PERCENTILE';
>>>
>>> insert into test (name, description) values ('name5', 'name
>>> description5') using ttl 360;
>>>
>>> select * from test ;
>>>
>>>
>>>  name  | description
>>>
>>> ---+---
>>>
>>>  name5 | name description5
>>>
>>>
>>> SELECT TTL (description) from test;
>>>
>>>
>>>  ttl(description)
>>>
>>> --
>>>
>>>  351
>>>
>>> Can someone please clear this for me?
>>>
>>>
>>>
>>>
>>>
>>>
>>
>


Re: default_time_to_live vs TTL on insert statement

2018-07-11 Thread Nitan Kainth
Hi DuyHai,

Could you please explain in what case C* will error based on documented
statement:

You can set a default TTL for an entire table by setting the table's
default_time_to_live

 property. If you try to set a TTL for a specific column that is longer
than the time defined by the table TTL, Cassandra returns an error.



On Wed, Jul 11, 2018 at 2:34 PM, DuyHai Doan  wrote:

> default_time_to_live
> 
>  property applies if you don't specify any TTL on your CQL statement
>
> However you can always override the default_time_to_live
> 
>  property by specifying a custom value for each CQL statement
>
> The behavior is correct, nothing wrong here
>
> On Wed, Jul 11, 2018 at 7:31 PM, Nitan Kainth 
> wrote:
>
>> Hi,
>>
>> As per document: https://docs.datastax.com/en/cql/3.3/cql/cql_
>> using/useExpireExample.html
>>
>>
>>-
>>
>>You can set a default TTL for an entire table by setting the table's
>>default_time_to_live
>>
>> 
>> property. If you try to set a TTL for a specific column that is
>>longer than the time defined by the table TTL, Cassandra returns an error.
>>
>>
>> When I tried to test this statement, i found, we can insert data with TTL
>> greater than default_time_to_live. Is the document needs correction, or am
>> I mis-understanding it?
>>
>> CREATE TABLE test (
>>
>> name text PRIMARY KEY,
>>
>> description text
>>
>> ) WITH bloom_filter_fp_chance = 0.01
>>
>> AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>>
>> AND comment = ''
>>
>> AND compaction = {'class': 'org.apache.cassandra.db.compa
>> ction.SizeTieredCompactionStrategy', 'max_threshold': '32',
>> 'min_threshold': '4'}
>>
>> AND compression = {'chunk_length_in_kb': '64', 'class': '
>> org.apache.cassandra.io.compress.LZ4Compressor'}
>>
>> AND crc_check_chance = 1.0
>>
>> AND dclocal_read_repair_chance = 0.1
>>
>> AND default_time_to_live = 240
>>
>> AND gc_grace_seconds = 864000
>>
>> AND max_index_interval = 2048
>>
>> AND memtable_flush_period_in_ms = 0
>>
>> AND min_index_interval = 128
>>
>> AND read_repair_chance = 0.0
>>
>> AND speculative_retry = '99PERCENTILE';
>>
>> insert into test (name, description) values ('name5', 'name
>> description5') using ttl 360;
>>
>> select * from test ;
>>
>>
>>  name  | description
>>
>> ---+---
>>
>>  name5 | name description5
>>
>>
>> SELECT TTL (description) from test;
>>
>>
>>  ttl(description)
>>
>> --
>>
>>  351
>>
>> Can someone please clear this for me?
>>
>>
>>
>>
>>
>>
>


Re: default_time_to_live vs TTL on insert statement

2018-07-11 Thread DuyHai Doan
default_time_to_live

 property applies if you don't specify any TTL on your CQL statement

However you can always override the default_time_to_live

 property by specifying a custom value for each CQL statement

The behavior is correct, nothing wrong here

On Wed, Jul 11, 2018 at 7:31 PM, Nitan Kainth  wrote:

> Hi,
>
> As per document: https://docs.datastax.com/en/cql/3.3/cql/
> cql_using/useExpireExample.html
>
>
>-
>
>You can set a default TTL for an entire table by setting the table's
>default_time_to_live
>
> 
> property. If you try to set a TTL for a specific column that is
>longer than the time defined by the table TTL, Cassandra returns an error.
>
>
> When I tried to test this statement, i found, we can insert data with TTL
> greater than default_time_to_live. Is the document needs correction, or am
> I mis-understanding it?
>
> CREATE TABLE test (
>
> name text PRIMARY KEY,
>
> description text
>
> ) WITH bloom_filter_fp_chance = 0.01
>
> AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
>
> AND comment = ''
>
> AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
> 'max_threshold': '32', 'min_threshold': '4'}
>
> AND compression = {'chunk_length_in_kb': '64', 'class': '
> org.apache.cassandra.io.compress.LZ4Compressor'}
>
> AND crc_check_chance = 1.0
>
> AND dclocal_read_repair_chance = 0.1
>
> AND default_time_to_live = 240
>
> AND gc_grace_seconds = 864000
>
> AND max_index_interval = 2048
>
> AND memtable_flush_period_in_ms = 0
>
> AND min_index_interval = 128
>
> AND read_repair_chance = 0.0
>
> AND speculative_retry = '99PERCENTILE';
>
> insert into test (name, description) values ('name5', 'name description5')
> using ttl 360;
>
> select * from test ;
>
>
>  name  | description
>
> ---+---
>
>  name5 | name description5
>
>
> SELECT TTL (description) from test;
>
>
>  ttl(description)
>
> --
>
>  351
>
> Can someone please clear this for me?
>
>
>
>
>
>


default_time_to_live vs TTL on insert statement

2018-07-11 Thread Nitan Kainth
Hi,

As per document:
https://docs.datastax.com/en/cql/3.3/cql/cql_using/useExpireExample.html


   -

   You can set a default TTL for an entire table by setting the table's
   default_time_to_live
   

property. If you try to set a TTL for a specific column that is longer
   than the time defined by the table TTL, Cassandra returns an error.


When I tried to test this statement, i found, we can insert data with TTL
greater than default_time_to_live. Is the document needs correction, or am
I mis-understanding it?

CREATE TABLE test (

name text PRIMARY KEY,

description text

) WITH bloom_filter_fp_chance = 0.01

AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}

AND comment = ''

AND compaction = {'class':
'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold': '32', 'min_threshold': '4'}

AND compression = {'chunk_length_in_kb': '64', 'class':
'org.apache.cassandra.io.compress.LZ4Compressor'}

AND crc_check_chance = 1.0

AND dclocal_read_repair_chance = 0.1

AND default_time_to_live = 240

AND gc_grace_seconds = 864000

AND max_index_interval = 2048

AND memtable_flush_period_in_ms = 0

AND min_index_interval = 128

AND read_repair_chance = 0.0

AND speculative_retry = '99PERCENTILE';

insert into test (name, description) values ('name5', 'name description5')
using ttl 360;

select * from test ;


 name  | description

---+---

 name5 | name description5


SELECT TTL (description) from test;


 ttl(description)

--

 351

Can someone please clear this for me?