SiyaoIsHiding commented on code in PR #1952:
URL: 
https://github.com/apache/cassandra-java-driver/pull/1952#discussion_r1877630834


##########
core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/VectorCodec.java:
##########
@@ -156,4 +116,195 @@ public CqlVector<SubtypeT> parse(@Nullable String value) {
         ? null
         : CqlVector.from(value, this.subtypeCodec);
   }
+
+  private static class FixedLength<SubtypeT> implements 
VectorCodecProxy<SubtypeT> {
+    private final VectorType cqlType;
+    private final TypeCodec<SubtypeT> subtypeCodec;
+
+    private FixedLength(VectorType cqlType, TypeCodec<SubtypeT> subtypeCodec) {
+      this.cqlType = cqlType;
+      this.subtypeCodec = subtypeCodec;
+    }
+
+    @Override
+    public ByteBuffer encode(
+        @Nullable CqlVector<SubtypeT> value, @NonNull ProtocolVersion 
protocolVersion) {
+      if (value == null || cqlType.getDimensions() <= 0) {
+        return null;
+      }
+      ByteBuffer[] valueBuffs = new ByteBuffer[cqlType.getDimensions()];

Review Comment:
   If we want to improve encoding performance of vector<float> according to 
[CASSJAVA-60](https://issues.apache.org/jira/browse/CASSJAVA-60), we have to 
handle it as an exception here. cc @absurdfarce 



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