aweisberg commented on code in PR #2049:
URL: https://github.com/apache/cassandra/pull/2049#discussion_r1063735669


##########
src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java:
##########
@@ -579,6 +775,43 @@ private static boolean mapAppliesTo(MapType<?, ?> type, 
Iterator<Cell<?>> iter,
             // they're equal
             return operator == Operator.EQ || operator == Operator.LTE || 
operator == Operator.GTE;
         }
+
+        @Override
+        protected BoundKind kind()
+        {
+            return BoundKind.MULTI_CELL_COLLECTION;
+        }
+
+        private static final BoundSerializer<MultiCellCollectionBound> 
serializer = new BoundSerializer<MultiCellCollectionBound>()
+        {
+            @Override
+            public void serialize(MultiCellCollectionBound bound, 
DataOutputPlus out, int version) throws IOException
+            {
+                serializeList(bound.serializedValues().get(), out, version, 
vintNullableSerializer);
+            }
+
+            @Override
+            public MultiCellCollectionBound deserialize(DataInputPlus in, int 
version, ColumnMetadata column, Operator operator) throws IOException
+            {
+                List<ByteBuffer> values = deserializeList(in, version, 
vintNullableSerializer);
+                List<Terminal> terminals;
+                if (operator.isContains() || operator.isContainsKey())
+                {
+                    terminals = 
values.stream().map(Constants.Value::new).collect(toList());

Review Comment:
   Anyways this is what I did
   ```
                   int numTerminals = readCollectionSize(in, version);
                   List<Terminal> terminals = new ArrayList<>(numTerminals);
                   if (operator.isContains() || operator.isContainsKey())
                   {
                       for (int i = 0; i < numTerminals; i++)
                           terminals.add(new 
Constants.Value(vintNullableSerializer.deserialize(in, version)));
                   }
                   else
                   {
                       for (int i = 0; i < numTerminals; i++)
                           
terminals.add(deserializeCqlCollectionAsTerm(vintNullableSerializer.deserialize(in,
 version), column.type, ProtocolVersion.CURRENT));
                   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to