dcapwell commented on code in PR #2310:
URL: https://github.com/apache/cassandra/pull/2310#discussion_r1192550703


##########
src/java/org/apache/cassandra/db/marshal/VectorType.java:
##########
@@ -0,0 +1,562 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.db.marshal;
+
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+import org.apache.cassandra.cql3.CQL3Type;
+import org.apache.cassandra.cql3.Term;
+import org.apache.cassandra.cql3.Vectors;
+import org.apache.cassandra.db.TypeSizes;
+import org.apache.cassandra.exceptions.InvalidRequestException;
+import org.apache.cassandra.serializers.MarshalException;
+import org.apache.cassandra.serializers.TypeSerializer;
+import org.apache.cassandra.transport.ProtocolVersion;
+import org.apache.cassandra.utils.ByteBufferUtil;
+import org.apache.cassandra.utils.JsonUtils;
+import org.apache.cassandra.utils.bytecomparable.ByteComparable;
+import org.apache.cassandra.utils.bytecomparable.ByteSource;
+
+public final class VectorType<T> extends AbstractType<List<T>>
+{
+    public final AbstractType<T> elementType;
+    public final int dimension;
+    protected final TypeSerializer<T> elementSerializer;
+    private final int valueLengthIfFixed;
+    private final VectorSerializer serializer;
+
+    private VectorType(AbstractType<T> elementType, int dimension)
+    {
+        super(ComparisonType.CUSTOM);

Review Comment:
   > We can use ComparisonType.BYTE_ORDER
   
   Nope, element types might not be byte ordered, and for variable length types 
you have the size prefix, which breaks ordering.   `DurationType` did the same, 
but had to be blocked everywhere ordering is done due to this class of bug =(
   
   The only way for that to work would be to have a more complex byte encoding, 
which would be a pain for client.  We would need to define a byte order 
encoding for all types, and deal with size not being a part of the ordering... 
pushing this complex to client I feel isn't the best when we can handle it with 
`ByteSource` and be more portable.



-- 
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