-
Notifications
You must be signed in to change notification settings - Fork 964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(search_family): Remove the output of extra fields in the FT.AGGREGATE command #4231
base: main
Are you sure you want to change the base?
fix(search_family): Remove the output of extra fields in the FT.AGGREGATE command #4231
Conversation
…GATE command fixes dragonflydb#4230 Signed-off-by: Stepan Bagritsevich <[email protected]>
8affbf7
to
c108b12
Compare
// TODO: Replace DocValues with compact linear search map instead of hash map | ||
struct PipelineResult { | ||
// Values to be passed to the next step | ||
// TODO: Replace DocValues with compact linear search map instead of hash map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this TODO relevant? I do not see a hash map here
}; | ||
} | ||
|
||
PipelineResult Process(std::vector<DocValues> values, absl::Span<const PipelineStep> steps) { | ||
PipelineResult Process(std::vector<DocValues> values, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put your prod-duty hat, and think about all the VLOG statements you would like to have, if we have problems in production with this code.
if (descending) { | ||
std::reverse(values.begin(), values.end()); | ||
return values; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of reverse, you can do correct sorting
return result; | ||
values = std::move(result.value()); | ||
PipelineResult step_result = step(std::move(result)); | ||
result = std::move(step_result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to see step method modifying the result instead of all these moves
using PipelineResult = io::Result<std::vector<DocValues>, facade::ErrorReply>; | ||
using PipelineStep = std::function<PipelineResult(std::vector<DocValues>)>; // Group, Sort, etc. | ||
// Fields from values to be printed | ||
absl::flat_hash_set<std::string> fields_to_print; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why flat_hash_set
auto it = value.find(field); | ||
if (it != value.end()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if (auto it = value.find(field); it != value.end())
fixes #4230
First PR for complete support of the SORTBY option (#3631)
To see examples please check the issue.
Add code that checks, during aggregate steps, what fields should be printed.