Skip to content

Commit

Permalink
Use QL_CONCEPT_OR_TYPENAME in CartesianProductJoin C++17 backport
Browse files Browse the repository at this point in the history
  • Loading branch information
gpicciuca committed Jan 24, 2025
1 parent ab324c4 commit a98953a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
17 changes: 8 additions & 9 deletions src/engine/CartesianProductJoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ VariableToColumnMap CartesianProductJoin::computeVariableToColumnMap() const {
}

// _____________________________________________________________________________
CPP_template(typename R)(requires ql::ranges::random_access_range<R>) IdTable
CartesianProductJoin::writeAllColumns(R idTables, size_t offset,
size_t limit,
size_t lastTableOffset) const {
template <QL_CONCEPT_OR_TYPENAME(ql::ranges::random_access_range) R>
IdTable CartesianProductJoin::writeAllColumns(R idTables, size_t offset,
size_t limit,
size_t lastTableOffset) const {
AD_CORRECTNESS_CHECK(offset >= lastTableOffset);
IdTable result{getResultWidth(), getExecutionContext()->getAllocator()};
// TODO<joka921> Find a solution to cheaply handle the case, that only a
Expand Down Expand Up @@ -303,11 +303,10 @@ CartesianProductJoin::calculateSubResults(bool requestLaziness) {
}

// _____________________________________________________________________________
CPP_template(typename R)(requires ql::ranges::range<R>) Result::Generator
CartesianProductJoin::produceTablesLazily(LocalVocab mergedVocab,
R idTables, size_t offset,
size_t limit,
size_t lastTableOffset) const {
template <QL_CONCEPT_OR_TYPENAME(ql::ranges::range) R>
Result::Generator CartesianProductJoin::produceTablesLazily(
LocalVocab mergedVocab, R idTables, size_t offset, size_t limit,
size_t lastTableOffset) const {
while (limit > 0) {
uint64_t limitWithChunkSize = std::min(limit, chunkSize_);
IdTable idTable = writeAllColumns(ql::ranges::ref_view(idTables), offset,
Expand Down
8 changes: 4 additions & 4 deletions src/engine/CartesianProductJoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class CartesianProductJoin : public Operation {
// rows to write at most. `lastTableOffset` is the offset of the last table,
// to account for cases where the last table does not cover the whole result
// and so index 0 of a table does not correspond to row 0 of the result.
CPP_template(typename R)(requires ql::ranges::random_access_range<R>) IdTable
writeAllColumns(R idTables, size_t offset, size_t limit,
size_t lastTableOffset = 0) const;
template <QL_CONCEPT_OR_TYPENAME(ql::ranges::random_access_range) R>
IdTable writeAllColumns(R idTables, size_t offset, size_t limit,
size_t lastTableOffset = 0) const;

// Calculate the subresults of the children and store them into a vector. If
// the rightmost child can produce a lazy result, it will be stored outside of
Expand All @@ -114,7 +114,7 @@ class CartesianProductJoin : public Operation {
// `lastTableOffset` is the offset of the last table in the range. This is
// used to handle `IdTable`s yielded by generators where the range of indices
// they represent do not cover the whole result.
CPP_template(typename R)(requires ql::ranges::range<R>) Result::Generator
template<QL_CONCEPT_OR_TYPENAME(ql::ranges::range) R> Result::Generator
produceTablesLazily(LocalVocab mergedVocab, R idTables, size_t offset,
size_t limit, size_t lastTableOffset = 0) const;

Expand Down

0 comments on commit a98953a

Please sign in to comment.