Commit Graph

175 Commits (8ed55e72b85b0807c97d3d1d7d12e9f07c9737e9)

Author SHA1 Message Date
Jonathan A. Sternberg 062fab8f59 Add test cases for older issues that are now resolved
The test cases demonstrate that the following issues are resolved
through some newer features.

Related to #813, #5095, #2467, #5345, and #5150.
2017-05-18 16:49:45 -05:00
Jonathan A. Sternberg df30a4d9c9 Refactor the subquery code and fix outer condition queries
This change refactors the subquery code into a separate builder class to
help allow for more reuse and make the functions smaller and easier to
read.

The previous function that handled most of the code was too big and
impossible to reason through.

This also goes and replaces the complicated logic of aggregates that had
a subquery source with the simpler IteratorMapper. I think the overhead
from the IteratorMapper will be more, but I also believe that the actual
code is simpler and more robust to produce more accurate answers. It
might be a future project to optimize that section of code, but I don't
have any actual numbers for the efficiency of one method and I believe
accuracy and code clarity may be more important at the moment since I am
otherwise incapable of reading my own code.
2017-04-28 17:12:32 -05:00
Jonathan A. Sternberg addc12561f Fix LIMIT and OFFSET for certain aggregate queries
When LIMIT and OFFSET were used with any functions that were not handled
directly by the query engine (anything other than count, max, min, mean,
first, or last), the input to the function would be limited instead of
receiving the full stream of values it was supposed to receive.

This also fixes a bug that caused the server to hang when LIMIT and
OFFSET were used with a selector. When using a selector, the limit and
offset should be handled before the points go to the auxiliary iterator
to be split into different iterators. Limiting happened afterwards which
caused the auxiliary iterator to hang forever.
2017-04-28 15:55:06 -05:00
Jonathan A. Sternberg be3bce5212 top() and bottom() now returns the time for every point
`top()` and `bottom()` will now organize the points by time and also
keep the points original time even when a time grouping is used. At the
same time, `top()` and `bottom()` will no longer honor any fill options
that are present since they don't really make sense for these specific
functions.

This also fixes the aggregate and selectors to honor the ordered
iterator option so iterator remain ordered and to also respect the
buckets that are created by the final dimensions of the query so that
two buckets don't overlap each other within the same reducer. A test has
been added for this situation. This should clarify and encourage the use
of the ordered attribute within the query engine.
2017-04-26 15:07:10 -05:00
Jonathan A. Sternberg 4776b216a4 Merge pull request #8253 from influxdata/js-8065-restrict-top-bottom-query
Restrict top() and bottom() selectors to be used with no other functions
2017-04-26 15:06:30 -05:00
Jonathan A. Sternberg 1300f4cc6c Remove the admin UI 2017-04-25 16:58:24 -05:00
Jonathan A. Sternberg 57a2abbc87 Restrict top() and bottom() selectors to be used with no other functions 2017-04-14 10:23:07 -05:00
Edd Robinson fddaff2cc8 Merge master in 2017-03-29 18:00:28 +01:00
Edd Robinson 7644ab1fc4 Fix race in test helpers. Fixes #8177 2017-03-29 12:31:04 +01:00
Jonathan A. Sternberg 7e0ed1f5e5 Ensure the input for certain functions in the query engine are ordered
The following functions require ordered input but were not guaranteed to
received ordered input:

* `distinct()`
* `sample()`
* `holt_winters()`
* `holt_winters_with_fit()`
* `derivative()`
* `non_negative_derivative()`
* `difference()`
* `moving_average()`
* `elapsed()`
* `cumulative_sum()`
* `top()`
* `bottom()`

These function calls have now been modified to request that their input
be ordered by the query engine. This will prevent the improper output
that could have been caused by multiple series being merged together or
multiple shards being merged together potentially incorrectly when no
time grouping was specified.

Two additional functions were already correct to begin with (so there
are no bugs with these two, but I'm including their names for
completeness).

* `median()`
* `percentile()`
2017-03-28 13:55:37 -05:00
Jonathan A. Sternberg 24109468c3 Merge pull request #8168 from influxdata/js-8167-math-with-multiple-selectors
Fix a regression when math was used with selectors
2017-03-28 13:31:57 -05: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 b14c292cba Fix a regression when math was used with selectors
If there were multiple selectors and math, the query engine would
mistakenly think it was the only selector in the query and would not
match their timestamps.

