Commit Graph

530 Commits (ad35dcea3866d759dbff16255b0a3b9b2d32e8e0)

Author SHA1 Message Date
Haneysmith, Nathan 2c896cbcd8 docs tweaks for new syntax show retention policies 2015-07-22 15:46:42 -07:00
Josh Horwitz 96938e8a2b Added check for escaped single quote in string 2015-07-22 17:47:48 -04:00
Jason Wilder c8e17cb4b2 Fix querying fields with spaces and quotes 2015-07-22 14:50:14 -06:00
Philip O'Toole 42b4a0b8bf string return is totally unused 2015-07-22 02:55:13 -07:00
Philip O'Toole 45dcf9960c Optimize the very inner loop of cursor iteration
This change moves tracking of next timestamp and values to simple
slices, as performance measurement showed that Peek() on TagSet cursors
was a huge performance drain. There is much more that can be done here,
but with this in place query performance has been restored to 0.9.1
levels.

This change also uses -1 to indicate that no value is available for a
given timestamp.
2015-07-22 02:55:09 -07:00
gunnaraasen acc277ec8e Redact passwords from create user and set password statements 2015-07-21 17:53:21 -07:00
gunnaraasen eca76ed7a3 Parser fix, only allow ORDER BY clause with time ASC 2015-07-21 12:07:56 -07:00
Philip O'Toole f549910a18 Merge pull request #3279 from LK4D4/fix_style_else
Fix style issues with else
2015-07-17 11:53:42 -07:00
gunnaraasen 9ba37325f6 Fixes authorization.
Adds GRANT and REVOKE statements for admin privilege. Adds authorization to the query endpoint.
2015-07-17 11:33:06 -07:00
Alexander Morozov 675eacbf2c Fix style issues with else
In go it's better to just continue flow without "else", if it is return in
"if" statement.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-17 11:10:23 -07:00
Robert Nubel 930a1aa523 Require a regex after a regex operator when parsing.
Previously, parseRegex could return an empty RegexLiteral
and the expression parser would put that into the right-hand
side of the expression, causing a nil-pointer panic when
the query was later executed. This change adds a check at
the parsing level and returns an error message if a regex
operator (e.g. =~) is not followed by an actual regex.
2015-07-17 11:02:45 -07:00
gunnaraasen ee8ba11c4f Add ON token to SHOW RETENTION POLICIES parser with tests 2015-07-16 13:45:50 -07:00
Philip O'Toole 74cb96646c Refactor query engine for distributed query support
With this change, the query engine code gathers information about
shards and tagsets by working with individual shards, collating the
information, and returning that to the client. It does not assume that any
particular shard is local, and accesses all shards through abstracted
Mappers, of which there are two types -- a Mapper type for Raw queries
and a second type for Aggregate queries. There are corresponding
Executors for each type of Mapper, but both types of Executors share the
same interface.
2015-07-15 12:54:55 -07:00
Philip O'Toole 3967ec02d0 Add SLIMIT and SOFFSET to string version of AST 2015-07-15 09:43:24 -07:00
David Norton debc3cc11c fix #3102: add authentication cache 2015-06-30 18:29:11 -04:00
Jason Wilder 258f0fcdfa Merge pull request #3150 from dahankzter/master
Code style fix after review of #2956
2015-06-29 16:15:39 -06:00
Joseph Crail 5fccee3d16 Fix spelling errors in comments and strings. 2015-06-28 02:54:34 -04:00
Henrik Johansson 3353e16b59 Code style fix after review of #2956 2015-06-26 08:56:22 +02:00
Henrik Johansson 0c59240e80 Review fixes for #2956 2015-06-25 14:43:22 -06:00
Henrik Johansson 8bb2fc52a9 Reverted the addition of extra function to the ast for #2956.
Accidentally added due to ignorance really.
2015-06-25 14:43:22 -06:00
Henrik Johansson 41218f1a66 Fixed #2956 2015-06-25 14:42:53 -06:00
Henrik Johansson 2802047e68 Added failing test for #2956 2015-06-25 14:42:53 -06:00
Dejan Golja 000d6b8b0b added tests for SHOW GRANTS FOR statements 2015-06-17 01:24:09 +10:00
Dejan Golja f133ceb350 Added support for SHOW GRANTS FOR USER syntax 2015-06-17 01:00:26 +10:00
林芳荣 63174e0dbf merge 2015-06-12 23:43:18 +08:00
Philip O'Toole be5491ea77 Merge pull request #2918 from pradeepchhetri/master
Fixed some typos
2015-06-11 18:28:24 -07:00
Jason Wilder ad02244863 Fix field type conflict error
Fixes #2908
2015-06-11 11:02:10 -06:00
Pradeep Chhetri 37750acef6 Fixed some Typos 2015-06-11 17:33:26 +05:45
linfangrong a2c31264e4 Update functions.go 2015-06-11 19:45:05 +08:00
Philip O'Toole cdf7188259 Only ORDER BY ASC is valid for now
Fix issue #2731
2015-06-11 00:51:44 -07:00
Paul Dix a2488ab8a5 Merge pull request #2804 from nvcook42/master
Time literals should use single quotes in String representation
2015-06-10 21:09:21 -07:00
David Norton ef8372766f hard code DataType values 2015-06-10 16:09:23 -04:00
David Norton 29777f2a8e change influxql DataType from string to int 2015-06-10 16:02:26 -04:00
Todd Persen 258ae9c9ca Merge pull request #2859 from influxdb/fix-2845
fix #2845: fix panic on aggregate functions
2015-06-09 22:42:36 -07:00
Philip O'Toole 7ff2fdfcb4 Initialize influxql test data 2015-06-09 22:38:11 -07:00
David Norton 843ef41cc9 fix #2845: fix panic on aggregate functions 2015-06-09 18:29:54 -04:00
Cory LaNou 709a7ffd06 add where clause integration tests, add support for int64 comparisons 2015-06-09 15:45:00 -05:00
Nathaniel Cook 4d1d9c5015 update tests for single quotes 2015-06-06 15:03:06 -06:00
Nathaniel Cook bf666b7f15 time literals should use single quotes 2015-06-06 14:57:37 -06:00
Ben Johnson b925e1c1af Multi-node clustering.
This commit adds the ability to cluster multiple nodes together to share
the same metadata through raft consensus.
2015-06-05 14:41:19 -06:00
Ben Johnson 44d38cb430 Merge branch 'master' into alpha1 2015-06-02 10:40:52 -06:00
Paul Dix 4a1ce77090 Wire up DROP SERIES.
* Pulled over updates to ast and parser from master
* Updated store and shard to be able to drop series
* Pulled updates to database.go from master into tsdb/meta.go
2015-06-02 11:20:20 -04:00
Ben Johnson 8c8a55a737 Removed 'failed' from test suite. 2015-05-30 08:59:27 -06:00
Ben Johnson 6677ea074f more services, more test fixes, getting closer... 2015-05-29 14:59:57 -06:00
Ben Johnson 1f294ce8de Add httpd.Handler.serveQuery() tests. 2015-05-29 14:59:57 -06:00
Paul Dix 072dacc1ab Update tx.go to work with tsdb 2015-05-29 14:59:57 -06:00
Ben Johnson 75ab63b538 Refactor meta statement execution to meta.StatementExecutor. 2015-05-29 14:54:04 -06:00
Cory LaNou aa450b7483 fix vet errors 2015-05-28 10:58:39 -06:00
gunnaraasen a849d16826 Add int_lit as unary expression 2015-05-27 09:35:29 -07:00
gunnaraasen 5ae912a2c1 Disallow 0 at the start of an integer 2015-05-27 09:30:22 -07:00
gunnaraasen 751e09f388 Changed definition of ascii_letter and decimal_digit to letter and digit 2015-05-27 09:30:09 -07:00
gunnaraasen 0844149b7a Clean up literal definitions, especially for integers and floats 2015-05-27 09:29:54 -07:00
gunnaraasen 720f3bdc50 Removed db_name section and updated the identifier section 2015-05-27 09:29:41 -07:00
David Norton 0a8be47ca1 fix #2644: make SHOW FIELD KEYS FROM /regex/ work 2015-05-27 10:26:32 -04:00
David Norton 8866c09e67 fix #2644: make SHOW SERIES FROM /<regex>/ work 2015-05-27 10:26:04 -04:00
David Norton cc8f5771fa fix #2644: make SHOW TAG VALUES FROM /regex/ work 2015-05-27 10:25:26 -04:00
David Norton fe99177fb3 fix #2644: make SHOW TAG KEYS FROM /<regex>/ work 2015-05-27 10:22:22 -04:00
Todd Persen 99cb11de49 Merge pull request #1997 from influxdb/fix-1997-include-tags-in-select-wildcard
Update SELECT * to return tag values
2015-05-25 23:35:14 -07:00
David Norton e4670cb934 fix #2635: Fix query against bool field in WHERE 2015-05-24 05:00:59 -04:00
Todd Persen ae6d82c8de Fix AST test for `SELECT *` rewrite. 2015-05-22 13:56:11 -07:00
Todd Persen fec08fc858 Include tags when doing a `SELECT *`. 2015-05-22 13:38:28 -07:00
Todd Persen 37c47e36d5 Merge pull request #2624 from influxdb/fix-2563-remove-drop-series-id
Remove references to SeriesID in `DROP SERIES` handlers.
2015-05-21 13:14:29 -07:00
Todd Persen 074b3bf099 Update the way that `DROP SERIES` handles `Sources` 2015-05-21 12:38:35 -07:00
Todd Persen 7828af48fd Make `DROP SERIES` take `Sources` instead of `Source` 2015-05-21 11:18:21 -07:00
Todd Persen 344db8ff1e Fix up parser and handle new error message. 2015-05-20 14:55:19 -07:00
Todd Persen e7c40e5cae Remove references to SeriesID in `DROP SERIES` handlers. 2015-05-20 14:27:33 -07:00
Cory LaNou f21f72189b fmt 2015-05-20 14:15:33 -06:00
Todd Persen 9c8f42f133 Minor beautification. 2015-05-20 12:02:49 -07:00
Todd Persen a88380b465 Allow tags to be selected in queries. 2015-05-20 11:35:41 -07:00
Todd Persen ef178dd4d3 Fix typos in comments. 2015-05-20 11:06:20 -07:00
Cory LaNou d6c7130721 more derivative tests 2015-05-19 16:25:23 -06:00
Cory LaNou 37e677a639 better validation for arguments for [non]derivative 2015-05-19 16:17:36 -06:00
Cory LaNou 8d17c01b20 make select count(distinct(field)) work 2015-05-19 13:15:14 -06:00
Cory LaNou b71540e57b fix validateCountDistinct 2015-05-19 12:43:16 -06:00
Cory LaNou ca11be338f add MapCountDistinct/ReduceCountDistinct function tests 2015-05-19 12:29:39 -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 97aa735bf1 fix comment type 2015-05-19 09:16:20 -06:00
Levi Cook e8b0484859 MapDistinct return nil on empty input and TestReduceDistinct 2015-05-19 09:16:20 -06:00
Levi Cook 8d4c36c9f6 MapDistinct and distinctValues sort tests 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
Levi Cook 41775a54eb map distinct and reduce cleanup 2015-05-19 09:16:20 -06:00
Levi Cook 514dd51bc6 refactor distinctValues sorting 2015-05-19 09:16:19 -06:00
Cory LaNou 81c9c9d681 use a concrete type for distinct results from mapper 2015-05-19 09:16:19 -06:00
Cory LaNou adc0e55a15 assing -> assign 2015-05-19 09:16:19 -06:00
Cory LaNou 031596a894 support bool sort for distinct results 2015-05-19 09:16:19 -06:00
Cory LaNou 66b7157fa4 add a test that has single quoted field name 2015-05-19 09:16:19 -06:00
Cory LaNou 69ff1d2c61 allow for a quoted field name in distinct 2015-05-19 09:16:19 -06:00
Cory LaNou 5842321361 allow distinct to work on strings and be sorted 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 61712d82fb Prevent division by 0 for derivative 2015-05-14 16:13:09 -06: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
Jason Wilder 9c0584325f Add support for parsing derivative w/ nested functions 2015-05-13 15:35:42 -06:00
Paul Dix 2e57952903 Merge pull request #2547 from neonstalwart/fix/2487
handle aggregations with 0 intervals
2015-05-12 16:42:14 -04:00
ben hockey 8e02595b3e handle aggregations with 0 intervals 2015-05-12 15:21:31 -05:00
Philip O'Toole 8ac6d80016 Numeric fields only when using numeric aggregates 2015-05-12 13:20:33 -07: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 882c5e1d75 add index to test log output 2015-05-11 18:06:51 -06:00
Cory LaNou 93760c8679 update comment and changelog for count -> aggregate 2015-05-11 18:00:59 -06:00
Cory LaNou 7963a85914 no longer need hasCount 2015-05-11 17:48:37 -06:00
Cory LaNou cebdfea737 any aggregate function that has a group by time without a where time clause should fail 2015-05-11 17:48:37 -06:00
Cory LaNou 0155f8bb6d hasWhereTime -> hasTimeDimensions 2015-05-11 17:48:21 -06:00
Cory LaNou 832ca01cd3 learn to spell claus 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
Todd Persen 730e8cdfd4 Merge pull request #2405 from neonstalwart/time
change timestamp to time
2015-05-11 12:38:00 -07:00
ben hockey 9a3c28748c change timestamp to time 2015-05-11 12:28:47 -05:00
Can ZHANG 0aff0deaf2 Fix inconsistent data type 2015-05-09 08:51:56 +08:00
Todd Persen 10285b6194 Merge pull request #2488 from influxdb/fix-2281
fix #2281: passthru escapes when parsing regex
2015-05-05 19:59:10 -07:00
ben hockey e20444fe45 add some tests for getSortedRange and improve efficiency of partitioning 2015-05-04 16:59:39 -05:00
David Norton 775e3d9e55 fix #2281: passthru escapes when parsing regex 2015-05-04 16:04:12 -04:00
ben hockey c47f803699 add some documentation for getSortedRange 2015-05-04 11:09:49 -05:00
ben hockey 40af5fd1e3 implemented median aggregation 2015-05-04 11:09:48 -05:00
ben hockey ce54004961 normalize Call.Name to be lowercase 2015-05-01 12:05:55 -05:00
Philip O'Toole e413539389 Merge pull request #2451 from marcosnils/influxql_fix
Update create user statement example.
2015-04-30 18:50:46 -07:00
Paul Dix 8d91b75a5a Merge pull request #2354 from neonstalwart/stddev
make stddev work
2015-04-29 15:27:26 -07:00
Marcos Lilljedahl e74e75821e Update create user statement example. 2015-04-29 15:38:20 -03:00
Jason Wilder 8174f6fb05 Fix panic: interface conversion: interface is nil, not []interface {}
Fixes #2374
2015-04-23 11:18:19 -06:00
Jason Wilder 155adb7d24 Fix panic: runtime error: index out of range
Fixes #2374
2015-04-23 11:18:19 -06:00
Jason Wilder d0cc98356b Fix error calling MarshalJSON for type *influxdb.Result: json: unsupported value: NaN
If the MapMean did not have any values in the iterator, it would return
and empty meanMapOutput().  ReduceMean would in turn divider the results
by an unitialized float64 producing a NaN.  NaN is not serializable to JSON
by default.
2015-04-23 11:18:19 -06:00
ben hockey 762a77079a unmarshal stddev appropriately 2015-04-23 10:49:24 -05:00
ben hockey 23c38fb03c get stddev working
this includes avoiding overflow for large values
2015-04-23 10:49:24 -05:00
ben hockey 94030b2782 return the values from stddev mapper function 2015-04-23 10:49:24 -05:00
ben hockey 91db81f374 calculate mean without causing overflow 2015-04-22 11:40:16 -05:00
Jason Wilder 406a951718 Fix comments 2015-04-21 13:39:58 -06:00
Jason Wilder 90e3059a8b Fix processRawQuery from returning duplicate data 2015-04-21 13:39:58 -06:00
Marcos Lilljedahl 2bac1a8097 Add test for REGEX operators 2015-04-20 19:43:06 -03:00
David Norton 86db3574ad fix #2286: parse error on CREATE CONTINUOUS QUERY 2015-04-17 16:40:29 -04:00
Philip O'Toole d21a9493c6 Remove debug commit 2015-04-16 11:50:47 -07:00
ben hockey d993a3f36b use nil as default return value for MapCount
fixes #2271
2015-04-15 11:55:07 -07:00
David Norton 66b8cc02aa fix #2268: code review changes 2015-04-15 13:52:18 -04:00
David Norton 1e7b132f96 fix #2268: make ugly code pretty 2015-04-15 13:25:49 -04:00
David Norton 3739433f0c fix #2268: fix expression parsing bug
Parsing:

WHERE time > now() - 2d AND time < now() + 10d

generated an expression tree that evaluated as:

... AND (time < now()) + 10d

instead of:

... AND time < (now() + 10d)
2015-04-15 12:37:19 -04:00