Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Caideyipi committed Jan 8, 2025
1 parent 41532e6 commit 3276a6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,6 @@ private boolean tryGetDeviceInCache(
if (Objects.nonNull(fetchPaths)) {
fetchPaths.add(deviceID);
}
if (isDirectDeviceQuery && Objects.nonNull(deviceEntryList)) {
queryContext.releaseMemoryReservedForFrontEnd(
deviceEntryList.stream().map(DeviceEntry::ramBytesUsed).reduce(0L, Long::sum));
}
return false;
}

Expand All @@ -348,12 +344,13 @@ private boolean tryGetDeviceInCache(
// TODO table metadata: process cases that selected attr columns different from those used for
// predicate
if (check.test(deviceEntry)) {
queryContext.reserveMemoryForFrontEnd(deviceEntry.ramBytesUsed());
deviceEntryList.add(deviceEntry);
// If we partially hit cache in direct device query, we must fetch for all the predicates
// because now we do not support combining memory source and other sources
if (isDirectDeviceQuery) {
fetchPaths.add(deviceID);
} else {
queryContext.reserveMemoryForFrontEnd(deviceEntry.ramBytesUsed());
}
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public boolean parseRawExpression(
final boolean needFetch =
super.parseRawExpression(entries, tableInstance, attributeColumns, context);
if (!needFetch) {
context.reserveMemoryForFrontEnd(
entries.stream().map(DeviceEntry::ramBytesUsed).reduce(0L, Long::sum));
results =
entries.stream()
.map(
Expand Down

0 comments on commit 3276a6a

Please sign in to comment.