Skip to content

CQs should allow for execution with gaps #6963

@beckettsean

Description

@beckettsean

Feature Request

This is a bit of a feature request and a bug. The bug is in the current error message, and the resolution is either to add the feature and remove the error, or to fix the error message and leave the feature unimplemented.

Proposal: [Description of the feature]

CQs should allow for an execution frequency lower than the GROUP BY interval. For example, calculate the SUM() of the last minute of traffic, but only calculate it every 15 minutes, not every minute.

Current behavior: [What currently happens]

> CREATE CONTINUOUS QUERY delay ON _internal RESAMPLE EVERY 1h FOR 20s BEGIN SELECT max(writeOk) AS maxwrite INTO delay FROM "write" GROUP BY time(10s) END
ERR: error parsing query: FOR duration must be >= GROUP BY time duration: must be a minimum of 1h, got 20s

Desired behavior: [What you would like to happen]

The error message is wrong. The FOR duration (20s) is greater than the GROUP BY interval (10s). It is not greater than the EVERY interval (1h), however, which is why the error is firing.

Ideally, it should be possible to execute CQs less frequently so that not every possible GROUP BY time interval is calculated.

Use case: [Why is this important (helps with prioritizing requests)]

It's functionality that the syntax supports, I see no reason to disallow it. See https://groups.google.com/d/msgid/influxdb/16937e49-7ff0-44a0-b15f-2bec50db48b6%40googlegroups.com for a customer with a real use case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions