Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
4.0.10, 4.1.2, 5.0-alpha1, 5.0
-
None
-
Correctness - Unrecoverable Corruption / Loss
-
Normal
-
Normal
-
Fuzz Test
-
All
-
None
-
Description
The following test fails caused by the fact we make reversed a type that wraps the underline type
@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"); }
With the error
org.apache.cassandra.exceptions.InvalidRequestException: Invalid element selection: c is of type frozen<map<text, int>> is not a collection
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-7396as 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