Fixed the query engine to pass whether the selector should be treated as
a selector so queries like `max(value) * 1, min(value) * 1` will match
the timestamps of the result.
2017-03-27 14:12:15 -05:00
Ben Johnson d2b396bff5
Fix database series limit, remove shard series limit. 2017-03-24 13:16:00 -06: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 33981277bc Fix the time range when an exact timestamp is selected
There is a lot of confusion in the code if the range is [start, end) or
[start, end]. This is not made easier because it is acts one way in some
areas and in another way in some other areas, but it is usually [start,
end]. The `time = ?` syntax assumed that it was [start, end) and added
an extra nanosecond to the end time to accomodate for that, but the
range was actually [start, end] and that caused it to include one extra
nanosecond when it shouldn't have.

This change fixes it so exactly one timestamp is selected when `time = ?`
is used.
2017-03-21 14:55:31 -05:00
Ben Johnson 358b1e0b05
Merge remote-tracking branch 'upstream/master' into tsi 2017-03-15 10:13:32 -06:00
Jason Wilder e62c72d1f9 Merge branch '1.2' into jw-merge-12 2017-03-14 15:15:50 -06:00
Jason Wilder 675d7c9d65 Merge branch '1.2' into jw-merge12 2017-03-06 11:09:05 -07:00
Jason Wilder 524169b814 Move integration tests to tests dir 2017-02-15 10:37:29 -07:00
Jason Wilder 4c3f605256 Remote everything in tests dir
Lots of old cruft.  Integeration tests will be moved here shortly.
2017-02-15 10:13:49 -07:00
Ben Johnson 5a0d1ab7c1 rename influxdb/influxdb to influxdata/influxdb
This commit changes all the import and URL references from:

    github.com/influxdb/influxdb

to:

    github.com/influxdata/influxdb
2016-02-10 10:26:18 -07:00
Jason Wilder 3eb82d529e Update test scripts to use measurement for JSON 2015-06-02 20:44:11 -06:00
Ben Johnson 44d38cb430 Merge branch 'master' into alpha1 2015-06-02 10:40:52 -06:00
Cory LaNou 17bdf1c114 get both json/line protocol endpoints working 2015-06-01 12:35:57 -06:00
Cory LaNou 3597565955 reading and writing yo! 2015-06-01 11:59:58 -06:00
David Norton 0fb4e14c44 fix #2564: chg name to measurement in write JSON 2015-05-21 19:05:32 -04:00
Cory LaNou 531f1e72ce add in non-distinct data to distinct seed 2015-05-19 12:29:52 -06:00
Cory LaNou dbacec690d remove trailing spaces 2015-05-19 09:16:20 -06:00
Cory LaNou c8bf5e2ee8 add bool scenarios to distinct data script 2015-05-19 09:16:19 -06:00
Cory LaNou 639311b00b some test data for working with distinct at the cli 2015-05-19 09:16:19 -06:00
ben hockey 9a3c28748c change timestamp to time 2015-05-11 12:28:47 -05:00
Cory LaNou 13f318b084 Allow http write handler to decode gzipped body 2015-04-07 10:34:55 -05:00
Cory LaNou 4e8b98702a properly submit gzipped data. 2015-04-06 15:38:14 -07:00
Cory LaNou 63ded4f3f5 update test script to read and write with gzip compression 2015-04-06 15:38:14 -07:00
Cory LaNou 3854fdfb82 Add script to show how to query for future data 2015-04-03 10:33:40 -05:00
Ben Johnson 8648f6d5e7 Add -host option to urlgen. 2015-03-16 11:27:27 -06:00
Ben Johnson 4b9a93d924 Merge branch 'master' of https://github.com/influxdb/influxdb into stateless-broker 2015-03-12 15:46:04 -06:00
Ben Johnson c7d49209e1 Update urlgen to end at current time. 2015-03-12 15:04:36 -06:00
Cory LaNou 2e9d56ff99 add shell script to input data with more variety 2015-03-12 11:17:08 -06:00
Ben Johnson 5f6bcf523f Fix broker integration bugs. 2015-03-11 12:00:45 -06:00
Joseph Rothrock 94d4287af9 rewrite urlgen in go
Fix outer enclosing json.

