Commit Graph

296 Commits (29b19a22934008d7f0dfed8589aa58240afabff4)

Author SHA1 Message Date
Cory LaNou b71540e57b fix validateCountDistinct 2015-05-19 12:43:16 -06:00
Cory LaNou 7de477889b validate arguments for aggregate functions 2015-05-19 12:29:39 -06:00
Cory LaNou 28d53b644f first pass at count distinct 2015-05-19 12:29:39 -06:00
Cory LaNou fc7d63ce61 validate methods can be private 2015-05-19 09:16:21 -06:00
Cory LaNou 4e5c72ef69 refactor RewriteDistinct (thx @dgnorton) 2015-05-19 09:16:21 -06:00
Cory LaNou 2b7701678c remove cruft 2015-05-19 09:16:21 -06:00
Cory LaNou 580def2ff6 only rewrite if we have distinct 2015-05-19 09:16:20 -06:00
Cory LaNou b9de38e7d4 support SELECT DISTINCT foo and SELECT distinct(foo) 2015-05-19 09:16:20 -06:00
Cory LaNou db79464ae0 more refactoring 2015-05-19 09:16:20 -06:00
Cory LaNou 06d40a2582 SELECT DISTINCT field -> SELECT distinct(field) 2015-05-19 09:16:20 -06:00
Cory LaNou 4c28c33332 validateDistinct should complain about aggregates before fields 2015-05-19 09:16:20 -06:00
Cory LaNou 69ff1d2c61 allow for a quoted field name in distinct 2015-05-19 09:16:19 -06:00
Cory LaNou 7d11effe0f make distinct care about the same thing aggregates do for validation 2015-05-19 09:16:19 -06:00
Cory LaNou 3d30720ec4 wip 2015-05-19 09:16:19 -06:00
Cory LaNou 3f9eacf24c add validations to parser for distinct 2015-05-19 09:16:19 -06:00
Cory LaNou b6b916edbc add distinct keyword 2015-05-19 09:16:19 -06:00
Todd Persen 1fa84c9387 Merge pull request #2579 from influxdb/aggregate-where-groupby-fix-2557
Fix false positive error for `aggregate functions with GROUP BY time …
2015-05-14 17:02:27 -07:00
Jason Wilder 34007a8be9 Make duration argument optional for derivatives
If it's not specified, it defaults to 1s for raw queries and to the
group by duration on group by queries.
2015-05-14 16:13:04 -06:00
Jason Wilder faa099a382 Fix code review comments 2015-05-14 15:45:57 -06:00
Cory LaNou 098c65ad18 fix false positive error for `aggregate functions with GROUP BY time require a WHERE time clause` 2015-05-14 15:45:13 -06:00
Jason Wilder 98521b273e Add non_negative_derivative
Fixes #1477
2015-05-13 15:57:48 -06:00
Jason Wilder a0a4600e7f Add derivative function
Calculates the derivative of consequtive points and normalizes the
value to a given interval.  It supports simple derivates over
fields as well as nested derivatives over another aggregate function.

Fixes #1822
2015-05-13 15:35:42 -06:00
Jason Wilder 7fd9a0acd3 Add validation for derivative arguments
Derivative must be of the form derviative(field, duration) or
derivative(agg(field), duration).
2015-05-13 15:35:42 -06:00
Jason Wilder eb1d7a659f Prohibit multiple columns in select when using derivative
May be supported in the future but workaround is to run separate
queries.
2015-05-13 15:35:42 -06:00
Cory LaNou eb1a4f669a refactor selectStatement validate 2015-05-12 08:56:38 -06:00
Cory LaNou bfdf05033d refactor validating select statement 2015-05-12 08:42:39 -06:00
Cory LaNou 7963a85914 no longer need hasCount 2015-05-11 17:48:37 -06:00
Cory LaNou 0155f8bb6d hasWhereTime -> hasTimeDimensions 2015-05-11 17:48:21 -06:00
Cory LaNou 892a6e831b error out for invalid count group select without where time 2015-05-11 17:48:21 -06:00
ben hockey ce54004961 normalize Call.Name to be lowercase 2015-05-01 12:05:55 -05:00
David Norton 86db3574ad fix #2286: parse error on CREATE CONTINUOUS QUERY 2015-04-17 16:40:29 -04:00
David Norton 78b1070775 make nowValuer public / exported 2015-04-15 11:26:36 -04:00
Philip O'Toole 96a81826ec Support int64 data types 2015-04-13 11:04:27 -07:00
Philip O'Toole bf1a8aa1e4 Use uint64 for Series IDs
Fixes issue #1649
2015-04-10 16:11:34 -07:00
David Norton 25cea58635 refactor scanning & parsing of identifiers 2015-04-09 13:21:13 -04:00
Dejan Golja e1b9982401 Add support for SET PASSWORD FOR user = 'PASSWORD'
Added support for the set password for user, so we can update user
password via the new server administration commands
2015-04-04 14:16:54 +11:00
Todd Persen 94a8019fc7 Wire up DROP CONTINUOUS QUERY 2015-03-25 11:58:33 -07:00
Philip O'Toole 1c440f8542 Implement "SHOW DIAGNOSTICS" 2015-03-23 23:45:57 -07:00
Philip O'Toole b045a0008e Remove redundant Aggregated() on select statement 2015-03-19 15:22:43 -07:00
Paul Dix 6d85d81a0b Make select statement clone copy IsRawQuery 2015-03-19 17:07:56 -04:00
Paul Dix 56281fbfd5 WIP: add IsRawQuery to select and fix LIMIT and OFFSET on GROUP BY time 2015-03-19 11:41:18 -04:00
David Norton 3f8ca0c923 influxql: remove RegexLiteral from Source types 2015-03-16 19:45:39 -04:00
David Norton 62ae32b0ce wire up regex in FROM clause 2015-03-16 19:40:59 -04:00
David Norton fd005a5f15 influxql: allow regex in FROM clause 2015-03-16 19:40:21 -04:00
Philip O'Toole e08066495a Add "SHOW STATS" command 2015-03-15 14:31:16 -07:00
Cory LaNou 3c3765dbb1 typo in comment 2015-03-13 16:52:49 -06:00
Cory LaNou 932b6ddc81 Sort wildcard expresion field names for consistent output 2015-03-13 16:51:18 -06:00
Paul Dix 4b943e9f45 Fix fill to work if they clone the select statement. 2015-03-11 19:29:18 -07:00
Paul Dix 00888562b9 Fix typo in comment 2015-03-11 18:20:20 -07:00
Paul Dix 06e8c1b3e8 Add fill to select statements.
Fixes #1913
Add fill(none), fill(<num>), and fill(previous) options
2015-03-11 18:05:31 -07:00
Cory LaNou de1defc528 add SHOW SERVERS to query language 2015-03-10 13:46:05 -06:00
Paul Dix 1a545a1cc0 Update Slimit and Soffset to SLimit and SOffset 2015-03-09 20:09:47 -07:00
Paul Dix 8d2abc5c86 Add Slimit and Soffset. Update tests and behavior to use those. 2015-03-09 18:46:05 -07:00
David Norton a032d77fa9 influxql: make walkFunctionCalls a func not method 2015-03-09 20:03:49 -04:00
David Norton 759838b5a0 influxql: make walkNames a func instead of a method 2015-03-09 19:59:03 -04:00
Paul Dix 93f3a229c6 Fix merge conflicts 2015-03-06 16:30:26 -08:00
Paul Dix df3c0099e1 WIP: wire up raw queries 2015-03-06 11:23:58 -08:00
Paul Dix 74e6f1f4db WIP: query language refactoring compiles. mores soon 2015-03-01 22:37:09 -08:00
Cory LaNou 151015b4b8 parsing DROP MEASUREMENT 2015-02-25 12:42:23 -07:00
Paul Dix 036859c191 Fix limit and offset, add more tests.
Also updated the Clone and Substatement methods to copy the offset.
2015-02-24 01:42:11 -05:00
Paul Dix a8a0b9f24e Fix raw data query where some values are null
I also removed the engine test for the raw planner. It's getting tested elsewhere and it would have been too difficult to make it work. Besides, that's getting replaced soon anyway.
2015-02-24 00:36:07 -05:00
Philip O'Toole 41ad49f1c1 Add wildcard detection method to SelectStatement 2015-02-23 19:09:55 -08:00
Philip O'Toole 84de4ad56c Add wildcard rewrite functionality for SELECT
This code, when given a SELECT statement, returns another SELECT
statement such that all "query" and GROUP BY wildcards have been
replaced with all Measurement fields and tag keys respectively.
2015-02-23 19:09:55 -08:00
Paul Dix 89b80dcd66 WIP: insane refactor of engine. Must come back later. 2015-02-23 18:07:01 -05:00
Cory LaNou 27d7f45729 support drop series without from but with where 2015-02-21 17:05:08 -07:00
Cory LaNou fd9c19ad9c wire up drop series parsing 2015-02-21 17:05:08 -07:00
David Norton 9bff9cdeee issue #1431: wire up regex queries 2015-02-21 15:38:35 -05:00
David Norton 12bed3e74f issue #1430: add where regex to influxql 2015-02-21 15:37:52 -05:00
Paul Dix 8fee14fbf8 Fixes based on PR feedback.
* Pull out magic numbers for running CQs in the broker
* Typo fixes in comments
* Update the process_continuous_queries endpoint to not have gzip
* Remove previous implementation of MeasurementNames in favor of new simpler one
2015-02-17 21:02:53 -05:00
Paul Dix 8d9bcdbc97 Finish wiring up basic version of CQs 2015-02-17 21:02:52 -05:00
Paul Dix fec6764b09 WIP: wire up continuous queries
* Fix run to work with CQ broker
* Fix CQ handler
* Fix SetTimeRange to use RFC3339Nano
* Fix the time range tests
* Fix the parser to parse for RFC3339Nano literals in addition to the other format
* Add logic for running CQs
* Remove duplicate WriteBufferSize default setting from config
2015-02-17 21:02:18 -05:00
Paul Dix b0d4b6da55 WIP: fix cq query times 2015-02-17 21:01:21 -05:00
Paul Dix f2d132b361 Implement continuous queries with group by intervals
* Update defaults on Broker for when to trigger CQ runs
* Add config settings for how often to calculate and recalculate CQ results
* Update Server to have CQ settings
* Update AST to fold removed time literals when setting time range
* Add periodic CQ running functionality to server
2015-02-17 21:00:24 -05:00
Paul Dix 34e037a9d8 Add SetTimeRange to SelectStatement for use by continuous queries 2015-02-17 21:00:24 -05:00
Paul Dix 5f14d5faf5 WIP: start implementation of continuous queries
* Update SelectStatement to have GroupByInterval
* Update parser to verify that CQs have GroupByInterval if Aggregated
* Implement CreateContinousQuery on Server
* Add ContinuousQueries to database
2015-02-17 21:00:24 -05:00
Philip O'Toole 276c5ded5a int maps to influxql.Number 2015-02-13 16:28:12 -08:00
Paul Dix 712297cdb5 Merge pull request #1506 from influxdb/fix-select-where-time
Fix queries that have only time in their where clause
2015-02-08 02:05:03 -05:00
Paul Dix bc813cc9da Fix queries with where clause only having time.
* Add OnlyTimeDimensions to SelectStatement
* Update the database to handle queries that only have a time statement
* Fix server test to insert a time literal that can be parsed.
2015-02-05 01:29:19 -05:00
David Norton 2b84113487 issue #1423: wire up show field keys 2015-02-04 10:59:47 -05:00
David Norton a8b86dc29b golint cleanup 2015-02-01 13:47:48 -05:00
David Norton 0cf681d19c influxql: remove TagKeyIdent, add WITH KEY clause 2015-01-29 15:01:25 -05:00
David Norton ae33bc99db issue #1411: wire up show tag keys 2015-01-28 21:33:19 -05:00
Paul Dix 3ad3abaf64 Merge pull request #1398 from influxdb/show-queries
Show queries
2015-01-28 10:44:08 -05:00
David Norton 2cf41d6ea9 influxql: fix WHERE TAG KEY parsing 2015-01-28 05:02:36 -05:00
David Norton b50e4cc514 implement SHOW SERIES 2015-01-28 00:29:14 -05:00
Paul Dix 861163c03e Add influxql.Eval(). 2015-01-27 20:27:19 -05:00
Ben Johnson 1eda0ffcb9 Refactoring query engine. 2015-01-27 20:26:31 -05:00
Ben Johnson d340ffcf3c Expression expansion and reduction. 2015-01-27 20:26:31 -05:00
David Norton 780831bb17 change LIST to SHOW 2015-01-25 22:56:20 -05:00
David Norton ab39d471a3 influxql: add OFFSET 2015-01-25 15:34:49 -05:00
Cory LaNou 5c0c728fc3 merge conflict 2015-01-21 11:06:59 -07:00
dgnorton fee20908bc Merge pull request #1329 from influxdb/meta-queries
This PR adds authorization.
2015-01-21 10:00:52 -05:00
Tristan Storch 2994e52fec correction: orthography 2015-01-21 14:28:24 +01:00
David Norton 2d34c71c0c Add authorization unit tests & code review fixes 2015-01-20 23:45:18 -05:00
David Norton 1796998614 Add authorization 2015-01-20 16:33:28 -05:00
Ben Johnson 3c8c8724ed Implement full ident scanning, single quote strings. 2015-01-19 13:05:38 -07:00
Ben Johnson 81f457907f Add measurement normalization and identifier splitting. 2015-01-18 14:45:22 -07:00
David Norton 9e3ca7b569 influxql: add LIST USERS statement 2015-01-14 11:53:17 -05:00
David Norton 012b41e5ca influxql: add DROP RETENTION POLICY statement 2015-01-13 16:46:07 -05:00
David Norton d514cd03c8 influxql: add LIST RETENTION POLICIES statement 2015-01-13 15:40:43 -05:00
David Norton ccab32f33e influxql: add WITH to CREATE USER & cleanup 2015-01-09 18:21:12 -05:00
David Norton 05e2bff6c4 influxql: add LIST DATABASES statement 2015-01-09 18:21:12 -05:00
David Norton 877f35ae57 influxql: sort node lists in ast.go 2015-01-09 18:21:12 -05:00
David Norton f23417fa5a influxql: add CREATE CONTINUOUS QUERY, : separator 2015-01-09 18:21:12 -05:00
David Norton d927573b3a influxql: use strconv.Itoa instead of FormatInt 2015-01-05 15:37:18 -05:00
David Norton d6aa34e840 influxql: add ALTER RETENTION POLICY statement 2015-01-05 13:24:50 -05:00
David Norton 7443e1323a influxql: add DROP USER statement 2015-01-04 22:56:25 -05:00
David Norton e62efba6ed influxql: add DROP DATABASE statement 2015-01-04 22:32:49 -05:00
David Norton 96e8f96d13 influxql: add CREATE RETENTION POLICY statement 2015-01-04 21:50:56 -05:00
David Norton 09a8a925e8 influxql: add REVOKE statement 2015-01-03 02:06:47 -05:00
David Norton 87922c4202 influxql: add GRANT statement 2015-01-03 02:06:47 -05:00
David Norton 03694fd6c0 influxql: add CREATE USER statement 2015-01-03 02:06:47 -05:00
David Norton 4739cc8c1d remove RETENTION POLICY from CREATE DATABASE 2015-01-03 02:06:47 -05:00
David Norton 4ede864d13 influxql: add CREATE DATABASE 2015-01-03 02:06:47 -05:00
Philip O'Toole ba0745e244 Fix comment for filterExprBySource 2014-12-31 14:35:30 -08:00
Heon Jeong 5736cbe2fc Fix not to reuse unfiltered expr for filterExprBySource
`return expr` in the last line of `filterExprBySource` can
return unfiltered results, so fixing it by reconstruction
using filtered elements.

also added a test which can cause this problem.
2014-12-30 09:57:45 +09:00
Ben Johnson fdd65116b4 Add Rewriter. 2014-12-21 15:18:55 -07:00
Ben Johnson bd79d70f50 Add absolute time support.
This commit adds the ability to specify time by duration since epoch.

Example:

	SELECT * FROM cpu WHERE time > 1388534400s
2014-12-21 11:07:14 -07:00
Ben Johnson 2564933639 Add date-only parsing.
This commit changes the Parser to check for date-only formatted strings instead of only
datetime formatted strings.
2014-12-21 10:59:36 -07:00
Ben Johnson 4d0cf4e47b Fix syntax error. 2014-12-21 10:40:39 -07:00
Ben Johnson f5a3e9bf15 Code review fixes. 2014-12-21 10:05:15 -07:00
Ben Johnson 6c6bb92a1b Add join support.
This commit adds the ability to join multiple measurements together and calculate aggregate
function expressions.
2014-12-19 21:36:52 -07:00
Ben Johnson 925abdcb67 Merge pull request #1232 from influxdb/planner
Add time range extraction and interval grouping support to execution engine.
2014-12-16 15:08:48 -07:00
Ben Johnson 9bcc48f8f9 Code review fixes. 2014-12-16 08:50:30 -07:00
David Norton 3deb2bb132 go fmt 2014-12-16 09:06:51 -05:00
David Norton 4ce9b2bd74 influxql: add LIST MEASUREMENTS, TAGS, & FIELDS 2014-12-16 09:06:51 -05:00
David Norton 6f3ba3efdb influxql: change ORDER BY to accept a field list
Change ORDER BY to accept a field list and change LIST SERIES
statement to allow ORDER BY.
2014-12-16 09:06:51 -05:00
David Norton 0f3ea136be influxql: make LIST SERIES support WHERE & LIMIT 2014-12-16 09:06:51 -05:00
Ben Johnson 38263e0fac Add time range extraction and group by support to execution engine. 2014-12-15 08:34:32 -07:00
Ben Johnson f469097e8b Add ability to fold without now(). 2014-12-11 09:58:33 -07:00
Ben Johnson e854b913e5 Add constant folding. 2014-12-10 23:32:45 -07:00
Ben Johnson b349394d3c NOTES 2014-12-10 07:44:52 -07:00
Ben Johnson d69691e6c5 Refactor planner. 2014-12-09 08:45:29 -07:00
Ben Johnson c77191b282 Rebuilding engine in influxql. 2014-12-07 22:08:39 -07:00
Ben Johnson d34bc1f57f Add AST string encoding, substatement extraction. 2014-12-06 11:17:58 -07:00
Ben Johnson 0b07cec7f4 Merge branch 'master' of https://github.com/influxdb/influxdb into planner 2014-11-30 15:52:20 -07:00
Ben Johnson a41e539458 Initial query planner. 2014-11-30 15:52:00 -07:00
David Norton 26ecd06ef5 Change Wild to Wildcard and move test 2014-11-25 18:23:10 -05:00
David Norton f8073bf287 Make influxql parse SELECT * 2014-11-25 17:43:22 -05:00
Ben Johnson 4992a006e4 Add ParenExpr. 2014-11-24 23:12:32 -07:00
Ben Johnson 143f8a0fd5 Add CREATE CONTINUOUS QUERY parsing. 2014-11-24 21:49:09 -07:00
Ben Johnson 7288a778c3 Add influxql.Call. 2014-11-24 20:43:23 -07:00
Ben Johnson cfc20e0447 Change DROP CONTINUOUS QUERY to use a query name. 2014-11-24 17:58:21 -07:00
Ben Johnson 91f16db3af Add LIST/DROP SERIES and LIST/DROP CONTINUOUS QUERIES. 2014-11-22 16:33:21 -07:00
Ben Johnson 6ef8d4634a Add influxql parser. 2014-11-21 21:12:48 -07:00
Ben Johnson 0e9a74294e Add InfluxQL AST and tokens. 2014-11-15 12:04:30 -07:00