Aitozi commented on code in PR #1557:
URL: https://github.com/apache/incubator-paimon/pull/1557#discussion_r1264989191


##########
paimon-core/src/main/java/org/apache/paimon/mergetree/LookupLevels.java:
##########
@@ -102,26 +103,59 @@ public void notifyDropFile(String file) {
     }
 
     @Nullable
-    public KeyValue lookup(InternalRow key, int startLevel) throws IOException 
{
-        if (startLevel == 0) {
-            throw new IllegalArgumentException("Start level can not be zero.");
-        }
-
+    public KeyValue lookup(LookupContext context) throws IOException {
         KeyValue kv = null;
-        for (int i = startLevel; i < levels.numberOfLevels(); i++) {
-            SortedRun level = levels.runOfLevel(i);
-            kv = lookup(key, level);
-            if (kv != null) {
-                break;
-            }
-        }
 
-        return kv;
+        switch (context.order) {
+            case High2Lower:

Review Comment:
   I think you are right, this solution is not necessary, will refactor this 
part.



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

Reply via email to