eldenmoon commented on code in PR #39468:
URL: https://github.com/apache/doris/pull/39468#discussion_r1724354438
##########
fe/fe-core/src/main/java/org/apache/doris/qe/PointQueryExecutor.java:
##########
@@ -250,42 +491,68 @@ 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));
- }
- if (shortCircuitQueryContext.cacheID != null) {
- InternalService.UUID.Builder uuidBuilder =
InternalService.UUID.newBuilder();
-
uuidBuilder.setUuidHigh(shortCircuitQueryContext.cacheID.getMostSignificantBits());
-
uuidBuilder.setUuidLow(shortCircuitQueryContext.cacheID.getLeastSignificantBits());
- requestBuilder.setUuid(uuidBuilder);
+ 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);
}
- addKeyTuples(requestBuilder);
+ Set<Long> prunedTabletIdsOfBe = Sets.newHashSet(tabletIdsOfBe);
+ prunedTabletIdsOfBe.retainAll(keyTupleID2TabletID.get(i));
Review Comment:
one key should be a certain tablet id not a set of tablet ids , add check
here for one key per tablet, if one key has many tablets then logic is wrong
--
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]