You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Mark Furlong <mf...@ancestry.com> on 2019/12/03 16:02:04 UTC

TTL on UDT

When I run the command 'select ttl(udt_field) from table; I'm getting an error 'InvalidRequest: Error from server: code=2200 [Invalid query] message="Cannot use selection function ttl on collections"'. How can I get the TTL from a UDT field?

Mark Furlong


[cid:image001.png@01D5A920.52B244C0]
We empower journeys of personal discovery to enrich lives



Re: TTL on UDT

Posted by Carl Mueller <ca...@smartthings.com.INVALID>.
Oh right frozen vs unfrozen.

On Mon, Dec 9, 2019 at 2:23 PM DuyHai Doan <do...@gmail.com> wrote:

> It depends on.. Latest version of Cassandra allows unfrozen UDT. The
> individual fields of UDT are updated atomically and they are stored
> effectively in distinct physical columns inside the partition, thus
> applying ttl() on them makes sense. I'm not sure however if the CQL parser
> allows this syntax
>
> On Mon, Dec 9, 2019 at 9:13 PM Carl Mueller
> <ca...@smartthings.com.invalid> wrote:
>
>> I could be wrong, but UDTs I think are written (and overwritten) as one
>> unit, so the notion of a TTL on a UDT field doesn't exist, the TTL is
>> applied to the overall structure.
>>
>> Think of it like a serialized json object with multiple fields. To update
>> a field they deserialize the json, then reserialize the json with the new
>> value, and the whole json object has the new timestamp or ttl.
>>
>> On Tue, Dec 3, 2019 at 10:02 AM Mark Furlong <mf...@ancestry.com>
>> wrote:
>>
>>> When I run the command ‘select ttl(udt_field) from table; I’m getting an
>>> error ‘InvalidRequest: Error from server: code=2200 [Invalid query]
>>> message="Cannot use selection function ttl on collections"’. How can I get
>>> the TTL from a UDT field?
>>>
>>>
>>>
>>> *Mark Furlong*
>>>
>>>
>>>
>>>
>>>
>>> We empower journeys of personal discovery to enrich lives
>>>
>>>
>>>
>>>
>>>
>>

Re: TTL on UDT

Posted by DuyHai Doan <do...@gmail.com>.
It depends on.. Latest version of Cassandra allows unfrozen UDT. The
individual fields of UDT are updated atomically and they are stored
effectively in distinct physical columns inside the partition, thus
applying ttl() on them makes sense. I'm not sure however if the CQL parser
allows this syntax

On Mon, Dec 9, 2019 at 9:13 PM Carl Mueller
<ca...@smartthings.com.invalid> wrote:

> I could be wrong, but UDTs I think are written (and overwritten) as one
> unit, so the notion of a TTL on a UDT field doesn't exist, the TTL is
> applied to the overall structure.
>
> Think of it like a serialized json object with multiple fields. To update
> a field they deserialize the json, then reserialize the json with the new
> value, and the whole json object has the new timestamp or ttl.
>
> On Tue, Dec 3, 2019 at 10:02 AM Mark Furlong <mf...@ancestry.com>
> wrote:
>
>> When I run the command ‘select ttl(udt_field) from table; I’m getting an
>> error ‘InvalidRequest: Error from server: code=2200 [Invalid query]
>> message="Cannot use selection function ttl on collections"’. How can I get
>> the TTL from a UDT field?
>>
>>
>>
>> *Mark Furlong*
>>
>>
>>
>>
>>
>> We empower journeys of personal discovery to enrich lives
>>
>>
>>
>>
>>
>

Re: TTL on UDT

Posted by Carl Mueller <ca...@smartthings.com.INVALID>.
I could be wrong, but UDTs I think are written (and overwritten) as one
unit, so the notion of a TTL on a UDT field doesn't exist, the TTL is
applied to the overall structure.

Think of it like a serialized json object with multiple fields. To update a
field they deserialize the json, then reserialize the json with the new
value, and the whole json object has the new timestamp or ttl.

On Tue, Dec 3, 2019 at 10:02 AM Mark Furlong <mf...@ancestry.com> wrote:

> When I run the command ‘select ttl(udt_field) from table; I’m getting an
> error ‘InvalidRequest: Error from server: code=2200 [Invalid query]
> message="Cannot use selection function ttl on collections"’. How can I get
> the TTL from a UDT field?
>
>
>
> *Mark Furlong*
>
>
>
>
>
> We empower journeys of personal discovery to enrich lives
>
>
>
>
>