Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/engine/ExportQueryExecutionTrees.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ STREAMABLE_GENERATOR_TYPE ExportQueryExecutionTrees::selectQueryResultToStream(

// special case : binary export of IdTable
if constexpr (format == MediaType::octetStream) {
std::erase(selectedColumnIndices, std::nullopt);
ql::erase(selectedColumnIndices, std::nullopt);
uint64_t resultSize = 0;
for (const auto& [pair, range] :
getRowIndices(limitAndOffset, *result, resultSize)) {
Expand Down
7 changes: 7 additions & 0 deletions src/engine/sparqlExpressions/StringExpressions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
//
// Copyright 2025, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)

#ifndef QLEVER_REDUCED_FEATURE_SET_FOR_CPP17
#include <boost/url.hpp>
#endif

#include "backports/StartsWithAndEndsWith.h"
#include "engine/sparqlExpressions/LiteralExpression.h"
Expand Down Expand Up @@ -521,6 +523,7 @@ class ConcatExpression : public detail::VariadicExpression {
// ENCODE_FOR_URI
struct EncodeForUriImpl {
IdOrLiteralOrIri operator()(std::optional<std::string> input) const {
#ifndef QLEVER_REDUCED_FEATURE_SET_FOR_CPP17
if (!input.has_value()) {
return Id::makeUndefined();
} else {
Expand All @@ -529,6 +532,10 @@ struct EncodeForUriImpl {
return toLiteral(
boost::urls::encode(value, boost::urls::unreserved_chars));
}
#else
throw std::runtime_error(
"EncodeForUri is not available in reduced feature set for C++17");
#endif
}
};
using EncodeForUriExpression = StringExpressionImpl<1, EncodeForUriImpl>;
Expand Down
4 changes: 2 additions & 2 deletions src/util/ConstexprMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ConstexprMap {
// Create from an Array of key-value pairs. The keys have to be unique.
explicit constexpr ConstexprMap(Arr values) : _values{std::move(values)} {
ql::ranges::sort(_values, compare);
if (::ranges::adjacent_find(_values, std::equal_to<>{}, &Pair::key_) !=
if (::ranges::adjacent_find(_values, std::equal_to<>{}, getKey) !=
_values.end()) {
throw std::runtime_error{
"ConstexprMap requires that all the keys are unique"};
Expand All @@ -58,7 +58,7 @@ class ConstexprMap {
// If `key` is in the map, return an iterator to the corresponding `(Key,
// Value)` pair. Else return `end()`.
constexpr typename Arr::const_iterator find(const Key& key) const {
auto lb = ql::ranges::lower_bound(_values, key, std::less<>{}, &Pair::key_);
auto lb = ql::ranges::lower_bound(_values, key, std::less<>{}, getKey);
if (lb == _values.end() || lb->key_ != key) {
return _values.end();
}
Expand Down
19 changes: 13 additions & 6 deletions src/util/Serializer/TripleSerializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "util/Serializer/FileSerializer.h"
#include "util/Serializer/SerializeArrayOrTuple.h"
#include "util/Serializer/SerializeString.h"
#include "util/TransparentFunctors.h"
#include "util/TypeTraits.h"
#include "util/Views.h"

Expand Down Expand Up @@ -102,13 +103,19 @@ CPP_template(typename Serializer)(
CPP_template(typename Range, typename Serializer)(
requires ql::ranges::range<Range>) void serializeIds(Serializer& serializer,
Range&& range) {
ad_utility::serialization::VectorIncrementalSerializer<Id, Serializer>
vectorSerializer{std::move(serializer)};
for (const Id& value : range) {
vectorSerializer.push(value);
if constexpr (ql::ranges::contiguous_range<std::decay_t<Range>>) {
serializer
<< ql::span<const ql::ranges::range_value_t<std::decay_t<Range>>>{
range};
} else {
ad_utility::serialization::VectorIncrementalSerializer<Id, Serializer>
vectorSerializer{std::move(serializer)};
for (const Id& value : range) {
vectorSerializer.push(value);
}
vectorSerializer.finish();
serializer = std::move(vectorSerializer).serializer();
}
vectorSerializer.finish();
serializer = std::move(vectorSerializer).serializer();
}

// Deserialize a range of Ids from the input stream. If an Id is of type
Expand Down
2 changes: 1 addition & 1 deletion src/util/stream_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ stream_generator_promise<BUFFER_SIZE>::get_return_object() noexcept {
} // namespace detail

// Use 1MiB buffer size by default
using stream_generator = basic_stream_generator<1u << 20>;
using stream_generator = basic_stream_generator<1000>;

#endif

Expand Down
8 changes: 5 additions & 3 deletions test/util/GTestHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,11 @@ auto liftOptionalMatcher(MakeMatcher makeMatcher) {
// returns a function `ArrayType -> Matcher<ArrayType>` that applies
// `MakeMatcher` to each of the expected values in the argument of `ArrayType`
// and returns an `ElementsAreArray` matcher of these submatchers.
template <typename T, typename ArrayType, typename MakeMatcher>
requires std::is_convertible_v<ArrayType, std::vector<T>>
auto liftMatcherToElementsAreArray(MakeMatcher makeMatcher) {
CPP_template(typename T, typename ArrayType, typename MakeMatcher)(
requires std::is_convertible_v<
ArrayType,
std::vector<T>>) auto liftMatcherToElementsAreArray(MakeMatcher
makeMatcher) {
return
[makeMatcher](ArrayType expectedValues) -> ::testing::Matcher<ArrayType> {
std::vector<::testing::Matcher<T>> childMatchers;
Expand Down
Loading