morningman commented on code in PR #17404:
URL: https://github.com/apache/doris/pull/17404#discussion_r1208561088


##########
fe/fe-core/src/main/java/org/apache/doris/planner/external/TVFScanNode.java:
##########
@@ -70,6 +74,22 @@ protected void doInitialize() throws UserException {
         initSchemaParams();
     }
 
+    @Override
+    protected void initBackendPolicy() throws UserException {
+        List<String> preLocations = new ArrayList<>();
+        if (tableValuedFunction instanceof LocalTableValuedFunction) {
+            // For local tvf, the backend was specified by backendId
+            Long backendId = ((LocalTableValuedFunction) 
tableValuedFunction).getBackendId();
+            Backend backend = Env.getCurrentSystemInfo().getBackend(backendId);
+            if (backend == null) {
+                throw new UserException("No available backends");
+            }
+            preLocations.add(backend.getHost());

Review Comment:
   better to rename `preLocations` to `preferLocations`(here and in 
BackendPolicy). This is not your problem, but you can change it in this PR.



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

Reply via email to