divjotarora commented on code in PR #3746:
URL: https://github.com/apache/parquet-java/pull/3746#discussion_r3970246985
##########
parquet-variant/src/main/java/org/apache/parquet/variant/Variant.java:
##########
Review Comment:
Do we need two separate search loops? There's some non-obvious stuff like
using `(low + high) >>> 1` that could easily diverge. One idea similar to what
@wgtmac suggested in a previous comment:
```
boolean needsUtf8 = containsCodeUnitAtLeast(key, Character.MIN_SURROGATE);
int maxAttempts = needsUtf8 ? 2 : 1;
for (int i = 0; i < maxAttempts; i++) {
String midKey = getMetadataKeyCached(midId)
int cmp = (needsUtf8 && attempt == 0) ? VariantUtil.compareKeys(midKey,
key) : midKey.compareTo(key);
}
```
--
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]