Add date option.
2015-03-03 12:57:01 -08:00
Joseph Rothrock b020d3f14c Rewrite urlgen in Go
Cut-n-paste Ben's code.

Fix bugs re args.

Sandardize on 1-based for time and servers.

Keep incrementing time for subsequent clients -- I don't see the
point in overwriting data.
2015-03-03 11:36:15 -08:00
Joseph Rothrock bdbb2a7503 Rewrite urlgen in Go
Issue: 1818

This is meant to replace the urlgen shell script.
2015-03-02 16:35:33 -08:00
Mark Rushakoff 666d093676 Fix urlgen to work on Ubuntu 2015-02-27 16:05:53 -08:00
Joseph Rothrock 06eac99c23 Fix timezone abbreviation.
Issue: 1784

BSD manpage for strptime sez that they don't like
most timezone abbreviations. One they do like is GMT.
2015-02-27 15:37:39 -08:00
Cory LaNou 1f38c0865e enhancing test to work with drop series bug 2015-02-26 17:10:09 -07:00
Cory LaNou 18d064afbc chmod +x tests/create_write_single_with_multiple_tags_query.sh 2015-02-24 17:11:14 -07:00
Cory LaNou d03fcbb7cf add shell test that inserts multiple tags 2015-02-24 17:01:16 -07:00
Cory LaNou 3551856566 Update tests to insert with fields, not values 2015-02-24 10:32:39 -07:00
Cory LaNou f19276d365 clarifying echo message 2015-02-04 16:22:12 -07:00
Cory LaNou 9fbdd33fae and integration test that validates gzip 2015-02-04 16:20:28 -07:00
Cory LaNou 78ed56a416 add more curl seed scripts, update tmux test to use dedicated seed script 2015-02-04 13:52:47 -07:00
Cory LaNou fa675c4181 update test 2015-02-04 10:25:38 -07:00
Ben Johnson 98421f6ccc Merge branch 'master' into batch
Conflicts:
	server.go
	tests/siege/urlgen
2015-02-02 20:57:05 -07:00
Paul Dix 4ce5a637bb Rename create_write_query and make executable. 2015-01-29 21:34:52 -05:00
Peter C. Norton f5247cb8f3 Remove more ksh/bash-isms 2015-01-29 13:01:55 -05:00
Peter C. Norton 1b645b0d52 Fix tests/seige/urlgen for non-macs
Should address https://github.com/influxdb/influxdb/issues/1437
2015-01-29 12:08:49 -05:00
Ben Johnson b1417eaeb9 Update urlgen to do batching. 2015-01-29 02:13:57 -05:00
Ben Johnson 1d587f9c1d Add siege script and url generation. 2015-01-29 01:10:10 -05:00
Ben Johnson 03134ec83e Add urlgen. 2015-01-29 00:47:19 -05:00
Philip O'Toole 0cca0e5267 Don't index configs, just use port number 2015-01-28 14:32:23 -08:00
Philip O'Toole bfef027606 Use absolute paths in multi-node configs 2015-01-28 14:23:56 -08:00
Ben Johnson 0c64014fac Add additional broker HTTP redirection. 2015-01-28 03:41:28 -05:00
Ben Johnson ef50a180b4 Fix measurement persistence. 2015-01-28 02:53:16 -05:00
Ben Johnson dc6afbd2e2 Fix metastore copy. 2015-01-28 01:51:08 -05:00
Philip O'Toole c428879891 Use --data-urlencode with each URL parameter 2015-01-27 18:29:16 -08:00
Cory LaNou 6917750028 timestamp closer to today 2015-01-26 15:13:26 -07:00
Cory LaNou e972d6c030 generating sample json for metrics 2015-01-26 12:01:50 -07:00
Cory LaNou d985818976 hostname is not needed for testing configs 2015-01-26 11:04:00 -07:00
Cory LaNou 90c5307a61 now able to spin up 3 servers 2015-01-26 10:44:06 -07:00
Cory LaNou fb29f887b5 mocking out some tmux testing. all wip 2015-01-24 19:02:45 -07:00
Todd Persen e7cdd48831 Fix typo in first echo 2015-01-23 11:14:02 -05:00
Cory LaNou d3f0b8ac6b adding readme to tests 2015-01-22 14:03:49 -07:00
Cory LaNou 60043b76a5 format your code 2015-01-22 10:26:08 -07:00