You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "morningman (via GitHub)" <gi...@apache.org> on 2023/05/28 14:16:35 UTC
[GitHub] [doris] morningman commented on a diff in pull request #17404: [Enhancement](tvf) Table value function support reading local file
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`. This is not your problem, but you can change it in this PR.
##########
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");
Review Comment:
```suggestion
throw new UserException("Backend {} does not exist", backendId);
```
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org