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

Stefan Miklosovic edited comment on CASSANDRA-17913 at 4/12/23 3:21 PM:
------------------------------------------------------------------------

I wrote [~masokol] privately and he agreed with myself finishing that.

PRs are here:

4.0 https://github.com/apache/cassandra/pull/2271
4.1 https://github.com/apache/cassandra/pull/2270
trunk https://github.com/apache/cassandra/pull/2272

There are subtle differences between all branches. In trunk, type is set in 
constructor but in 4.1 it is not. I extracted common logic to a method so there 
is not code duplication - in ElementSelector. I left changes in Selectable as 
they were originally introduced by Maciej. Classes in Selectable are just 
implementing Selectable, not an abstract class, and extracting that logic to 
that interface seems just strange.

I am building it as I write this.


was (Author: smiklosovic):
I wrote [~masokol] privately and he agreed with myself finishing that.

PRs are here:

4.0 https://github.com/apache/cassandra/pull/2271
4.1 https://github.com/apache/cassandra/pull/2270
trunk https://github.com/apache/cassandra/pull/2272

There are subtle differences between all branches. In trunk, type is set in 
constructor but in 4.1 it is not. I extracted common logic to a method so there 
is not code duplication - in ElementSelector. I left changes in Selectable as 
they were originally introduced by Maciej. Classes in Selectable are just 
implementing Selectable, not an abstract class, and extracting that logic to a 
interface seems just strange.

I am building it as I write this.

> Nested selection of reversed collections fails
> ----------------------------------------------
>
>                 Key: CASSANDRA-17913
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17913
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Consistency/Coordination, CQL/Semantics, Legacy/Local 
> Write-Read Paths
>            Reporter: David Capwell
>            Assignee: Maciej Sokol
>            Priority: Normal
>             Fix For: 4.0.x, 4.1.x
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The following test fails caused by the fact we make reversed a type that 
> wraps the underline type
> {code:java}
> @Test
>     public void testMapsReversed() throws Throwable
>     {
>         createTable("CREATE TABLE %s (" +
>                     "   k int, " +
>                     "   c frozen<map<text, int>>, " +
>                     "   v int, " +
>                     "   PRIMARY KEY(k, c)" +
>                     ") WITH CLUSTERING ORDER BY (c DESC)");
>         execute("SELECT c['testing'] FROM %s");
>     }
> {code}
> With the error
> {code:java}
> org.apache.cassandra.exceptions.InvalidRequestException: Invalid element 
> selection: c is of type frozen<map<text, int>> is not a collection
> {code}
> When you look in a debugger you see that the real type is 
> ReversedType(MapType(…)), so the current checks fail.
> {+}Additional information for newcomers{+}:
>  * The problem impact element selection as well as range selection that where 
> introduced in CASSANDRA-7396 as part of 4.0. So the patch will need to be 
> done for 4.0.
>  * The checks that needs to be modified is in 
> {{Selectable.WithElementSelection}} and {{Selectable.WithSliceSelection}}
>  * The unit tests should be added to {{CollectionsTest}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to