lxy-9602 commented on code in PR #6692:
URL: https://github.com/apache/paimon/pull/6692#discussion_r2570670274
##########
paimon-common/src/main/java/org/apache/paimon/globalindex/GlobalIndexResult.java:
##########
@@ -18,54 +18,108 @@
package org.apache.paimon.globalindex;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Set;
+import org.apache.paimon.utils.Range;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
/**
- * Global index result represents row ids.
+ * Global index result represents row ids as a list of ranges.
*
- * <p>TODO introduce ranges interface
+ * <p>Invariant: The list returned by {@link #results()} must be sorted by
range start position and
+ * contain no overlapping ranges.
*/
-public interface GlobalIndexResult extends Iterable<Long> {
+public interface GlobalIndexResult {
Review Comment:
RoaringBitmap appears to strike a reasonable balance between query
performance and storage efficiency across different use cases—such as range, a
small or large number of id—so it might be worth considering a bitmap-based
approach as the foundation for GlobalIndexResult.
P.S. RoaringBitmap includes a runOptimized feature that automatically
enables run-length encoding when it’s expected to save space.
--
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]