You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu> on 2026/09/29 21:03:43 UTC

[XS] Change in asterixdb[master]: [NO ISSUE][COMP] Reword the vector distance warnings

From Calvin Thomas Dani <ca...@gmail.com>:

Calvin Thomas Dani has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21937?usp=email )


Change subject: [NO ISSUE][COMP] Reword the vector distance warnings
......................................................................

[NO ISSUE][COMP] Reword the vector distance warnings

Name the arguments arrays, the SQL++ term, rather than lists, and
report a NaN distance with the same message as the length check.

Generated-by: Claude Opus 5.5 <no...@anthropic.com>
Change-Id: I882a82131f0222984ea52f41f9f1341f63371be0
---
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/vector/VectorDistanceScalarEvaluator.java
1 file changed, 3 insertions(+), 2 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/37/21937/1

diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/vector/VectorDistanceScalarEvaluator.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/vector/VectorDistanceScalarEvaluator.java
index 91349f8..846161f 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/vector/VectorDistanceScalarEvaluator.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/vector/VectorDistanceScalarEvaluator.java
@@ -137,7 +137,7 @@
             if (listAccessorLeft.size() != listAccessorRight.size() || listAccessorLeft.size() == 0
                     || listAccessorRight.size() == 0) {
                 ExceptionUtil.warnFunctionEvalFailed(ctx, sourceLoc, funcId,
-                        "vector distance expects equal-length non-empty lists");
+                        "vector distance expects equal-length non-empty arrays");
                 PointableHelper.setNull(result);
                 return;
             }
@@ -152,7 +152,8 @@
             double distanceCal = distanceFunc.applyAsDouble(vectorArgsLeft, vectorArgsRight);
 
             if (Double.isNaN(distanceCal)) {
-                ExceptionUtil.warnFunctionEvalFailed(ctx, sourceLoc, funcId, "distance computed to NaN");
+                ExceptionUtil.warnFunctionEvalFailed(ctx, sourceLoc, funcId,
+                        "vector distance expects equal-length non-empty arrays");
                 PointableHelper.setNull(result);
                 return;
             }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21937?usp=email
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I882a82131f0222984ea52f41f9f1341f63371be0
Gerrit-Change-Number: 21937
Gerrit-PatchSet: 1
Gerrit-Owner: Calvin Thomas Dani <ca...@gmail.com>