Implement ARAGG and RANGE predicate for ARGREP#15534
Open
ShubhamTaple wants to merge 4 commits into
Open
Implement ARAGG and RANGE predicate for ARGREP#15534ShubhamTaple wants to merge 4 commits into
ShubhamTaple wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit c672d52. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses #15211 - but
ARQUERYis not added because its functionality would remain same asARGREP, so I don't see a point adding it (happy to change my decision if maintainers push me)Implements
ARAGG- Array Aggregate command in similar fashion asAROP.Enhances
ARGREPto includeRANGEpredicate.Changes
ARGREPto addRANGEis minimal. (t_array.c)ARAGGis implemented in similar way toAROP. (t_array.c)ARGREPandARAGG. (t_array.c)ARGREPwithRANGEpredicate andARAGGcommand.ARGREP – now with RANGE predicate
ARAGG – compute aggregates with optional predicates
Examples
Note
Medium Risk
New public commands and shared parser changes affect ARGREP and ARAGG behavior; readonly-only but regex/RANGE parsing and aggregate edge cases need careful review.
Overview
Introduces
ARAGG(8.10.0): a readonly array command that scans an index range, optionally filters elements with the same predicates asARGREP(EXACT, MATCH, GLOB, RE, RANGE), then returns SUM, MIN, MAX, COUNT, AVG, AND, OR, XOR in one pass via a requiredAGGREGATEclause. Predicates are optional forARAGG;WITHVALUESis rejected there.ARGREPgains aRANGE min max [EXCLUSIVE]predicate (numeric element values, inclusive or exclusive bounds). Command metadata is updated incommands/aragg.json,commands/argrep.json, and generatedcommands.def.t_array.crefactors ARGREP-specific predicate code into a shared array predicate engine (arPredicate*,arParsePredicatePlanOrReplywith optional stop-at-AGGREGATEand optional zero predicates).araggCommandimplements multi-accumulator logic similar in spirit toAROP, honoring LIMIT on matched elements. Unit tests intests/unit/type/array.tclcover RANGE on ARGREP and broad ARAGG behavior.Reviewed by Cursor Bugbot for commit f68b8e6. Bugbot is set up for automated code reviews on this repo. Configure here.