Repository navigation
MOD-16172 - support exclude empty in mrange commands (#2072) - #2091
Merged
Merged
Conversation
* add EXCLUDEEMPTY flag to TS.MRANGE / TS.MREVRANGE Filtering is applied per inner shard (not the coordinator), consistent with how aggregation and FILTERBY are handled. The standalone path filters in replyUngroupedMultiRange. EXCLUDEEMPTY and GROUPBY are mutually exclusive. * fix remarks * aplly changes to make the check fo empty series more effiecient * dix code remarks * add to command info
|
AvivDavid23
approved these changes
Jul 8, 2026
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.



Filtering is applied per inner shard (not the coordinator), consistent with how aggregation and FILTERBY are handled. The standalone path filters in replyUngroupedMultiRange. EXCLUDEEMPTY and GROUPBY are mutually exclusive.
fix remarks
aplly changes to make the check fo empty series more effiecient
dix code remarks
add to command info
Note
Medium Risk
Changes multi-key query reply shape and cluster predicate serialization; behavior differs across LibMR coordinator paths (Gears vs internal), so cluster regressions are the main review focus.
Overview
Adds optional
EXCLUDEEMPTY(since 8.10.0) toTS.MRANGEandTS.MREVRANGE, so series with no samples in the requested range (after range, filters, and aggregation) are omitted from the multi-series reply instead of returned with empty sample arrays.Parsing stores an
excludeEmptyflag onMRangeArgs, rejectsEXCLUDEEMPTYwithGROUPBY, and avoids treating aGROUPBYlabel literally namedEXCLUDEEMPTYas the flag. Command metadata is updated incommands.jsonandts_info.c.Reply paths use
SeriesQueryIfNonEmptyplusReplySeriesRangeFromIterto skip empty series without double-scanning, and use postponed top-level array length when the final series count is unknown until emission. The flag is propagated through LibMR (**QueryPredicates_Arg**serialize/deserialize and shardmrangeArgs) and applied on the standalone ungrouped path and the Gears coordinatormrange_done_gearspath.Flow tests cover combinations with
WITHLABELS,COUNT, aggregation,FILTER_BY_*,MREVRANGE,AGGREGATION … EMPTY, and RESP3.Reviewed by Cursor Bugbot for commit 841dcd9. Bugbot is set up for automated code reviews on this repo. Configure here.