zhangstar333 commented on code in PR #68028:
URL: https://github.com/apache/doris/pull/68028#discussion_r4023482341
##########
fe/fe-core/src/main/java/org/apache/doris/tablefunction/VectorSearchTableValuedFunction.java:
##########
@@ -77,12 +77,16 @@ private static PreparedSearch prepare(Map<String, String>
properties)
.setQueryVector(queryVector)
.setTopK(common.topK())
.setOffset(common.offset());
- if (params.containsKey(METRIC)) {
- vectorParams.setMetric(parseMetric(params.get(METRIC)));
- }
+ // Pin the planner's default on every split; Lance otherwise inherits
an index metric.
+ vectorParams.setMetric(params.containsKey(METRIC) ?
parseMetric(params.get(METRIC)) : TVectorMetric.L2);
+ LanceVectorQuery.validateMultiVectorBudget(queryVector, common.topK(),
common.offset(),
+ params.containsKey(REFINE_FACTOR) ?
parsePositiveInt(params.get(REFINE_FACTOR), REFINE_FACTOR) : 1);
+ if (queryVector.isSetNumVectors() && vectorParams.getMetric() ==
TVectorMetric.HAMMING) {
+ throw new AnalysisException("Lance multi-vector search supports
l2, cosine, and dot metrics");
+ }
TExternalSearchRequest searchRequest = new TExternalSearchRequest()
- .setSchemaVersion(1)
+ .setSchemaVersion(queryVector.isSetNumVectors() ? 2 : 1)
Review Comment:
no need change to version to 2 now
--
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]