eldenmoon commented on code in PR #39468:
URL: https://github.com/apache/doris/pull/39468#discussion_r1753025769
##########
fe/fe-core/src/main/java/org/apache/doris/qe/PointQueryExecutor.java:
##########
@@ -250,42 +549,77 @@ public void exec() throws Exception {
// only handles in getNext()
}
- private RowBatch getNextInternal(Status status, Backend backend) throws
TException {
- long timeoutTs = System.currentTimeMillis() + timeoutMs;
- RowBatch rowBatch = new RowBatch();
- InternalService.PTabletKeyLookupResponse pResult = null;
- try {
-
Preconditions.checkNotNull(shortCircuitQueryContext.serializedDescTable);
-
- InternalService.PTabletKeyLookupRequest.Builder requestBuilder
- = InternalService.PTabletKeyLookupRequest.newBuilder()
- .setTabletId(tabletID)
- .setDescTbl(shortCircuitQueryContext.serializedDescTable)
-
.setOutputExpr(shortCircuitQueryContext.serializedOutputExpr)
-
.setQueryOptions(shortCircuitQueryContext.serializedQueryOptions)
- .setIsBinaryRow(ConnectContext.get().command ==
MysqlCommand.COM_STMT_EXECUTE);
- if (snapshotVisibleVersions != null &&
!snapshotVisibleVersions.isEmpty()) {
- requestBuilder.setVersion(snapshotVisibleVersions.get(0));
+ private List<byte[]> batchGetNext(Status status, Backend backend) throws
TException {
+ TResultBatch resultBatch = new TResultBatch();
+ List<byte[]> result = Lists.newArrayList();
+ resultBatch.setRows(Lists.newArrayList());
+ InternalService.PTabletBatchKeyLookupRequest.Builder
pBatchRequestBuilder
+ = InternalService.PTabletBatchKeyLookupRequest.newBuilder();
+ Set<Long> tabletIdsOfBe = backendId2TabletIds.get(backend.getId());
+
Preconditions.checkNotNull(shortCircuitQueryContext.serializedDescTable);
+ // assemble sub request
+ for (int i = 0; i < keyTupleID2TabletID.size(); ++i) {
+ KeyTuple.Builder kBuilder = KeyTuple.newBuilder();
+ for (String key : this.allKeyTuples.get(i)) {
+ kBuilder.addKeyColumnRep(key);
}
- if (shortCircuitQueryContext.cacheID != null) {
- InternalService.UUID.Builder uuidBuilder =
InternalService.UUID.newBuilder();
-
uuidBuilder.setUuidHigh(shortCircuitQueryContext.cacheID.getMostSignificantBits());
-
uuidBuilder.setUuidLow(shortCircuitQueryContext.cacheID.getLeastSignificantBits());
- requestBuilder.setUuid(uuidBuilder);
- }
- addKeyTuples(requestBuilder);
+ Set<Long> prunedTabletIdsOfBe = Sets.newHashSet(tabletIdsOfBe);
+ prunedTabletIdsOfBe.retainAll(keyTupleID2TabletID.get(i));
+ if (!prunedTabletIdsOfBe.isEmpty()) {
Review Comment:
redundant if, wrap to a function
--
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]