[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-05-18 Thread Yifan Cai (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17538984#comment-17538984
 ] 

Yifan Cai commented on CASSANDRA-17425:
---

Starting commit

CI Results (pending):
||Branch||Source||Circle CI|
|trunk|[branch|https://github.com/yifan-c/cassandra/tree/commit_remote_branch/CASSANDRA-17425-trunk-FEC2BE68-E64B-4325-BDAF-A5A964613B5C]|[build|https://app.circleci.com/pipelines/github/yifan-c/cassandra?branch=commit_remote_branch%2FCASSANDRA-17425-trunk-FEC2BE68-E64B-4325-BDAF-A5A964613B5C]|


> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-05-17 Thread Jira


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17538373#comment-17538373
 ] 

Andres de la Peña commented on CASSANDRA-17425:
---

Looks good to me, +1. We'd need a final CI run for the last changes, since they 
involve cqlsh.

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-05-17 Thread Yifan Cai (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17538318#comment-17538318
 ] 

Yifan Cai commented on CASSANDRA-17425:
---

Right on. I just pushed a new commit to mention the new function in the 
relevant .adoc and .py files. 

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-05-17 Thread Jira


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17538091#comment-17538091
 ] 

Andres de la Peña commented on CASSANDRA-17425:
---

Good catch on detecting that the new keyword should be unreserved. I think we 
also have to add it to cqlsh, 
[here|https://github.com/yifan-c/cassandra/blob/1ad8bf67a9c82cbb5ff38e5cf785f9fe2516d009/pylib/cqlshlib/cql3handling.py#L733-L734].

We should also update the documentation to mention the new function, around 
[here|https://github.com/apache/cassandra/blob/70c77ebadf245bafd7633bac8dc90e9a45bf1924/doc/modules/cassandra/pages/cql/dml.adoc#writetime-and-ttl-function],
 
[here|https://github.com/apache/cassandra/blob/70c77ebadf245bafd7633bac8dc90e9a45bf1924/doc/modules/cassandra/pages/cql/appendices.adoc#appendices],
 and a few other mentions of the {{WRITETIME}} function. 

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-05-16 Thread Yifan Cai (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17537642#comment-17537642
 ] 

Yifan Cai commented on CASSANDRA-17425:
---

Started pre-commit CI: 

j11: 
[https://app.circleci.com/pipelines/github/yifan-c/cassandra/347/workflows/7e66281e-6309-42a8-bc44-d00f0f0a8a9b]
j8: 
[https://app.circleci.com/pipelines/github/yifan-c/cassandra/347/workflows/1274f8b6-560b-4c3e-96ec-a833868246fc]

 

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-05-16 Thread Jira


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17537456#comment-17537456
 ] 

Andres de la Peña commented on CASSANDRA-17425:
---

Changes look good to me, do we have a CI run after the last changes?

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
> Fix For: 4.x
>
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-04-28 Thread Francisco Guerrero (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17529608#comment-17529608
 ] 

Francisco Guerrero commented on CASSANDRA-17425:


Looks good to me. I've left a couple of comments that have already been 
addressed. +1

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-04-22 Thread Yifan Cai (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17526743#comment-17526743
 ] 

Yifan Cai commented on CASSANDRA-17425:
---

I rebased my patch on trunk and created a new PR: 
[https://github.com/apache/cassandra/pull/1584]

CI: 
[https://app.circleci.com/pipelines/github/yifan-c/cassandra?branch=CASSANDRA-17425%2Ftrunk-new=all]

There are 2 commits. The first commit is the rebased original implementation. 
The second and optional commit implements the function based on WritetimeOrTTL. 
[~adelapena], can you review next week? 

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-03-18 Thread Yifan Cai (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17508970#comment-17508970
 ] 

Yifan Cai commented on CASSANDRA-17425:
---

Sounds great! I will sign up for reviewing :D

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-03-18 Thread Jira


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17508967#comment-17508967
 ] 

Andres de la Peña commented on CASSANDRA-17425:
---

Hi [~yifanc] I was planning on updating the old patch for CASSANDRA-8877 
immediately after [~blerer] 's patch for CASSANDRA-11871, which probably would 
be ready for review very soon.

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-03-18 Thread Yifan Cai (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17508963#comment-17508963
 ] 

Yifan Cai commented on CASSANDRA-17425:
---

bq. selectors can be chained and used to reduce the selection.

Good point. The patch does not handle the chained selector for collections and 
UDT. So it is incomplete in terms of semantics. And I agree that it should be 
implemented. 

Hi [~adelapena], it looks like that your patch already defines the syntax 
handling for the chained selectors. I think this logic is reused for 
'maxTimestamp'. Do you plan to work on the patch for CASSANDRA-8877 any time 
soon? If not, do you mind if I jump in? 

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-03-18 Thread Jira


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17508787#comment-17508787
 ] 

Andres de la Peña commented on CASSANDRA-17425:
---

Agree, that patch was able to do things like:
{code:java}
CREATE TABLE IF NOT EXISTS t (k int PRIMARY KEY, s set);
INSERT INTO t (k, s) VALUES (1, {1, 2}) USING TIMESTAMP 100 AND TTL 1;
UPDATE t USING TIMESTAMP 200 AND TTL 2 SET s += {3} WHERE k=1;

SELECT s[2..], WRITETIME(s[2..]), TTL(s[2..]) FROM t;

 s[2..] | writetime(s[2..]) | ttl(s[2..])
+---+
 {2, 3} |[100, 200] | [1, 2]
{code}
I also think that doing MaxWritetime on top of CASSANDRA-8877 would be the 
easier and most flexible approach.

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-03-18 Thread Benjamin Lerer (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17508758#comment-17508758
 ] 

Benjamin Lerer commented on CASSANDRA-17425:


{quote}I do not have objections on extending 'writetime' and 'tty' functions to 
support multi-cell types, although I do doubt how practical it is to return the 
timestamps/TTLs of the entire collection. {quote}
It is a feature that I have seen requested quite often.


{quote}Do you have an ETA on when your patch will land?{quote}
Today or Monday

I had a quick look at the patch that we made for CASSANDRA-8877. It made me 
realized that even for {{maxWritetime}} the situation is may be more 
complicated than it looks at first glance. We apparently have ignored for 
{{writetime}} and {{ttl}} the fact that selectors can be chained and used to 
reduce the selection.
For example:
{code}
SELECT writetime(myMap['second'..'third']), ttl(myUdt.myFirstField) FROM myTable
{code}
The same problem will apply to {{maxTimestamp}} if I am not mistaken.
 



> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-03-11 Thread Yifan Cai (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17505119#comment-17505119
 ] 

Yifan Cai commented on CASSANDRA-17425:
---

I do not have objections on extending 'writetime' and 'tty' functions to 
support multi-cell types, although I do doubt how practical it is to return the 
timestamps/TTLs of the entire collection. 

As said, the new function proposed is _different_ from 'writetime'. The goal is 
to allow end-user to quickly tell the latest modification time of a column, 
regardless of a single-cell or multi-cell.
Implementation-wise, I could just modify the 'WritetimeOrTTLSelector' to 
implement. But a new implementation is add instead, since I think we will be 
benefit from separating out the responsibility from the perspective of 
maintenance. 
On the other hand, Cassandra has function variants. For example, 'timeuuid' and 
its variants, ['minTimeuuid' and 'maxTimeuuid' 
|https://cassandra.apache.org/doc/trunk/cassandra/cql/cql_singlefile.html#mintimeuuid-and-maxtimeuuid].

bq. I would prefer to wait a bit for it because I have some significant changes 
coming in this area for CASSANDRA-11871.
Do you have an ETA on when your patch will land? This patch is relatively 
simple and isolated. Even if we merge it ahead, I guess it should not be a 
troublesome conflict. Maybe I was wrong? 

At the end, appreciate all discussions. 

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-03-11 Thread Jira


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17504989#comment-17504989
 ] 

Andres de la Peña commented on CASSANDRA-17425:
---

Indeed I have an old patch for CASSANDRA-8877 allowing to do things like:
{code}
CREATE TABLE IF NOT EXISTS t (k int PRIMARY KEY, s set);
INSERT INTO t (k, s) VALUES (1, {1, 2}) USING TIMESTAMP 100 AND TTL 1;
UPDATE t USING TIMESTAMP 200 AND TTL 2 SET s += {3} WHERE k=1;

SELECT s, WRITETIME(s), TTL(s) FROM t;

 s | writetime(s)| ttl(s)
---+-+---
 {1, 2, 3} | [100, 100, 200] | [1, 1, 2]


SELECT s[2], WRITETIME(s[2]), TTL(s[2]) FROM t;

 s[2] | writetime(s[2]) | ttl(s[2])
--+-+---
2 | 100 | 1
{code}
It returns lists of timestamps/ttls for multi-cell columns, so one could apply 
a function to the results. I could undust that patch, although it is relatively 
large and quite old, so I'd take me some time.
 

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-03-11 Thread Benjamin Lerer (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17504847#comment-17504847
 ] 

Benjamin Lerer commented on CASSANDRA-17425:


{quote}
It is different from CASSANDRA-8877, which is to retrieve the timestamp of one 
cell from a multi-cell type and end-user cannot tell if the retrieved timestamp 
is the latest.
{quote}

There were 2 parts to CASSANDRA-8877 as [~slebresne] pointed out. One was about 
allowing to select an element of the collection which has been implemented as 
part of CASSANDRA-7396 (not for list through). The other part was about what we 
should return when we use {{writetime}} or {{ttl}} on a multi-cell collection. 
Should we return a list of timestamps/ttls? In my opinion that is probably what 
we should do (I believe that [~adelapena] has a patch for that. It might need 
to be reworked a bit.)
Adding a {{maxtimestamp}} and a {{minttl}} function will probably  be much 
easier at that point as it should be possible to implement it by only modifying 
 {{WritetimeOrTTLSelector}}.

{quote}I can see the concerns when I was working on the patch. It feels like 
the selector framework needs some refactor, which I did not do in this 
patch.{quote}

I woud prefer to wait a bit for it because I have some significant changes 
coming in this area for CASSANDRA-11871.

Nevertheless, if you have some ideas I am really interested to hear them. 


  

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-03-10 Thread Yifan Cai (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17504483#comment-17504483
 ] 

Yifan Cai commented on CASSANDRA-17425:
---

Hi Benjamin, the goal of this patch is to add a function to retrieve the latest 
modification time of a multi-cell type. It is different from CASSANDRA-8877, 
which is to retrieve the timestamp of _one_ cell from a multi-cell type and 
end-user cannot tell if the retrieved timestamp is the latest. 

bq. I am always a bit reluctant to add new selectors as I often had to modify 
all of them to introduce new features.
I can see the concerns when I was working on the patch. It feels like the 
selector framework needs some refactor, which I did not do in this patch. We 
can look more closely at the patch and only commit when the majority is happy 
with changes. 

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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



[jira] [Commented] (CASSANDRA-17425) Add new CQL function maxWritetime

2022-03-10 Thread Benjamin Lerer (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-17425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17504230#comment-17504230
 ] 

Benjamin Lerer commented on CASSANDRA-17425:


[~yifanc] I am not against this functionality but is it not a work around. 
Would we need this functionality if CASSANDRA-8877 was fixed?
I am always a bit relunctant to add new selectors as I often had to modify all 
of them to introduce new features. 

> Add new CQL function maxWritetime
> -
>
> Key: CASSANDRA-17425
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17425
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL/Syntax
>Reporter: Yifan Cai
>Assignee: Yifan Cai
>Priority: Normal
>
> The function "writetime" does not support multi-cell types, e.g. collections 
> and UDT. It would be useful to enable querying the latest modified timestamp 
> of a column value. 
> I'd like to propose to add a new function named "maxWritetime", which returns 
> the largest timestamp amongst the cells. When being applied to the single 
> cell types, it returns the same result as "writetime".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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