Skip to content
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

CAE-193: add "IGNORE" options to time series commands (for v5 branch) #2753

Open
wants to merge 2 commits into
base: v5
Choose a base branch
from

Conversation

sjpotter
Copy link
Contributor

@sjpotter sjpotter commented May 7, 2024

Description

Describe your pull request here


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

@sjpotter sjpotter requested a review from leibale May 7, 2024 11:47
it('with IGNORE no values', () => {
assert.deepEqual(
ADD.transformArguments('key', '*', 1, {
IGNORE: { }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "IGNORE no values" supported? (RedisTimeSeries/RedisTimeSeries#1543)
If it is - add support for IGNORE: true for this case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see what I wrote below

Comment on lines 15 to 16
MAX_TIME_DIFF: number;
MAX_VAL_DIFF: number;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "IGNORE no values" supported? (RedisTimeSeries/RedisTimeSeries#1543)
If it is - both MAX_TIME_DIFF and MAX_VAL_DIFF should be optional..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't seem like it, from code

int parseIgnoreArgs(RedisModuleCtx *ctx,
                    RedisModuleString **argv,
                    int argc,
                    long long int *ignoreMaxTimeDiff,
                    double *ignoreMaxValDiff) {
    int idx = RMUtil_ArgIndex("IGNORE", argv, argc);
    if (idx > 0) {
        long long maxTimeDiff;
        double maxValDiff;

        if (idx + 2 >= argc ||
            RMUtil_ParseArgs(argv, argc, idx + 1, "ld", &maxTimeDiff, &maxValDiff) !=
                REDISMODULE_OK) {
            RTS_ReplyGeneralError(ctx, "TSDB: Couldn't parse IGNORE");
            return TSDB_ERROR;
        }

        if (maxTimeDiff < 0 || maxValDiff < 0) {
            RTS_ReplyGeneralError(ctx, "TSDB: IGNORE arguments cannot be negative");
            return TSDB_ERROR;
        }

        *ignoreMaxTimeDiff = maxTimeDiff;
        *ignoreMaxValDiff = maxValDiff;
    }

    return TSDB_OK;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants