-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow the `BIND` operation to handle its input lazily. NOTE: Currently there is only a single local vocab for all the results of the `BIND`, so even when a `BIND` that creates strings is handled lazily, we still need the RAM for the complete local vocab. This will be handled in a follow-up PR.
- Loading branch information
Showing
6 changed files
with
252 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
// | ||
// Created by johannes on 19.04.20. | ||
// | ||
// Copyright 2020, University of Freiburg, | ||
// Chair of Algorithms and Data Structures. | ||
// Author: Johannes Kalmbach <[email protected]> | ||
|
||
#ifndef QLEVER_BIND_H | ||
#define QLEVER_BIND_H | ||
#pragma once | ||
|
||
#include "engine/Operation.h" | ||
#include "engine/sparqlExpressions/SparqlExpressionPimpl.h" | ||
|
@@ -12,6 +11,8 @@ | |
/// BIND operation, currently only supports a very limited subset of expressions | ||
class Bind : public Operation { | ||
public: | ||
static constexpr size_t CHUNK_SIZE = 10'000; | ||
|
||
Bind(QueryExecutionContext* qec, std::shared_ptr<QueryExecutionTree> subtree, | ||
parsedQuery::Bind b) | ||
: Operation(qec), _subtree(std::move(subtree)), _bind(std::move(b)) {} | ||
|
@@ -37,25 +38,20 @@ class Bind : public Operation { | |
float getMultiplicity(size_t col) override; | ||
bool knownEmptyResult() override; | ||
|
||
// Returns the variable to which the expression will be bound | ||
[[nodiscard]] const string& targetVariable() const { | ||
return _bind._target.name(); | ||
} | ||
|
||
protected: | ||
[[nodiscard]] vector<ColumnIndex> resultSortedOn() const override; | ||
|
||
private: | ||
ProtoResult computeResult([[maybe_unused]] bool requestLaziness) override; | ||
ProtoResult computeResult(bool requestLaziness) override; | ||
|
||
static IdTable cloneSubView(const IdTable& idTable, | ||
const std::pair<size_t, size_t>& subrange); | ||
|
||
// Implementation for the binding of arbitrary expressions. | ||
template <size_t IN_WIDTH, size_t OUT_WIDTH> | ||
void computeExpressionBind( | ||
IdTable* outputIdTable, LocalVocab* outputLocalVocab, | ||
const Result& inputResultTable, | ||
sparqlExpression::SparqlExpression* expression) const; | ||
IdTable computeExpressionBind( | ||
LocalVocab* outputLocalVocab, IdTable idTable, | ||
const LocalVocab& inputLocalVocab, | ||
const sparqlExpression::SparqlExpression* expression) const; | ||
|
||
[[nodiscard]] VariableToColumnMap computeVariableToColumnMap() const override; | ||
}; | ||
|
||
#endif // QLEVER_BIND_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.