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

Prevent a panic when aggregates are used in an inner query with a raw query #7966

Merged

Conversation

jsternberg
Copy link
Contributor

@jsternberg jsternberg commented Feb 8, 2017

The following types of queries will panic:

SELECT mean, host FROM (SELECT mean(value) FROM cpu GROUP BY host)
SELECT top(sum, host, 3) FROM (SELECT sum(value) FROM cpu GROUP BY host)

These queries should work, but due to a current limitation with
aggregate functions, the aggregate functions won't return any auxiliary
fields. So even if a tag is not an auxiliary field, it is treated that
way by the query engine and this query will fail.

Fixing this properly will take a longer period of time. This fix just
prevents the panic from killing the server while we fix this for real.

Related to #7898.

  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated

… query

The following types of queries will panic:

    SELECT mean, host FROM (SELECT mean(value) FROM cpu GROUP BY host)
    SELECT top(sum, host, 3) FROM (SELECT sum(value) FROM cpu GROUP BY host)

These queries _should_ work, but due to a current limitation with
aggregate functions, the aggregate functions won't return any auxiliary
fields. So even if a tag is not an auxiliary field, it is treated that
way by the query engine and this query will fail.

Fixing this properly will take a longer period of time. This fix just
prevents the panic from killing the server while we fix this for real.
@jsternberg jsternberg force-pushed the js-7898-prevent-panic-when-aggregate-returns-no-aux-fields branch from 169aad7 to 2ad1668 Compare February 8, 2017 17:45
@jsternberg jsternberg added this to the 1.2.1 milestone Feb 8, 2017
@jsternberg jsternberg merged commit afbfa00 into 1.2 Feb 8, 2017
@jsternberg jsternberg deleted the js-7898-prevent-panic-when-aggregate-returns-no-aux-fields branch February 8, 2017 18:49
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.

2 participants