vrajat commented on code in PR #15523:
URL: https://github.com/apache/pinot/pull/15523#discussion_r2057492572
##########
pinot-core/src/main/java/org/apache/pinot/core/query/executor/ServerQueryExecutorV1Impl.java:
##########
@@ -199,128 +190,36 @@ private InstanceResponseBlock
executeInternal(ServerQueryRequest queryRequest, E
return instanceResponse;
}
- TableDataManager tableDataManager =
_instanceDataManager.getTableDataManager(tableNameWithType);
- if (tableDataManager == null) {
- String errorMessage = "Failed to find table: " + tableNameWithType + "
on server: "
- + _instanceDataManager.getInstanceId();
+ TableExecutionInfo executionInfo =
+ SingleTableExecutionInfo.create(_instanceDataManager,
tableNameWithType, queryRequest.getSegmentsToQuery(),
+ queryRequest.getOptionalSegments(), queryContext);
+
+ if (executionInfo == null) {
Review Comment:
The point of this refactor is to be able to process a list of
`TableDataManagers`. Now I remember why I changed it to a try/catch block. In
logical tables, any one of them may not be found and I used an exception to
return the table name as part of the message. I'll add back the try/catch block
and use a better exception. cc @yashmayya
This is the code for `LogicalTableExecutionInfo.create` and it works well
with exceptions.
```
List<TableSegmentsContext> tableSegmentsContexts =
queryRequest.getTableSegmentsContexts();
List<SingleTableExecutionInfo> tableExecutionInfos = new
ArrayList<>(tableSegmentsContexts.size());
for (TableSegmentsContext tableSegmentsInfo : tableSegmentsContexts) {
SingleTableExecutionInfo singleTableExecutionInfo =
SingleTableExecutionInfo.create(instanceDataManager,
tableSegmentsInfo.getTableName(),
tableSegmentsInfo.getSegments(),
tableSegmentsInfo.getOptionalSegments(), queryContext);
tableExecutionInfos.add(singleTableExecutionInfo);
}
return new LogicalTableExecutionInfo(tableExecutionInfos);
```
--
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]