clintropolis commented on code in PR #18541:
URL: https://github.com/apache/druid/pull/18541#discussion_r2411314025
##########
processing/src/main/java/org/apache/druid/segment/nested/StructuredData.java:
##########
@@ -133,16 +135,28 @@ 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) {
Review Comment:
ah yea, it totally is strange, and i wasn't necessarily encouraging
reverting it, just was curious if was directly related or not. I think it would
be ok to consider making these all consistent with each other, but we can do
that in a separate PR since it also doesn't really matter much either way since
compareTo is the main thing that is used by stuff.
--
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]