2525
2626namespace silo ::query_engine::filter::expressions {
2727
28- using OperatorVector = std::vector<std::unique_ptr<operators::Operator>>;
2928using operators::Operator;
29+ using operators::OperatorVector;
3030
31- And::And (std::vector<std::unique_ptr<Expression>> && children)
31+ And::And (ExpressionVector && children)
3232 : children(std::move(children)) {}
3333
3434std::string And::toString () const {
@@ -56,7 +56,7 @@ void inline appendVectorToVector(
5656void logCompiledChildren (
5757 OperatorVector& non_negated_child_operators,
5858 OperatorVector& negated_child_operators,
59- std::vector<std::unique_ptr< operators::Predicate>> & predicates
59+ operators::PredicateVector & predicates
6060) {
6161 std::vector<std::string> child_operator_strings;
6262 std::ranges::transform (
@@ -89,12 +89,11 @@ void logCompiledChildren(
8989}
9090} // namespace
9191
92- std::tuple<OperatorVector, OperatorVector, std::vector<std::unique_ptr<operators::Predicate>>> And::
93- compileChildren (
94- const Database& database,
95- const storage::TablePartition& database_partition,
96- AmbiguityMode mode
97- ) const {
92+ std::tuple<OperatorVector, OperatorVector, operators::PredicateVector> And::compileChildren (
93+ const Database& database,
94+ const storage::TablePartition& database_partition,
95+ AmbiguityMode mode
96+ ) const {
9897 OperatorVector all_child_operators;
9998 std::ranges::transform (
10099 children,
@@ -105,7 +104,7 @@ std::tuple<OperatorVector, OperatorVector, std::vector<std::unique_ptr<operators
105104 );
106105 OperatorVector non_negated_child_operators;
107106 OperatorVector negated_child_operators;
108- std::vector<std::unique_ptr< operators::Predicate>> predicates;
107+ operators::PredicateVector predicates;
109108 for (auto & child : all_child_operators) {
110109 if (child->type () == operators::FULL ) {
111110 SPDLOG_TRACE (" Skipping full child" );
@@ -115,9 +114,7 @@ std::tuple<OperatorVector, OperatorVector, std::vector<std::unique_ptr<operators
115114 SPDLOG_TRACE (" Shortcutting because found empty child" );
116115 OperatorVector empty;
117116 empty.emplace_back (std::make_unique<operators::Empty>(database_partition.sequence_count ));
118- return {
119- std::move (empty), OperatorVector (), std::vector<std::unique_ptr<operators::Predicate>>{}
120- };
117+ return {std::move (empty), OperatorVector (), operators::PredicateVector{}};
121118 }
122119 if (child->type () == operators::INTERSECTION ) {
123120 auto * intersection_child = dynamic_cast <operators::Intersection*>(child.get ());
@@ -224,7 +221,7 @@ void from_json(const nlohmann::json& json, std::unique_ptr<And>& filter) {
224221 CHECK_SILO_QUERY (
225222 json[" children" ].is_array (), " The field 'children' in an And expression needs to be an array"
226223 );
227- auto children = json.at (" children" ).get <std::vector<std::unique_ptr<Expression>> >();
224+ auto children = json.at (" children" ).get <ExpressionVector >();
228225 filter = std::make_unique<And>(std::move (children));
229226}
230227
0 commit comments