JingsongLi commented on code in PR #9038:
URL: https://github.com/apache/paimon/pull/9038#discussion_r3720220320


##########
paimon-python/pypaimon/read/table_scan.py:
##########
@@ -171,16 +171,36 @@ def _native_plan_supported_impl(self) -> bool:
             return False
         return not options.contains(CoreOptions.INCREMENTAL_BETWEEN_TIMESTAMP)
 
+    def _native_global_index_result_supported(self) -> bool:
+        result = getattr(self.file_scanner, '_global_index_result', None)
+        if result is None:
+            return True
+        if (getattr(self.table, 'is_primary_key_table', False)
+                or not getattr(self.file_scanner, 'data_evolution', False)):
+            return False
+        from pypaimon.globalindex.global_index_result import GlobalIndexResult
+        from pypaimon.globalindex.vector_search_result import 
ScoredGlobalIndexResult
+        return (isinstance(result, GlobalIndexResult)
+                and not isinstance(result, ScoredGlobalIndexResult))
+
+    def _native_global_index_row_ranges(self) -> Optional[List[Tuple[int, 
int]]]:
+        result = getattr(self.file_scanner, '_global_index_result', None)

Review Comment:
   Do not use `getattr` to get inner field. Avoid using "hacky" solutions 
unless absolutely necessary; `file_scanner` is something we implemented and 
control ourselves.



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