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