From e4516617eb73fa15aaf173a78ceffc11da543e82 Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Mon, 10 Jun 2019 13:40:43 +0200 Subject: [PATCH] alternator: add filtering to Query Query requests now accept QueryFilter parameter. --- alternator/executor.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alternator/executor.cc b/alternator/executor.cc index 8935f3132c..ce9caa8eaf 100644 --- a/alternator/executor.cc +++ b/alternator/executor.cc @@ -893,11 +893,14 @@ future executor::query(std::string content) { //FIXME(sarna): KeyConditions are deprecated in favor of KeyConditionExpression const Json::Value& conditions = request_info["KeyConditions"]; + //FIXME(sarna): QueryFilter is deprecated in favor of FilterExpression + const Json::Value& query_filter = request_info["QueryFilter"]; auto [partition_ranges, ck_bounds] = calculate_bounds(schema, conditions); auto attrs_to_get = boost::copy_range>(attributes_to_get | boost::adaptors::transformed(std::bind(&Json::Value::asString, std::placeholders::_1))); - return do_query(schema, exclusive_start_key, std::move(partition_ranges), std::move(ck_bounds), std::move(attrs_to_get), limit, cl, nullptr); + auto filtering_restrictions = get_filtering_restrictions(schema, attrs_column(*schema), query_filter); + return do_query(schema, exclusive_start_key, std::move(partition_ranges), std::move(ck_bounds), std::move(attrs_to_get), limit, cl, std::move(filtering_restrictions)); } static void validate_limit(int limit) {