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


##########
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/select/Select.java:
##########
@@ -146,6 +147,16 @@ default Select orderBy(@NonNull String columnName, 
@NonNull ClusteringOrder orde
     return orderBy(CqlIdentifier.fromCql(columnName), order);
   }
 
+  /**
+   * Shortcut for {@link #orderByAnnOf(CqlIdentifier, CqlVector)}, adding an 
ORDER BY ... ANN OF ...
+   * clause
+   */
+  @NonNull
+  Select orderByAnnOf(@NonNull String columnName, @NonNull CqlVector<? extends 
Number> ann);
+
+  /** Adds the ORDER BY ... ANN OF ... clause */
+  @NonNull
+  Select orderByAnnOf(@NonNull CqlIdentifier columnId, @NonNull CqlVector<? 
extends Number> ann);

Review Comment:
   Getting back to this conversation because the current implementation will 
result in a compilation error when we extend vector support to arbitrary 
subtype. 
   ```java
     public Select orderByAnnOf(@NonNull CqlIdentifier columnId, @NonNull 
CqlVector<?> ann) {
       return withAnn(new Ann(columnId, ann));
     }
   ```
   The argument we get is a `CqlVector<?>` , but the `Ann` constructor wants a 
`CqlVector<? extends Number>`. Turns out compilation error.
   We either:
   1. change Ann constructor to `CqlVector<?>`, or
   2. change `orderByAnnOf` API to `CqlVector<? extends Number>`. 
   
   I think option 2 makes more sense.



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to