Commit Graph

18 Commits (643b2eb30cd4726e58a9052ee6f15ec9bea759cf)

Author SHA1 Message Date
Tom Young d2fd3f50aa Add bitwise AND, OR and XOR operators to InfluxQL. 2017-03-31 21:02:02 +01:00
Jonathan A. Sternberg 3e52ec7ca2 Merge pull request #7762 from influxdata/js-6541-timezone-support
Support timezone offsets for queries
2017-03-28 10:39:07 -05:00
Jonathan A. Sternberg ccf0cb8371 Fix query parser when using addition and subtraction without spaces
Additionally, support unary addition and subtraction for variables,
calls, and parenthesis expressions. Doing `-value` will be the
equivalent of doing `-1 * value` now.
2017-03-24 12:52:19 -05:00
Jonathan A. Sternberg 347b01814e Support timezone offsets for queries
The timezone for a query can now be added to the end with something like
`TZ("America/Los_Angeles")` and it will localize the results of the
query to be in that timezone. The offset will automatically be set to
the offset for that timezone and offsets will automatically adjust for
daylight savings time so grouping by a day will result in a 25 hour day
once a year and a 23 hour day another day of the year.

The automatic adjustment of intervals for timezone offsets changing will
only happen if the group by period is greater than the timezone offset
would be. That means grouping by an hour or less will not be affected by
daylight savings time, but a 2 hour or 1 day interval will be.

The default timezone is UTC and existing queries are unaffected by this
change.

When times are returned as strings (when `epoch=1` is not used), the
results will be returned using the requested timezone format in RFC3339
format.
2017-03-22 15:09:41 -05:00
Jonathan A. Sternberg 208d8507f1 Implement both single and multiline comments in influxql
A single line comment will read until the end of a line and is started
with `--` (just like SQL). A multiline comment is with `/* */`. You
cannot nest multiline comments.
2017-03-15 14:24:09 -05:00
Jonathan A. Sternberg d7c8c7ca4f Support subquery execution in the query language
This adds query syntax support for subqueries and adds support to the
query engine to execute queries on subqueries.

Subqueries act as a source for another query. It is the equivalent of
writing the results of a query to a temporary database, executing
a query on that temporary database, and then deleting the database
(except this is all performed in-memory).

The syntax is like this:

    SELECT sum(derivative) FROM (SELECT derivative(mean(value)) FROM cpu GROUP BY *)

This will execute derivative and then sum the result of those derivatives.
Another example:

    SELECT max(min) FROM (SELECT min(value) FROM cpu GROUP BY host)

This would let you find the maximum minimum value of each host.

There is complete freedom to mix subqueries with auxiliary fields. The only
caveat is that the following two queries:

    SELECT mean(value) FROM cpu
    SELECT mean(value) FROM (SELECT value FROM cpu)

Have different performance characteristics. The first will calculate
`mean(value)` at the shard level and will be faster, especially when it comes to
clustered setups. The second will process the mean at the top level and will not
include that optimization.
2017-01-07 13:00:48 -06:00
Michael Desa 966e5503bf Add fill(linear) to query language
Clean up template for fill average

Change fill(average) to fill(linear)

Update average to linear in infuxql spec

Add Integer Tests and associated fixes

Update CHANGELOG for fill(linear)
2016-10-04 14:27:04 -07:00
Nathaniel Cook 3ab4e9fa1d update InfluxQL readme to reflect current code 2016-08-29 12:33:55 -06:00
Cory LaNou 1117526873 remove IF EXISTS/IF NOT EXISTS from influxql language 2016-07-29 12:58:05 -05:00
Ben Johnson cd0ce3e5bd Fix DELETE Spec
This changes the `DELETE SERIES` specification to `DELETE`.

/cc @gunnaraasen
2016-04-29 13:12:55 -06:00
Jonathan A. Sternberg 6748155f8b Add NAME token to the list of reserved keywords
Fixes #6489.
2016-04-29 13:20:39 -04:00
David Norton 8c09f19c9a fix #6505: update InfluxQL README.md for regex_lit 2016-04-28 22:56:33 -04:00
Ben Johnson f7af787aef
add DELETE query support
This commit adds query language support for deleting series with a
`DELETE` query.
2016-04-27 15:16:23 -06:00
Ben Johnson 291dd08cd4
remove SHOW SERVERS & DROP SERVER
This commit removes support for `SHOW SERVERS` and `DROP SERVER`
from the `influxql` package. It also removes extraneous cluster
testing code from `cmd/influxd/run`.

Fixes #6465
2016-04-26 10:28:42 -06:00
Jack Zampolin 30a31d3acf Merge pull request #5654 from influxdata/jz-delete-from
Remove DELETE FROM from query spec
2016-02-12 10:47:57 -08:00
Jack Zampolin 014bbd3ef9 Remove DELETE FROM from query spec 2016-02-12 10:10:47 -08:00
Ben Johnson d1b9e7048f InfluxQL README 2016-02-10 09:40:30 -07:00
Michael Mattioli e2a24c26fd Renamed InfluxQL markdown file
Renamed markdown file explaining InfluxQL
both for uniformity as well as for easy
access from github.com
2016-02-03 21:30:14 -05:00