cecemei commented on code in PR #18541:
URL: https://github.com/apache/druid/pull/18541#discussion_r2396152630


##########
processing/src/main/java/org/apache/druid/segment/nested/StructuredData.java:
##########
@@ -133,16 +135,30 @@ private Number asNumber()
     return (Number) value;
   }
 
+  @SuppressWarnings("ReturnValueIgnored")
+  public int getSizeEstimate()
+  {
+    if (sizeEstimate < 0) {
+      hash.getAsLong(); // trigger hash computation which also sets 
sizeEstimate
+    }
+    Preconditions.checkState(sizeEstimate >= 0, "sizeEstimate not 
initialized");
+    return sizeEstimate;
+  }
+
   @Override
   public int compareTo(StructuredData o)
   {
-    if (this.equals(o)) {
+    if (this == o) {
       return 0;
+    } else if (o == null) {

Review Comment:
   it's true, this would be caught by all the null checks and null comparators 
so it'd never happen, removed it



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