>From Ian Maxon <[email protected]>:

Attention is currently required from: Calvin Thomas Dani.

Ian Maxon has posted comments on this change by Calvin Thomas Dani. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21330?usp=email )

Change subject: [ASTERIXDB-3676] Vector Distance Functions
......................................................................


Patch Set 2:

(9 comments)

File 
asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/VectorDistanceSqlppExecutionTest.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21330/comment/f5200c78_701852af?usp=email
 :
PS2, Line 41:
            : public class VectorDistanceSqlppExecutionTest {
i don't understand why this class is added instead of just running the vector 
queries in the main sqlpp suite?


File 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/vector/VectorQueries.xml:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21330/comment/829dd691_57cd843f?usp=email
 :
PS2, Line 20: check-warnings="false"
why not check warnings?


File asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21330/comment/9f7fcd0f_f4fce6f3?usp=email
 :
PS2, Line 35: </test-suite>
the vector queries are mentioned as an entity, but not used. it should be both 
or neither.


File 
asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/BuiltinFunctions.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21330/comment/c1b5ce98_d6d55e69?usp=email
 :
PS2, Line 1933:  addFunction(DOT_DISTANCE_ARRAY, 
ADoubleTypeComputer.INSTANCE_NULLABLE, true);
dot isn't really a distance, is it? it's a similarity metric but not a 
distance, right?


File 
asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/hierachy/ATypeHierarchy.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21330/comment/de9d0531_792d603a?usp=email
 :
PS2, Line 150:
             :     public static ATypeTag getCommonNumericType(ATypeTag t1, 
ATypeTag t2) {
             :         if (t1 == t2) {
             :             return t1;
             :         }
             :         if (ATypeHierarchy.canPromote(t1, t2)) {
             :             return t2; // t2 is wider
             :         }
             :         if (ATypeHierarchy.canPromote(t2, t1)) {
             :             return t1; // t1 is wider
             :         }
             :         return ATypeTag.NULL; // or throw: incompatible types
             :     }
also unused


File 
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/vector/VectorDistanceArrScalarEvaluator.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21330/comment/c4f5604d_db93bc96?usp=email
 :
PS2, Line 253:             ExceptionUtil.warnUnsupportedType(ctx, sourceLoc, 
funcId.getName() + "()", leftArgType);
             :             ExceptionUtil.warnUnsupportedType(ctx, sourceLoc, 
funcId.getName() + "()", rightArgType);
why issue two warnings here, instead of one saying neither argument is a 
numeric list?


https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21330/comment/01fb68a0_387929e2?usp=email
 :
PS2, Line 410: org.apache.hyracks.api.exceptions
would be nicer to just import the class or static method instead of using the 
fully qualified name


File 
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/VectorDistanceArrCalculation.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21330/comment/a8b74f85_47e6b8f7?usp=email
 :
PS2, Line 144: manhattan
this method seems to not be used. are there no tests for manhattan? or is it 
not implemented?


https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21330/comment/724220ba_44acef6a?usp=email
 :
PS2, Line 171: return dot / (Math.sqrt(normA) * Math.sqrt(normB));
claude says this is similarity, not distance. a brief look at wikipedia seems 
to agree. why does this (and it's friends) not return 1-(A⋅B/(||A||||B||))? or 
should we rename it to similarity because that's what we need/use in most cases?



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

Gerrit-MessageType: comment
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: Ie085355b47ad09111dd444046b873b358ea4e30b
Gerrit-Change-Number: 21330
Gerrit-PatchSet: 2
Gerrit-Owner: Calvin Thomas Dani <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-CC: Ian Maxon <[email protected]>
Gerrit-Attention: Calvin Thomas Dani <[email protected]>
Gerrit-Comment-Date: Tue, 16 Jun 2026 22:39:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Reply via email to