Skip to content

Commit

Permalink
Small tweaks.
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Kalmbach <[email protected]>
  • Loading branch information
joka921 committed Dec 20, 2024
1 parent ecb6a2f commit 896df47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/engine/GroupBy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,9 @@ ProtoResult GroupBy::computeResult(bool requestLaziness) {
if (subresult->isFullyMaterialized()) {
// `computeWithHashMap` takes a range, so we artificially create one with
// a single input.
return computeWithHashMap(std::array{std::pair{
std::ref(subresult->idTable()), subresult->getCopyOfLocalVocab()}});
return computeWithHashMap(
std::array{std::pair{std::cref(subresult->idTable()),
std::cref(subresult->localVocab())}});
} else {
return computeWithHashMap(std::move(subresult->idTables()));
}
Expand Down Expand Up @@ -1512,8 +1513,11 @@ Result GroupBy::computeGroupByForHashMapOptimization(

ad_utility::Timer lookupTimer{ad_utility::Timer::Stopped};
ad_utility::Timer aggregationTimer{ad_utility::Timer::Stopped};
for (const auto& [inputTableRef, inputLocalVocab] : subresults) {
for (const auto& [inputTableRef, inputLocalVocabRef] : subresults) {
// Also support `std::reference_wrapper` as the input.
const IdTable& inputTable = inputTableRef;
const LocalVocab& inputLocalVocab = inputLocalVocabRef;

localVocab.mergeWith(std::span{&inputLocalVocab, 1});
// Initialize evaluation context
sparqlExpression::EvaluationContext evaluationContext(
Expand Down
3 changes: 3 additions & 0 deletions test/GroupByTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,9 @@ TEST_F(GroupByOptimizations, hashMapOptimizationLazyAndMaterializedInputs) {
};
runTest(true);
runTest(false);

// Disable optimization for following tests
RuntimeParameters().set<"group-by-hash-map-enabled">(false);
}

// _____________________________________________________________________________
Expand Down

0 comments on commit 896df47

Please sign in to comment.