xiangfu0 commented on code in PR #18952:
URL: https://github.com/apache/pinot/pull/18952#discussion_r3556112414


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/columnminmaxvalue/ColumnMinMaxValueGenerator.java:
##########
@@ -365,21 +365,21 @@ private void 
addColumnMinMaxValueWithoutDictionary(ColumnMetadata columnMetadata
           if (isSingleValue) {
             for (int docId = 0; docId < numDocs; docId++) {
               byte[] value = rawIndexReader.getBytes(docId, readerContext);
-              if (min == null || ByteArray.compare(value, min) > 0) {
+              if (min == null || ByteArray.compare(value, min) < 0) {
                 min = value;
               }
-              if (max == null || ByteArray.compare(value, max) < 0) {
+              if (max == null || ByteArray.compare(value, max) > 0) {
                 max = value;

Review Comment:
   Fixed in 98b3f4ffae. The BYTES path now passes null through to 
`addColumnMinMaxValueInfo`, matching the other stored types so an empty segment 
is marked `MIN_MAX_VALUE_INVALID`. Added `testEmptyRawBytesMarksMinMaxInvalid` 
to cover the zero-document case.



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