Copilot commented on code in PR #5895:
URL: https://github.com/apache/ignite-3/pull/5895#discussion_r2108819790


##########
modules/schema/src/main/java/org/apache/ignite/internal/schema/PartialBinaryTupleMatcher.java:
##########
@@ -151,25 +153,20 @@ private static int compareFieldValuePartially(
             int index
     ) {
         switch (typeSpec) {
-            case BYTE_ARRAY: {
-                partialTuple.seek(index);
+            case BYTE_ARRAY:
+                return compareAsBytes(partialTuple, tuple2, index);
 
-                int begin = partialTuple.begin();
-                int end = partialTuple.end();
-                int trimmedSize = Math.min(end - begin, 
partialTuple.byteBuffer().capacity() - begin);
+            case UUID:
+                return compareAsUuid(partialTuple, tuple2, index);
 
-                byte[] part = partialTuple.bytesValue(begin, begin + 
trimmedSize);
+            case STRING:
+                return compareAsString(partialTuple, tuple2, index, false);
 
-                byte[] cmp = getTrimmedBytes(tuple2, index, part.length);
+            case TIMESTAMP:
+                return compareAsTimestamp(partialTuple, tuple2, index);
 
-                return Arrays.compareUnsigned(part, cmp);
-            }
-            case STRING: {
-                return compareAsString(partialTuple, index, 
tuple2.stringValue(index), false);
-            }
-            default: {
+            default:
                 return 0;

Review Comment:
   The default branch returns 0 (equal) for unsupported type specs, which may 
mask errors. Consider throwing an exception or delegating to 
`compareFieldValue` to handle unexpected types explicitly.
   ```suggestion
                   throw new IllegalArgumentException("Unsupported ColumnType: 
" + typeSpec);
   ```



##########
modules/runner/build.gradle:
##########
@@ -266,6 +266,16 @@ tasks.register("runUpsertBenchmark", JavaExec) {
     enableAssertions = true
 }
 
+tasks.register("runTupleComparatorBenchmark", JavaExec) {

Review Comment:
   [nitpick] The new Gradle task lacks a `group` or `description`. Adding these 
improves discoverability and documentation within the build.
   ```suggestion
   tasks.register("runTupleComparatorBenchmark", JavaExec) {
       group = "Benchmarking"
       description = "Runs the Tuple Comparator Benchmark to measure tuple 
comparison performance."
   ```



##########
modules/binary-tuple/src/main/java/org/apache/ignite/internal/binarytuple/BinaryTupleParser.java:
##########
@@ -110,6 +114,15 @@ public ByteBuffer byteBuffer() {
         return buffer.slice().order(ORDER);
     }
 
+    /**
+     * Returns the original byte buffer associated with this parser.
+     *
+     * @return The original ByteBuffer object.

Review Comment:
   The Javadoc for `accessor()` incorrectly describes the return as a 
`ByteBuffer` instead of `ByteBufferAccessor`. Please update the comment to 
reflect the actual return type.
   ```suggestion
        * Returns the original byte buffer accessor associated with this parser.
        *
        * @return The original ByteBufferAccessor object.
   ```



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to