>From Ali Alsuliman <[email protected]>: Attention is currently required from: Calvin Thomas Dani, Ian Maxon.
Ali Alsuliman has posted comments on this change by Calvin Thomas Dani. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20126?usp=email ) Change subject: [ASTERIXDB-3676] Vector Distance Functions ...................................................................... Patch Set 34: (6 comments) File asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/BuiltinFunctions.java: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20126/comment/c0b5548f_b5439145?usp=email : PS30, Line 1930: addFunction(EUCLIDEAN_DISTANCE_ARRAY, ADoubleTypeComputer.INSTANCE_NULLABLE, true); > You should use `ADoubleTypeComputer.INSTANCE`. I initially had this comment, but I deleted it since it was wrong. Apparently, something went wrong and it was included in my comments. Please, use the type computer that you had before: ``` ADoubleTypeComputer.INSTANCE_NULLABLE ``` File asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/vector/VectorListDecoder.java: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20126/comment/578dcde4_36be26a8?usp=email : PS34, Line 74: if (derivedTypeTag == ATypeTag.ANY) { You don't have to do this check: `if (derivedTypeTag == ATypeTag.ANY) {`. You are getting each element with its type tag anyway (`listAccessor.getOrWriteItem(i, tempArrVal, storage);` always returns a tagged element). So, you could just do: ``` derivedTypeTag = ATYPETAGDESERIALIZER.deserialize(data[offset]); return getValueFromTag(derivedTypeTag, data, offset); ``` If an element is not a number, you will return NaN and then handle the NaN in the caller or something. That's also why we shouldn't throw the exception: ``` throw new TypeMismatchException(sourceLoc, derivedTypeTag.serialize(), ATypeTag.DOUBLE.serialize()); ``` https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20126/comment/4755917b_cb75eddc?usp=email : PS34, Line 80: throw new TypeMismatchException(sourceLoc, derivedTypeTag.serialize(), ATypeTag.DOUBLE.serialize()); We shouldn't throw an exception. We should return `NULL` and say that we are expecting a non-empty list of doubles. You already have some warnings that you could re-use. I will leave it to you how you structure it. https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20126/comment/144619c8_03f0d427?usp=email : PS34, Line 106: listAccessor.getOrWriteItem(0, this.tempArrVal, this.storage); We shouldn't rely on the first element. The rest could be non-numbers. What you could do is leave it to the `createArrayFromList()` that would detect if an element isn't a number. See my other related comments there. https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20126/comment/a4e41a37_cb6b15c3?usp=email : PS34, Line 120: public ATypeTag findFirstMismatchedAnyItemType(ListAccessor listAccessor, ATypeTag expectedItemTag) I don't see `findFirstMismatchedAnyItemType` being used. Remove it. File hyracks-fullstack/pom.xml: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20126/comment/092ae59e_e23d6a10?usp=email : PS34, Line 748: <exclude>**/target/**</exclude> What's the purpose of this? Remove it -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20126?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: I45176e7da13ed222f48bb36bd1f0ab4074a0bcb9 Gerrit-Change-Number: 20126 Gerrit-PatchSet: 34 Gerrit-Owner: Calvin Thomas Dani <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Ian Maxon <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Attention: Calvin Thomas Dani <[email protected]> Gerrit-Attention: Ian Maxon <[email protected]> Gerrit-Comment-Date: Mon, 29 Jun 2026 17:44:29 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: Ali Alsuliman <[email protected]>
