From e52f2dc5623929395d40aff3264c48099f6a246a Mon Sep 17 00:00:00 2001 From: Christian Jaeger Date: Wed, 27 Mar 2024 17:03:38 +0000 Subject: [PATCH] feat(boolean columns): selection --- src/silo/query_engine/operators/selection.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/silo/query_engine/operators/selection.cpp b/src/silo/query_engine/operators/selection.cpp index d5fff5be0..3d29a5851 100644 --- a/src/silo/query_engine/operators/selection.cpp +++ b/src/silo/query_engine/operators/selection.cpp @@ -9,10 +9,12 @@ #include #include +#include #include #include #include "silo/common/date.h" +#include "silo/common/optional_bool.h" #include "silo/common/string.h" #include "silo/query_engine/operator_result.h" #include "silo/query_engine/operators/complement.h" @@ -20,6 +22,8 @@ namespace silo::query_engine::operators { +using silo::common::OptionalBool; + Selection::Selection( std::unique_ptr&& child_operator, std::vector>&& predicates, @@ -208,6 +212,11 @@ template return std::make_unique>(column, negated_comparator, value); } +template <> +[[nodiscard]] std::string CompareToValueSelection::toString() const { + return fmt::format("$bool {} {}", displayComparator(comparator), value.asStr()); +} + template <> [[nodiscard]] std::string CompareToValueSelection::toString() const { return "$int " + displayComparator(comparator) + " " + std::to_string(value); @@ -235,6 +244,7 @@ template <> return "$double " + displayComparator(comparator) + " " + std::to_string(value); } +template class CompareToValueSelection; template class CompareToValueSelection; template class CompareToValueSelection; template class CompareToValueSelection;