Copilot commented on code in PR #13229:
URL: https://github.com/apache/gravitino/pull/13229#discussion_r4026142865


##########
api/src/main/java/org/apache/gravitino/rel/expressions/literals/Literals.java:
##########
@@ -288,13 +289,28 @@ public boolean equals(Object o) {
       if (value == null || literal.value == null) {
         return Objects.equals(value, literal.value);
       }
+      // Arrays need structural comparison: Objects.equals is reference 
equality for arrays and
+      // the toString() fallback below renders identity hashes, so 
equal-content binary and array
+      // literals would never compare equal.
+      if (value instanceof byte[] && literal.value instanceof byte[]) {
+        return Arrays.equals((byte[]) value, (byte[]) literal.value);
+      }
+      if (value instanceof Object[] && literal.value instanceof Object[]) {
+        return Arrays.deepEquals((Object[]) value, (Object[]) literal.value);

Review Comment:
   The new `Object[]` equality/hash-code path is not covered by the added test, 
which only exercises `byte[]`. Add a focused case for equal and unequal object 
arrays, including a nested array if this branch is intended to rely on 
`deepEquals`/`deepHashCode`, so regressions in this newly introduced behavior 
are caught.



-- 
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]

Reply via email to