emkornfield commented on code in PR #3243:
URL: https://github.com/apache/parquet-java/pull/3243#discussion_r2145643450


##########
parquet-column/src/main/java/org/apache/parquet/schema/PrimitiveComparator.java:
##########
@@ -206,6 +206,31 @@ public String toString() {
         }
       };
 
+  /*
+   * This comparator is for comparing two timestamps represented as int96 
binary.
+   */
+  static final PrimitiveComparator<Binary> BINARY_AS_INT_96_COMPARATOR = new 
BinaryComparator() {
+    @Override
+    int compareBinary(Binary b1, Binary b2) {
+      ByteBuffer bb1 = b1.toByteBuffer();
+      ByteBuffer bb2 = b2.toByteBuffer();
+      bb1.order(java.nio.ByteOrder.LITTLE_ENDIAN);
+      bb2.order(java.nio.ByteOrder.LITTLE_ENDIAN);
+      int jd1 = bb1.getInt(8);
+      int jd2 = bb2.getInt(8);
+      if (jd1 != jd2) return Integer.compareUnsigned(jd1, jd2) < 0 ? -1 : 1;

Review Comment:
   Never mind, I think this is actually counting from something pre-year 1.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to