Commit Graph

789 Commits (99cfbfe8cf8f1c857c888aa633cc656507955c8b)

Author SHA1 Message Date
Adam 1d84bf6516 fix(stdlib/testing): skip flaky test regexp_replaceAllString 2019-06-18 16:25:59 -04:00
roshie548 15f66d1b98 moved field declaration line 2019-06-18 08:51:34 -07:00
roshie548 f45d616eaa added test case 2019-06-18 08:51:34 -07:00
roshie548 13b397bb3c fix(stdlib): Fixed to() creating too many rows for multiple fields
If a table has multiple field values, to() no longer writes rows multiple times.
2019-06-18 08:51:34 -07:00
Christopher Wolff e495ca3e27 fix(query): recover from panics during compiler and start steps
Fixes influxdata/idpe#3409.
2019-06-11 08:41:13 -07:00
Jonathan A. Sternberg 65dabb0774
Merge branch 'master' into flux-staging 2019-06-06 11:22:04 -05:00
Lorenzo Affetti 5f8796aca6
Merge pull request #14044 from influxdata/fix/gen-promql
fix(promql): synch generated code
2019-06-05 17:53:51 +02:00
Jonathan A. Sternberg 42c8ce3481
fix(query/stdlib): remove skips for tests that were flaky from table.Do (#14048) 2019-06-03 11:56:25 -05:00
Lorenzo Affetti 6e4c66e21f fix(promql): synch generated code 2019-06-03 17:47:59 +02:00
Jonathan A. Sternberg c6bb1ef4e2
fix(query/control): queue size test was flaky (#14030)
In the QueueSize test, it was possible that after the `done` channel was
closed, one of the queries from the queue would begin executing. If all
three began executing before the shutdown was done, the third would
block on attempting to send a value to the `executing` channel and it
would never finish so the controller would report that shutdown failed.

This increases the queue size to a combination of the concurrency quota
and the queue size so all of the started queries will never block when
sending a signal to the executing channel.
2019-05-31 08:59:45 -05:00
Christopher Wolff 6d3cf4b71e test(query): update typo in Flux in test
This test started failing as a result of influxdata/flux/#1312.
2019-05-30 16:29:31 -07:00
Jonathan A. Sternberg 2b1c1ec143
fix(storage/reads): fix the storage tables to work correctly with multiple transformations (#14016)
The storage table reader will now work correctly when there are multiple
outputs. The table interface now implements the new table and column
reader interfaces and works properly with `execute.CopyTable`. The
source uses `execute.CopyTable` to buffer the table in memory when there
are multiple output transformations.
2019-05-30 12:31:54 -05:00
Jonathan A. Sternberg c560e27e1d
chore(flux): update to Flux v0.31.1 (#14015) 2019-05-29 15:48:23 -05:00
Jonathan A. Sternberg 21c80f3e93
refactor(query/control): move the controller from flux to influxdb (#13991)
The controller implementation is primarily used by influxdb so it
shouldn't be part of the flux repository. This copies the code from flux
to influxdb so it can be removed from the next flux release.
2019-05-29 09:04:34 -05:00
Jonathan A. Sternberg ebdbc394fc
chore(flux): update to Flux v0.31.0 (#14002)
* refactor(storage/reads): update the table implementation for the interface change (#13994)

* chore(flux): update to Flux v0.31.0
2019-05-28 17:24:26 -05:00
docmerlin (j. Emrys Landivar) fa849d5c0b chore(testing) skip flakey test 2019-05-28 10:49:16 -05:00
Nathaniel Cook 8ebd6c8315 chore(query): add missing skip tests from merge 2019-05-15 10:18:08 -06:00
Lorenzo Affetti 44fb090468 test(flux/e2e): export skip list 2019-05-13 19:14:52 +02:00
Adam ae25f0c448 Merge remote-tracking branch 'origin/master' into flux-staging 2019-05-09 15:29:00 -04:00
Jonathan A. Sternberg dd56c23343
fix(query/influxql): update transpiler for moved/renamed code (#13740)
The `databases()` function was moved into the `influxdata/influxdb/v1`
package and so it wouldn't work anymore. The `percentile()` call was
changed to `quantile()` and the argument was changed to `q`. This also
updates `median()` to use `median()` since we now produce AST's and not
the spec so we can use the `median()` definition instead.
2019-05-09 11:22:32 -05:00
Adam 415f698491
Merge pull request #13830 from influxdata/fix/to_heterogeneous
Fix/to heterogeneous
2019-05-08 16:45:46 -04:00
Adam 397c33a0dc fix(stdlib/influxdata): fix influxdb.to function to process heterogeneous tables 2019-05-08 09:37:43 -04:00
jlapacik dc59629f69 fix(influxdb): better error message when range not pushed down
Fixes https://github.com/influxdata/flux/issues/1224.
2019-05-07 09:59:58 -07:00
jlapacik faab75968b refactor(storage): remove Read method from Store interface 2019-05-03 11:02:20 -07:00
jlapacik 7333847e2a refactor(influxdb): remove and/or transfer duplicated tests 2019-05-03 11:02:20 -07:00
jlapacik 0ce05e7ad6 refactor(influxdb): remove old FromProcedureSpec 2019-05-03 11:02:20 -07:00
Lorenzo Affetti 33418aac2c test(flux/e2e): skip flaky window_generate_empty test 2019-05-02 18:19:07 +02:00
jlapacik e50508a349 feat(influxdb): enable group pushdown rule
Closes #13623.
2019-05-01 10:35:10 -07:00
jlapacik 95aa194498 feat(storage): ReadGroup RPC definitions and storage reader 2019-05-01 10:35:10 -07:00
jlapacik 5f87134ca8 feat(query): physical group operation and pushdown rule
test(query): group pushdown rule
2019-05-01 10:35:10 -07:00
Jonathan A. Sternberg 1a254a3293
feat(stdlib): enable the tag keys optimization for meta queries (#13705) 2019-04-30 21:32:47 -05:00
Stuart Carnie fb39ac39ce
fix(storage): Store.Read behavior changed to return unsorted series keys
Closes #13581
2019-04-26 10:38:59 -07:00
Jonathan A. Sternberg 46d2d0012b fix(storage): translate _measurement and _field to the proper strings (#13662)
The RPC call should translate `_measurement` and `_field` to their
proper shortened byte strings when requesting the tag values.

This also fixes the planner rewrites to return the root node even when
no rewrite happened as this is required by the planner.
2019-04-26 10:36:51 -07:00
Nathaniel Cook e651b020b2 refactor(query): enable new planner rules and remove old rules 2019-04-25 11:16:11 -07:00
Ben Johnson 01bfcf822b
Merge point parse & explode (#12377)
Merge point parse & explode
2019-04-24 10:30:16 -06:00
Ben Johnson 272f340c30
Merge point parse & explode. 2019-04-24 10:12:15 -06:00
Jonathan A. Sternberg 5e77bd1e28
feat(query): implement the read tag values rpc call in the query engine (#13559)
If a pattern is seen that matches the `v1.tagValues(...)` call, then it
will be replaced with a direct RPC call to read the tag values for the
selected tag key which should be better optimized than reading from the
storage engine tsm1 files.
2019-04-23 12:56:35 -05:00
Nathaniel Cook bc17af2118
Merge pull request #13569 from influxdata/flux-staging
chore(dep): update Flux to v0.27.0
2019-04-22 18:34:39 -06:00
Kelvin Wang 7a72c363f2 remove org from bucket 2019-04-22 18:39:05 -04:00
Kelvin Wang 9d44ac3635 rename bucket organization to org 2019-04-22 18:39:01 -04:00
Nathaniel Cook a49d1696dc Merge branch 'master' into flux-staging 2019-04-22 14:25:33 -06:00
Christopher M. Wolff c9f94d4ee8
refactor(query): add parameters to query controller config (#13554)
Recently added to controller config:
  ConcurrencyQuota
  MemoryBytesQuotaPerQuery
  QueueSize
2019-04-22 12:11:32 -07:00
Jonathan A. Sternberg e5657ca62b
feat(query): implement the read tag keys rpc call in the query engine (#13513)
If a pattern is seen that matches reading the tag keys, it will be
replaced with a direct RPC call to read the tag keys which should be
better optimized than reading from the storage engine tsm1 files.
2019-04-22 14:09:44 -05:00
Jonathan A. Sternberg c98c29c1d1
feat(query): add push down rule for filters to read range procedure (#13512)
The read range procedure that uses the new rpc endpoints will now accept
filters using the same rules as the previous physical from procedure
spec.
2019-04-18 18:18:41 -05:00
Nathaniel Cook 4c77e3598b Merge branch 'master' into flux-staging 2019-04-18 11:01:22 -06:00
Nathaniel Cook 4c1cdd2095 fix(query): add panic stack to logs for query logging recovery 2019-04-18 10:57:43 -06:00
Nathaniel Cook 07f98e31e7 fix(query): fix misc tests with new master Flux 2019-04-18 10:51:35 -06:00
Todd Persen cd64ec8718 Fix typos in miscellaneous packages 2019-04-17 13:30:22 -07:00
Nathaniel Cook 8b918539db Merge branch 'master' into flux-staging 2019-04-17 12:26:10 -06:00
Mark Rushakoff d0517f288a fix(query): return statistics even in encoder error case
The ProxyQueryServiceAsyncBridge was not returning statistics when there
was an encoder error. Because the encoder was just writing to an
io.Writer, it was possible that a remote disconnect could happen and
statistics could not be reported.
2019-04-16 09:51:13 -07:00
jlapacik 89bf535602
test(stdlib): skip flaky range test (#13405) 2019-04-15 10:08:50 -07:00
Christopher M. Wolff 77f1b0da4b fix(query): re-enable some from/to bucket tests (#13334) 2019-04-12 07:15:27 -07:00
Adam 29df88127f refactor(query/preauthorizer): preauthorizer now uses a BucketsAccessed method that accepts AST (#13302) 2019-04-12 07:15:27 -07:00
jlapacik 20b492bb13 refactor(influxql): compile with planner options (#13288) 2019-04-12 07:15:27 -07:00
Christopher M. Wolff 6c3f1a05b9 refactor(query): allow code to compile despite BucketsAccessed (#13282)
BucketsAccessed doesn't work currently with a private flux.Spec.
See this issue: https://github.com/influxdata/influxdb/issues/13278

This set of changes just allows code to compile until #13278 is fixed.
Note that preauthorization is not working in the meantime.

Fixes #13275.
2019-04-12 07:15:27 -07:00
Christopher M. Wolff 5e09aa178b fix(query): make mock Query close its results channel (#13242) 2019-04-12 07:15:27 -07:00
Christopher M. Wolff 16b9158b39 refactor(task): make tasks use new Query interface (#13219)
Fixes #12883.
2019-04-12 07:15:27 -07:00
Christopher M. Wolff dec149d22d refactor(query): update testing InfluxQL testing compiler to use new interface (#13107)
Fixes influxdata/flux#1099.
2019-04-12 07:15:27 -07:00
Nathaniel Cook f37e65f26c fix(query): change logging bridge to be a service instead
It is no longer necessary for the query logging to be a bridge as the
stats are available for consumption from the ProxyQueryService.
This change changes the logging bridge to directly implement the proxy
query service instead of implementing a bridge.
2019-04-11 14:46:45 -06:00
Jacob Marble f56c42794b
chore(tracing): Cleanup (#13296)
* chore(tracing): Cleanup

* broken test

* fix unused var

* fix test
2019-04-10 19:28:21 -07:00
kelwang be674622c6
Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
kelwang d0022dfd5c
Merge pull request #13039 from zhulongcheng/rm-inmem-impl
fix(inmem): remove the old inmem implementation
2019-04-09 13:06:50 -04:00
jlapacik 8078b915fd refactor(storage): ReadFilter storage operation 2019-04-08 15:59:37 -07:00
zhulongcheng cacd6a8223 fix(inmem): replace inmem.Service with kv.Service 2019-04-08 15:18:38 +08:00
Jonathan A. Sternberg 72726cbe85
Merge branch 'master' into flux-staging 2019-04-01 10:59:43 -05:00
Lorenzo Affetti c4ae25ca39
Merge pull request #12812 from influxdata/test/memory-limits
test(launcher): test for query memory limits and launcher test helpers
2019-03-28 15:48:16 +01:00
Christopher M. Wolff f945b84642
refactor(stdlb): Change plan.PlanNode to plan.Node (#12906) 2019-03-27 14:19:04 -07:00
Nathaniel Cook ca6f2ad0c6 Merge branch 'master' into flux-staging 2019-03-27 09:42:48 -06:00
Lorenzo Affetti 90a48c74f6 test(launcher): test for query memory limits and launcher test helpers 2019-03-27 15:50:35 +01:00
Lorenzo Affetti a49bb73c04 chore: update Flux to v0.23.0 2019-03-26 18:04:18 +01:00
Christopher M. Wolff 56e688beee
fix(query): add Check method to query service interfaces (#12866)
Fixes influxdata/idpe#2756.
2019-03-25 20:05:44 -07:00
Lorenzo Affetti d18c6e5ffe
fix(query/stdlib/influxdb): return error on point explosion (#12774) 2019-03-20 15:45:31 +01:00
jlapacik adbfddb0ef
Flux staging (#12760)
* deps: update flux-staging to master of both influxdb and flux (#12698)

* test(stdlib): skip failing window test due to new trigger optimization (#12708)

* chore: update Flux to v0.22.0
2019-03-19 22:19:24 -07:00
Mark Rushakoff 490499267b fix(query): allow multiple calls to Release proxy bridge iterator
The asyncStatsResultIterator used inside QueryServiceProxyBridge assumed
that Release would only be called once. The godoc for ResultIterator
specifies that it is safe to call Release multiple times. Now, you can
do that without causing Release to block indefinitely.
2019-03-19 16:06:43 -07:00
jlapacik 9324d5c1a1
test(stdlib): skip failing window test due to new trigger optimization (#12708) 2019-03-19 09:16:47 -07:00
Jonathan A. Sternberg 862f168967
deps: update flux-staging to master of both influxdb and flux (#12698) 2019-03-18 16:13:02 -05:00
jlapacik 124a2c6b6c test(stdlib): fix mismatched planner node types (#12695) 2019-03-18 14:54:48 -05:00
Jonathan A. Sternberg 0d045630c8
fix(query): release the query results before requesting statistics (#12622)
The statistics are only finalized after release is called. Defer a call
to release to ensure they are released, but explicitly release on
success to ensure that the statistics are finalized from all sources
before returning them.
2019-03-14 11:12:53 -05:00
Jonathan A. Sternberg e3ac5ffecf
feat(query/mock): create a mock object for the query interface (#12628) 2019-03-14 11:08:48 -05:00
Kelvin Wang dcc052b1c2 fix(query): fix same bucket name with different orgs 2019-03-08 20:37:05 -05:00
Jacob Marble 603a1f26e0 use tracing.StartSpanFromContext 2019-03-07 12:12:31 -07:00
Jacob Marble ed4e3e130b return n with error 2019-03-07 12:12:31 -07:00
Jacob Marble 9541e861a3 goimports -w -local github.com/influxdata/influxdb 2019-03-07 12:12:31 -07:00
Jacob Marble 92fa813c45 add spans to multiple services 2019-03-07 12:12:31 -07:00
Christopher M. Wolff e28ecdc0e9
refactor(query): make queryd present ProxyQueryService (#12360)
Fixes influxdata/idpe#2014.
2019-03-07 07:32:13 -08:00
Jonathan A. Sternberg 9549cc4d97
fix(storage/reads): track memory allocations when reading from storage (#12404) 2019-03-06 15:29:45 -06:00
Jacob Marble b9c7ec439e
feat(influxd): Tracing refactor (#12318)
* feat(launcher): Tracing to log disabled by default

* remove traceLogger and use opentracing directly

* add Jaeger tracing

* go vet && go fmt
2019-03-04 11:48:11 -08:00
Ben Johnson 12d35f1a50
Revert "Merge point parse & explode."
This reverts commit 1004abc3e1.
2019-03-02 06:23:04 -07:00
Ben Johnson 1004abc3e1
Merge point parse & explode. 2019-03-01 15:55:37 -07:00
Jonathan A. Sternberg 70507670c3
feat(storage/reads): add scanned values and bytes metadata to the query (#12156)
This updates influxdb to use the new arbitrary metadata that can be
attached by a source and adds metadata entries for the cursor
statistics.
2019-02-25 14:44:18 -06:00
Nathaniel Cook 26e7f641b7 Merge branch 'master' into flux-staging 2019-02-25 13:00:28 -07:00
Michael Desa 0d3d0d4d78
chore(influxdb): add context to storage.PointsWriter 2019-02-25 11:11:20 -05:00
Lorenzo Affetti cf81141689
fix(e2e-tests): make task use default bucket from user fixture (#12139)
* fix(e2e-tests): make task use default bucket from user fixture

* fix(query_test): update pre-auth test now that from is bucket aware
2019-02-25 12:38:04 +01:00
Lorenzo Affetti 5369c189b0
Merge pull request #11894 from influxdata/fix/buckets-accessed
fix(query/stdlib/influxdb): make FromOpSpec a BucketAwareSpec
2019-02-25 09:16:55 +01:00
Adam 4c0262befe
test(stdlib/testing): added new test driver to run builtin tests (#11916) 2019-02-21 22:03:29 -05:00
Mark Rushakoff 0977a651df fix(task): create authorization when using token to create task 2019-02-15 12:11:55 -08:00
Lorenzo Affetti b68043ae8c fix(query/stdlib/influxdb): make FromOpSpec a BucketAwareSpec 2019-02-14 17:38:48 +01:00
Jonathan A. Sternberg f30820cb46
fix(query/influxql): normalize selectors when an interval is present (#11760)
The selector will be normalized to the start time interval when `GROUP
BY time(X)` is present in the query.
2019-02-11 10:51:59 -06:00
Christopher Wolff 698de51e67 refactor(query): update to reflect changes to windows 2019-02-08 08:39:52 -08:00
Christopher Wolff 3e8b0fe807 refactor(query): separate "from" into logical and physical procedures
Fixes influxdata/flux#270.
2019-02-07 12:59:54 -08:00
Jonathan A. Sternberg 204d919a92
refactor(query/influxql): use ast compile function from flux (#11749) 2019-02-07 10:02:23 -06:00
Jonathan A. Sternberg 8b20b52f51
refactor(query/influxql): modify the transpiler interface to produce an AST (#11662)
This refactors everything to generate and use a flux AST when
transpiling an influxql query. This also updates the spectests so they
use flux instead of writing out the AST and compare the resulting
AST's.
2019-02-06 10:18:33 -06:00
Lorenzo Affetti c0ba465604 fix: multiple compatibility issues with flux@master 2019-02-05 17:46:54 +01:00
Lorenzo Affetti ce00375298 refactor(query/stlib): move from implementation from Flux 2019-02-05 17:46:46 +01:00
Nathaniel Cook d4d8bdd3a0 refactor(query): update import path for CreateSourceFromDecoder 2019-01-22 14:36:31 -07:00
Lyon Hill c4e71bf412
Use orgID when to function reports its write buckets. (#11363)
* Use orgID when to function reports its write buckets.

fixes #11231
2019-01-22 14:13:50 -07:00
Mark Rushakoff 10b7e087e7 fix(query): improve preauthorizer errors on unknown buckets
When trying to create a task that writes to an unknown bucket,
previously the error message would resemble:

could not find bucket {<nil> 0xc0000dfcc0 <nil> 0xc0000dfce0}: <not found> bucket not found

Now print something human-readable:

could not find write bucket with filter: [Bucket Name: b, Org Name: a]: <not found> bucket not found
2019-01-18 16:22:15 -08:00
Michael Desa c60031a6b7 fix(influxdb): change resource to resource type 2019-01-15 12:57:57 -05:00
Nathaniel Cook d0603457b7 refactor(flux): make packages mirror Flux namespaces 2019-01-14 18:00:45 -07:00
Nathaniel Cook 622106caaa Merge branch 'master' into flux-staging 2019-01-14 17:03:57 -07:00
Jorge Landivar f8f1c1e7b6
Merge pull request #10954 from influxdata/feature/update_task_options
feat(tasks): update task options from api
2019-01-11 14:58:10 -06:00
Nathaniel Cook 3a2231be98 Merge branch 'master' into flux-staging 2019-01-11 13:47:49 -07:00
Nathaniel Cook 1708a41fa7 refactor: update query functions for Flux builtins 2019-01-11 13:11:57 -07:00
j. Emrys Landivar (docmerlin) a2674fa03d feat(tasks): update task options from api 2019-01-11 11:55:46 -06:00
Michael Desa 944de4157a fix(influxdb): add org id to permissions
filter out resources that have mission IDs

fix(influxdb): simplify auth check in PermissionAllowed

review(platform): update as noted in review

fix(influxdb): ensure permission has valid org id
2019-01-11 12:23:28 -05:00
jlapacik 5266cba346
deps: updates for packages and imports (#10962) 2019-01-10 14:33:25 -08:00
Jonathan A. Sternberg a59e6b8d25 refactor: rename DoArrow to Do (#2372)
See influxdata/flux#783 for details.
2019-01-10 10:30:25 -07:00
Jonathan A. Sternberg 6ccb8e8c75 refactor: convert usages of ColReader to ArrowColReader 2019-01-10 10:25:10 -07:00
Mark Rushakoff d73d73c0d4 chore: rename imports from platform to influxdb
I did this with a dumb editor macro, so some comments changed too.

Also rename root package from platform to influxdb.

In interest of minimizing risk, anyone importing the root package has
now aliased it to "platform" so that no changes beyond imports were
necessary in those files.

Lastly, replace the old platform module to local path /dev/null so that
nobody can accidentally reintroduce a platform dependency while
migrating platform code to influxdb.
2019-01-09 20:51:47 -08:00
Adam fa35dea009 feat(query/functions/tests): end to end testing is configured to run against a live storage engine.
all tests use a unique bucket based on the test file name.  copied all tests over from flux repo

the tests are currently disabled due to engine consistency issues:  https://github.com/influxdata/flux/issues/613
2019-01-07 13:05:29 -05:00
Adam 9a561f8b53 manually merged addition of secrets to launcher 2019-01-02 15:42:55 -05:00
Andrew Watkins 3429e8d0c6
feat(auth): rewrite authorization service (#2157)
* feat(view-token-overlay): add view token overlay

* test(tokens): update tests

* chore(auths): rename mock data file

* feat(token-view): clicking on description opens token view modal

* feat(token-view): add ability to close overlay

* feat(token-view): display token permissions with updated permissions shape

* feat(token-view): wip update authorization and permission shapes

* feat(auth): wip refactor auth permissions

* fix(auth): generate permissions via functions

* fix(auth): make Id ID

* chore(types): update generated client

* feat(auth): wip add user and org names to auth

* fix(user): didnt save rebase

* feat(auth): WIP refactor auth

* feat(auth): check for user existence during auth creation

* feat(auth): org must exist during auth creation

* fix(auth): pluralize telegrafs resource type

* docs(http): update swagger definition for the Authorization

* test(auth): fix broken tests

* docs(swagger): update cur_swagger Authrorizations

* fix(api): remove trace from cur_swag

* test(ui/token): update components with new generated type definitions

* feat(http): add lookup service adding names for permissions

* fix(http): remove debugging panics

* chore: go tidy

* fix: unsaved rebase

* test(idpe): add ids to Authorizations for log tests
2018-12-28 15:02:19 -08:00
Adam 6777b9676c
refactor(query/functions/outputs): refactor to.go to use arrow data … (#2131)
* refactor(query/functions/outputs): refactor to.go  to use arrow data structures

* update flux to latest master
2018-12-21 11:39:53 -05:00
Adam a20eda258d Merge remote-tracking branch 'origin/master' into flux-staging 2018-12-20 16:31:44 -05:00
Adam ad38ad8c3f Revert "refactor(cmd/influxd): move driver code for influxd main package to sub-package so it can be reused (#2077)"
This reverts commit c3c12d1517.
2018-12-20 16:29:28 -05:00
Adam c3c12d1517
refactor(cmd/influxd): move driver code for influxd main package to sub-package so it can be reused (#2077)
* refactor(cmd/influxd): move driver code for influxd main package to sub-package so it can be reused.

* chore(query/influxql): moved query_test.go and requisite files to the influxql dir to be closer to the code it tests. (#2013)
2018-12-20 16:15:40 -05:00
Christopher M. Wolff 72a0474f0a
fix(query): make databases() function embed plan.DefaultCost (#2079)
This was causing "unable to create physical plan" errors.  With this fix in place there is still an issue with with databases: influxdata/flux#583
2018-12-20 12:34:29 -08:00
Adam af0cad76ba
chore(query/influxql): moved query_test.go and requisite files to the influxql dir to be closer to the code it tests. (#2013) 2018-12-20 11:48:33 -05:00
Nathaniel Cook d6c0a393b0 Merge branch 'master' into flux-staging 2018-12-19 11:30:55 -07:00
Nathaniel Cook 61e36cbee6 chore(Makefile): add target to check generated files are accurate
A standard Makefile is used now in all subdirs that run go generate.
Make will only generate the file if its source files changed.
The checkgenerate target runs clean to ensure all targets a generated
fresh.
2018-12-18 12:54:17 -07:00
Jonathan A. Sternberg cc93531400 fix(storage): convert the storage table interface to use arrow buffers
The table interface was modified to expose the arrow buffers. The
storage table has now been converted to use this interface with the same
fixes so that it exposes arrow buffers.

The influxql package has also been updated to use the `DoArrow` method
from the `flux.Table` interface.
2018-12-18 09:47:53 -07:00
Christopher M. Wolff a28dfe8f79
fix(query): restore error messages in repl (#1936)
Fixes #1932
2018-12-13 14:11:17 -08:00
Lyon Hill f7ae8c3524
feat(api/task): Add validation for both tasks and buckets on task create (#1900)
fixes #1622
2018-12-12 16:07:40 -07:00
Christopher M. Wolff c9ec2dd07f
fix(query): set error code "invalid" when controller reports error (#1812)
Fixes flux#268
2018-12-11 07:57:32 -08:00
j. Emrys Landivar (docmerlin) 0cb888afc0 Change delay to offset in tasks to match the flux spec 2018-12-06 11:00:07 -06:00
Christopher M. Wolff f1d21b8132
refactor(query): update transpiler to reflect signature change to `group()` (#1689)
update other modules that used old syntax as well
2018-12-04 09:32:37 -08:00
jlapacik d03035df9b the final HT tests 2018-11-30 08:16:13 -08:00
Edd Robinson f7a11525d0 Ignore generated file 2018-11-30 10:54:24 +00:00
Edd Robinson 9403c1ec8e Ensure error strings not capitalised ST1005 2018-11-30 10:54:24 +00:00
Ben Johnson 0084d4d824
Remove influxdb dependency. 2018-11-29 11:44:22 -07:00
Ben Johnson ee1eaaaaae
Merge pull request #1265 from influxdata/track-scanned
Add scanned value & bytes statistics.
2018-11-28 15:59:04 -07:00
Ben Johnson 868fdbbe03
megacheck 2018-11-28 15:52:11 -07:00
jlapacik f382c3b3c7 generate derivative tests from HT
skipping these tests for now until the transpiler
adds support for derivative.
2018-11-28 14:34:32 -08:00
Ben Johnson 1862b4421d
Integrate scanned values statistics tracking. 2018-11-28 15:32:06 -07:00
Lorenzo Affetti 987370d1c9
Merge pull request #1565 from influxdata/la-median-transp
Support for median in transpiler
2018-11-27 17:38:35 +01:00
Lorenzo Affetti eda4a59c35 Support for median in transpiler 2018-11-27 17:23:29 +01:00
Mark Rushakoff a06d4dea16 refactor(query): explicitly shut down query controller
The flux query controller was updated to include a Shutdown method a
while ago. Explicitly handle query controller creation and shutdown
where applicable.

In influxd, this ensures that outstanding queries are handled before the
process dies. In tests, this ensures that query controller goroutines
aren't leaked, which drastically simplifies reading full stack traces.

This change also registers query controller metrics with the prometheus
registry in influxd.
2018-11-26 16:13:19 -08:00
jlapacik d89220fd9a transpiler test case for grouping by time interval (windowing) 2018-11-26 15:31:07 -08:00
jlapacik 2384927047 compare tables directly for generated end-to-end tests 2018-11-26 15:04:22 -08:00
Christopher M. Wolff a3ad02288b
Remove use of verbose from control.Config (#1573) 2018-11-26 16:02:41 -07:00
jlapacik 2b52224e84 update flux dependency - add missing Statistics() methods 2018-11-26 13:19:14 -08:00
jlapacik 17413276c2 update transpiler result iterators with new Statistics method 2018-11-26 12:17:16 -08:00
Michael Desa 81d1520dc6 fix(platform): keep authorization struct on proxy query request
As a result of pr https://github.com/influxdata/platform/pull/1494, idpe
broke. This PR undoes some of the work done from that PR, but fixes the
underlying issue with #1494.
2018-11-20 15:20:51 -08:00
Michael Desa 407c01cb17 fix(platform): use authorizer instead of authorizion for endpoints
feat(platform): add ToPermissions method to user resource mapping

The ToPermissions method returns a set of permissions that is granted
via a user resource mapping.

feat(bolt): resolve sessions permissions on lookup

feat(http): use authorizer instead of authorization service for write api

feat(bolt): create user resource mappings for org users in bucket create

feat(bolt): create user resource mapping for first org/user

fix(platform): use authorizer for query endpoint instead of authorization

test(http): use cmp instead of reflect for decode test
2018-11-20 10:56:58 -08:00
jlapacik f7a55a7606 transpiler test case for multiple fields in project 2018-11-16 15:05:45 -08:00
Adam 41aa5688a0
Add default column to databases and add support for `show retention policies` (#1423)
* Add default column to databases to support `show retention policies`

* add unit test for show retention policies

* update transpiler readme for show databases, show retention policies
2018-11-16 15:20:49 -05:00
Chris Goller a8c1155b21 fix(Makefile): remove old clean targets 2018-11-15 20:21:30 -06:00
Christopher M. Wolff bbd460e7d9
Add method QueryRawJSON to influxql.service (for querytest tool) (#1402) 2018-11-15 10:45:38 -08:00
Adam 2321d81291
Feat/transpiler show databases (#1363)
* feat(query): databases transformation implementation
add show databases to transpiler
2018-11-13 16:07:28 -05:00
jlapacik a86a37eb02 transpiler test case for basic group by time 2018-11-13 09:03:04 -08:00
Adam c950a6dc00
fix to transpiler result encoder when there's no _time column (#1350)
* fix to transpiler result encoder when there's no _time column
* add unit tests
2018-11-12 15:35:16 -05:00
Jonathan A. Sternberg fadf4f3e4f
deps: update flux dependency 2018-11-08 14:49:35 -06:00
Adam 2d54689eda skip generated tests in random folder due to known issue in transpiler 2018-11-06 14:04:40 -08:00
jlapacik 3a6810c7ff generated influxql json tests 2018-11-06 14:04:40 -08:00
Jonathan A. Sternberg 66920f253a
fix: show tag values must specify a range stop 2018-11-06 09:17:37 -06:00
Nathaniel Cook 9fecaa0eb0 chore: Update for Flux renaming 2018-11-05 19:30:22 -07:00
Adam 612005cad1
add output to to function (#1282)
* added (unused) stats struct, and piped written data to output table

* updated to tests since to returns data now

* changes based on review
2018-11-02 13:40:25 -04:00
Mark Rushakoff dae3dc8a7e chore(bolt,http,mock,query,testing): fix megacheck errors 2018-11-01 12:54:46 -07:00
Adam 8a1fecd727
to() for influxdb (#1194)
* update to latest flux master incl. values interface refactor, type inference, planner.  

* add measurementColumn parameter, update function params spec
2018-11-01 14:44:56 -04:00
Nathaniel Cook 2a1d76eb2d chore: Update flux dependency for the type-inference changes 2018-10-31 17:11:11 -06:00
Adam 98be8bcd32
moved to_http and to_kafka to flux and update to latest flux (#1175) 2018-10-24 12:33:43 -04:00
Lyon Hill 19b7709bad
Add tasks to the influx cli (#1163) 2018-10-23 11:51:13 -06:00
Adam ea4c08b327
(feat/query): implement a buckets() source function that retrieves all buckets and retention policy information for the active organization. (#1045) 2018-10-17 10:21:39 -04:00
Jonathan A. Sternberg e9600b1f0b
refactor: modify tooling to take advantage of go run
The generate commands have been modified to take advantage of the new
functionality in Go 1.11 that allows `go run` to execute a package
instead of individual files.

This functionality combined with Go modules allows us to execute a
package directly out of our pinned dependencies rather than accidentally
picking up another binary outside of the build environment.

This also simplifies the Makefile because they no longer have to be
responsible for installing the correct tooling since the Go command
takes care of that logic. It also makes it so that the Makefiles with
file generation can now be invoked from their appropriate subdirectories
so they are contained within the directory itself rather than relying on
values in the top level Makefile.

It is now possible to generate all files within this project by using:

    go generate ./...

Or the Makefile can continue to be used.

This commit also copies over the special copy of `tmpl` that the storage
engine uses within the influxdb repository. It was never copied over so
using `go generate` on these packages did not work.
2018-10-15 11:01:27 -05:00
Stuart Carnie 4f0c1a7aed fix(storage): Add db/rp fields for InfluxDB OSS 2018-10-11 15:19:38 -07:00
Chris Goller 2bea48f15a refactor(testing): rename MustIDFromString to MustIDBase16 2018-10-11 09:54:19 -05:00
Chris Goller 473f4e986c fix(functions/input): use 16 character hex string for test 2018-10-11 09:54:19 -05:00
Chris Goller 919aae41c8 refactor(id): update storage, read, and flux from to use IDs 2018-10-11 09:54:19 -05:00
Leonardo Di Donato 6725ae6f64 feat(platform/id): method to create an invalid id
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-10-11 09:54:18 -05:00
Leonardo Di Donato 5a0b3eb2f9 fix(cmd/influx): composite literals
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-10-11 09:54:18 -05:00
Leonardo Di Donato f42c581ad0 fix(query): edits for uint64 IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-10-11 09:54:18 -05:00
Leonardo Di Donato 92ac07ab02 wip(query): fixing platform.IDs 2018-10-11 09:54:18 -05:00
Leonardo Di Donato 19e88d6202 fix(execute_test): importing flux now not query 2018-10-11 09:54:18 -05:00
Leonardo Di Donato 8d7f06cf4b feat(platform/id): using uint64 for platform.IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-Authored-by: Lorenzo Fontana <lo@linux.com>
2018-10-11 09:54:18 -05:00
Jeff Wendling 6bd79ab2fe Remove unused grpc reader
The pb package was only referenced in cmd/influx/query.go, but in
dead code, since it uses the same machinery as the repl, which goes
through the HTTP endpoints, rather than the gRPC endpoints.
2018-10-10 14:06:27 -06:00
Adam 195eb04350
Chore/move from function to platform (#1013)
* moved execution code for from into query/functions/inputs

* rebase with master, disable buckets accessed test
2018-10-09 20:36:41 -04:00
Chris Goller 90494a5309 chore(fmt): fix and simplify go formatting 2018-10-08 17:23:54 -05:00
Brandon Farmer c1c4dc3393 Properly handle spaces in PATH with make tasks 2018-10-08 09:53:22 -07:00
Adam 58f4e9fc0b
Refactor Platform according to new organization in `flux` (#966)
We reorganized the functions in flux to have the structure:
/functions
/inputs
/transformations
/outputs
this PR catches up platform to work with the new package layout.

As a separate refactoring issue, we should discuss:

from(bucket: ) should migrate from flux --> platform
to_http and to_kafka should migrate from platform --> flux
2018-10-05 00:06:14 -04:00
Jonathan A. Sternberg 37ffbfc687
feat: add an influxql service that communicates with influxdb 1.x
It creates a simple client that follows the QueryService interface and
uses the `influxql.Compiler` type to determine where the query should be
routed to and to return the query as a `flux.ResultIterator`.

This will be useful for replaying transpiler queries against influxdb
1.x servers to verify correctness.
2018-10-03 11:17:29 -05:00
Michael Desa 1a0c29ad34 feat(platform): add authorizer interface
This iterface is supposed to be something that both sessions and
authorizations can share so that other components can authorize requests
as they see fit.
2018-10-02 14:11:44 -04:00
Chris Goller 1dd29d43f6
fix(query/docs): update Flux spec to flux repo 2018-10-01 09:38:33 -05:00
Jonathan A. Sternberg 2ee5308a27
fix: the master build no longer uses -i when building the influx binary
The `-i` flag causes a problem when a cross compilation happens because
it attempts to build files in GOROOT which is located in a directory
that is not writable by the build user. This same problem exists for
when the `-tags` are changed like adding `-tags assets` in the `all`
build that runs on the master branch.

This removes `-i` because, in the latest go release, the `-i` flag
doesn't actually do anything useful since there is another build cache
that the results are placed in regardless of whether `-i` is used.

This fixes the build on master so that `make all` and `make nightly`
will function properly.
2018-09-25 11:33:07 -05:00
Jonathan A. Sternberg 9cda24a69c
adding a test for the measurements and fixing the functionality 2018-09-25 10:25:58 -05:00
Jonathan A. Sternberg 129186efec
feat: implement basic show tag values in the transpiler 2018-09-24 15:02:05 -05:00
Jonathan A. Sternberg 46ed9bc4fb feat: switch to using go modules for building
This updates the dependency manager to use go modules instead of dep so
that we can remove dep as a dependency and we can begin using and giving
feedback on modules within this project. It should simplify dependency
management and make it faster to run the builds too.

The big change is updating the various Makefiles to stop relying on the
vendor directory because it no longer exists. This change creates a
`tools.go` file with the revisions of the tools we use that are currently
in the `required` section of `Gopkg.toml`. We are currently in other
discussions to modify how we handle tool dependency management, but this
change does not change that.
2018-09-20 08:33:15 -07:00
Jonathan A. Sternberg 0e0249ff2e
Merge pull request #839 from influxdata/js-show-tag-values-doc
docs(query/influxql): update the transpiler doc for show tag values
2018-09-17 13:45:48 -05:00
Jonathan A. Sternberg d5631c3366 docs(query/influxql): update the transpiler doc for show tag values 2018-09-14 16:59:38 -05:00
Jonathan A. Sternberg e884764664 fix(query/influxql): fix the formatting of the influxql readme
The previous format was easier to edit and I reorganized the headers.
2018-09-14 16:33:27 -05:00
Nathaniel Cook 71e13c8e8f chore: Remove redundant Flux tests 2018-09-14 15:32:15 -06:00
Nathaniel Cook d65a864ec5 fix: Update REPL to use HTTP API 2018-09-14 14:03:35 -06:00
Jonathan A. Sternberg dfc32d2635 feat(query/influxql): normalize the time for all aggregate queries
The transpiler will normalize the `_time` column by dropping any
existing time column and then duplicating `_start` when the query is an
aggregate type.

This works for the selectors because they did not normalize their
`_time` column at all and, while the aggregates did normalize their
`_time` column, we have made the decision to remove that functionality
and have aggregates not set a `_time` column at all.
2018-09-12 16:25:51 -05:00
Adam 4733ecd1f2
README + initial skeleton in place for SHOW TAG VALUES(#815)
* README + initial skeleton in place

* Fixes according to review
2018-09-12 14:54:13 -04:00
Nathaniel Cook 1786402d48 Merged pull request #822 from influxdata/nc-remove-platform
chore: Updates to be able to remove platform as a dependency of Flux
2018-09-12 10:31:25 -06:00
Nathaniel Cook 672e2d5fe7 chore: Updates to be able to remove platform as a dependency of Flux 2018-09-12 10:18:54 -06:00
Jonathan A. Sternberg 131767572e feat(query/influxql): update the spec for time normalization in selectors 2018-09-11 13:09:48 -05:00
Jonathan A. Sternberg a5641f6fd9 fix(query/influxql): join multiple aggregates with the new join function 2018-09-10 11:54:38 -05:00
Stuart Carnie 7a05dfb61e refactor: Update Makefiles 2018-09-06 13:56:59 -07:00
Stuart Carnie ac75af2f58 refactor: Migrate query package to influxdata/flux repository 2018-09-06 11:13:48 -07:00
Christopher M. Wolff 7e7c34f678
Create PreAuthorizer interface, BucketAwareOperationSpec interface (#664) 2018-09-05 12:06:26 -07:00
jlapacik 24f1be808d spec outlining packages, namespaces, and imports 2018-09-04 10:41:01 -07:00
jlapacik 2f1635a85d csv test for join 2018-09-04 10:04:01 -07:00
Nathaniel Cook 35002fa90f Merged pull request #738 from influxdata/nc-histogram
feat: Add histogram function for computing bucket based histograms
2018-09-04 09:51:32 -06:00
Jonathan A. Sternberg 1776778a06
Merge pull request #764 from influxdata/js-transpiler-pivot
docs: update the transpiler docs to use pivot
2018-09-04 09:44:06 -05:00
Christopher Wolff a58c9a63f8 Parse duration literals 2018-08-31 15:33:43 -06:00
Jonathan A. Sternberg a45bd08cf6 docs: update the transpiler docs to use pivot
Instead of generating multiple cursors, a pivot is used to join fields
within the same series.

This should be easier than generating a new cursor for everything.
2018-08-31 16:15:28 -05:00
Michael Desa 4eb2b72bf3 feat(query/influxql): implement query.ResultIterator for influxql.Response
WIP: saving state reword

feat(query/influxql): implement query.ResultIterator directly on response

review(influxql): add ResponseIterator that implement query.ResultIterator

review(influxql): update code is response to review
2018-08-31 13:38:25 -04:00
Nathaniel Cook 128b85ecd1 feat: Add histogram function for computing bucket based histograms 2018-08-31 09:43:45 -06:00
Nathaniel Cook 46a32e874c chore: Update 'from' to match spec
Removes the `db` parameter and used only bucket and bucketID.
2018-08-30 14:51:51 -06:00
Nathaniel Cook 745376a5fe Merged pull request #737 from influxdata/nc-group-missing
fix: Fix group by panic when missing a column
2018-08-30 14:38:01 -06:00
Adam 559ef60a78
feat(query): Created mapped/unmapped versions of append table and updated functions that use it (#751) 2018-08-30 15:01:27 -04:00
Adam 4bb5f5398a
feat(query/functions) Updated percentile to be more memory compact and managed by allocator (#739) 2018-08-30 13:35:04 -04:00
Adam cb3d099f6c
add query/functions/doc.go (#686)
* finished with first draft of doc.go.  Need to follow up on documenting related packages
2018-08-30 12:01:32 -04:00
Nathaniel Cook e57fab6a7b fix: Fix group by panic when missing a column 2018-08-29 15:53:47 -06:00
Jonathan A. Sternberg aa052e1a57 feat(query/plan): make it possible to configure the default memory limit for queries
The previous default was just to have no limit at all. This adds a
configuration option to the planner so a static value can be set for the
memory limit on each individual query.
2018-08-28 16:24:49 -05:00
Michael Desa 45233d939a feat(platform): add uniform query endpoint for sources
Using query request struct to query resources

Signed-off-by: Lorenzo Fontana <lo@linux.com>

Use query.ProxyRequest instead query.Request

Signed-off-by: Lorenzo Fontana <lo@linux.com>

Proxy request from idpd

Signed-off-by: Lorenzo Fontana <lo@linux.com>

Comments about the desired results

Signed-off-by: Lorenzo Fontana <lo@linux.com>

V1 endpoints working with flux

Signed-off-by: Lorenzo Fontana <lo@linux.com>

Influxql working for v1

Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Michael De Sa <mjdesa@gmail.com>

V2 influxql query endpoint working

Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Michael De Sa <mjdesa@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>

V2 Flux compiler support

Co-authored-by: Michael De Sa <mjdesa@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>

Improve comments in bolt sources and give error on self

Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Michael De Sa <mjdesa@gmail.com>

Review tests failing

Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Michael De Sa <mjdesa@gmail.com>

Avoid type casts for compiler types

Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Michael De Sa <mjdesa@gmail.com>

Using nil instead of dbrp mapping service for influxql v1

Signed-off-by: Lorenzo Fontana <lo@linux.com>

Check if compiler types are valid for influxql

Signed-off-by: Lorenzo Fontana <lo@linux.com>

Organization as query param in the flux external handler

Signed-off-by: Lorenzo Fontana <lo@linux.com>

feat(http): update swagger documentation for flux query endpoint

feat(http): document query endpoint design

The code documented does not currently work. It is indended that this
will be implemented in follow up PRs.

feat(platform): move source to platform package

The source Query endpoint implements what's in the query swagger docs

Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Michael De Sa <mjdesa@gmail.com>

feat(platform): allow for encoding and decoding of csv dialects

feat(platform): specify dialect in flux page

Co-authored-by: Andrew Watkins <andrew.watkinz@gmail.com>
Co-authored-by: Michael Desa <mjdesa@gmail.com>
2018-08-28 15:53:20 -04:00
Jonathan A. Sternberg bb4fc188a2
Merge pull request #721 from influxdata/js-query-log-statistics
fix(query): report query statistics correctly
2018-08-28 12:55:22 -05:00
Jonathan A. Sternberg 1fe16a04de fix(query): report query statistics correctly
The query statistics would only be read after the cancel call so we need
to wait for that before attempting to read the statistics rather than
attempting to read them immediately after the result is returned (before
it is read).
2018-08-28 12:39:56 -05:00
Nathaniel Cook a9f10e11a5 fix: Fixes data race on object type 2018-08-28 10:39:56 -06:00
Nathaniel Cook 5b9b111166 Merged pull request #714 from influxdata/nc-fix-query-panic
fix: Fixes panic in query from sharing builtin decls
2018-08-28 09:09:34 -06:00
Adam 05a2feb1fc
Added default signature generators for Selector and Aggregate configs and update the functions that need them (#690)
* Added default signature generators for Selector and Aggregate configs and update the functions that need them

* fix to percentile to collect the correct arguments for both aggregate and selector
2018-08-27 17:20:18 -04:00
Nathaniel Cook 796fd7217e Merged pull request #685 from influxdata/nc-hist-quantile
feat: Add histogramQuantile function
2018-08-27 14:25:35 -06:00
Nathaniel Cook 937158f63a Merged pull request #715 from influxdata/nc-data-race
fix: Fixes #697 data race in execute test
2018-08-27 14:19:59 -06:00
Nathaniel Cook 575c8138cc fix: Fixes #697 data race in execute test 2018-08-27 13:57:51 -06:00
Nathaniel Cook c6567a9ed1 fix: Fixes panic in query from sharing builtin decls 2018-08-27 13:48:13 -06:00
Jonathan A. Sternberg 22673adee7 fix(query/influxql): disable the join behavior in the transpiler
The behavior needs to be updated so we are goinig to just disable it
temporarily so bad query specs are not generated.
2018-08-27 12:41:53 -05:00
Nathaniel Cook cf072cbd4d fix: Add end to end test for histogramQuantile 2018-08-27 10:15:59 -06:00
Nathaniel Cook a2e7ba3422 Merged pull request #701 from influxdata/nc-builtins
fix: Fix missing builtins in REPL
2018-08-27 09:52:31 -06:00
Nathaniel Cook 61bc6df75b fix: Fix missing builtins in REPL
The REPL's use of the interpreter was causing it to not get the builtins
defined in builtin scripts. For example the `top` function was missing.

This change fixes the issues by ensuring the builtins are only evaluated
once and that there is only one way to get the query Interpreter that is
guaranteed to have the proper builtins.
2018-08-27 09:46:13 -06:00
Adam Perlin 015afb74db
Materialize Empty Windows (#689)
Update window to materialize all windows within bounds
2018-08-24 17:13:31 -07:00
Stuart Carnie cc88c2f608 refactor(pb): Consolidate to use refactored storage APIs from influxdb
* updated influxdata/influxdb:platform vendor dependency
2018-08-24 12:26:45 -07:00
Adam Perlin 302aaee1f5
Bounds Refactor (#675)
* Refactor bounds in planner
2018-08-23 15:58:29 -07:00
Nathaniel Cook 6e9bfacb45 feat: Add histogramQuantile function 2018-08-23 12:46:39 -06:00
Adam Perlin 1051a8d697
Add query examples to flux SPEC (#641)
* Add additional example queries to SPEC.md
2018-08-22 18:39:19 -07:00
jlapacik 178f9d3678 update links to issues in spec 2018-08-22 10:04:21 -07:00
Nathaniel Cook 2c7f6137f1 Merged pull request #665 from influxdata/aa_argNames_fix
chore(query/functions): clean up parameters to be appropriately camel…
2018-08-22 09:53:41 -06:00
Nathaniel Cook 44c3b9b962 fix: Use metadata based gRPC tracing 2018-08-20 15:52:09 -06:00
Adam 3a60e42ce6 chore(query/functions): clean up parameters to be appropriately camel-cased and with completed function signatures 2018-08-20 13:40:49 -04:00
Adam 4b4539934b
feat(query/functions): add pivot() builtin procedure
pivot() implments the ability to flatten a table according to the values in given columns
2018-08-17 16:45:15 -04:00
Adam cc5a625950
spec(query/docs) Update spec and readme for the new Pivot function (#476) 2018-08-17 16:44:29 -04:00
Adam Perlin 840077ca62
Encoding Error Tests (#653)
* Add tests for CSV encoding errors
* Update encoder error checking to use behavior pattern
2018-08-17 13:16:41 -07:00
jlapacik 09de5dbd34 design spec for to function 2018-08-17 12:32:28 -07:00
Adam Perlin 96d11c3d9f
Add Duplicate function (#575)
* Add duplicate schema mutation
2018-08-17 12:12:00 -07:00
Adam Perlin ce6195150a
Account for error from EncodeError call in result.go (#650) 2018-08-16 14:23:17 -07:00
Nathaniel Cook 735b688749 Merged pull request #448 from influxdata/nc-calendars-spec
chore: Specify calendar intervals, windowing and time zone behavior
2018-08-16 15:14:32 -06:00
Adam Perlin 4d9c6c4c39
Add errors as expected output in test framework (#627)
* Add expected error functionality to test framework; Add EncoderError
type to differentiate between encoding and execution errors
2018-08-16 12:01:20 -07:00
Jonathan A. Sternberg 1129552475 feat(query): log panics with their stacktraces within the query executor
The logger is now threaded into the query controller, executor, and the
dispatcher so that we can log panics. They are logged at the info level
because the panics do not result in the system crashing and becoming
unusable.
2018-08-15 16:03:12 -05:00
Nathaniel Cook 9c67dedbb7 add details on add/sub of durations 2018-08-15 13:39:57 -06:00
Adam Perlin 15c9be1809
Add Stream Context to Executor (#609)
Add stream context with bounds to planner/execution engine
2018-08-14 16:18:59 -07:00
Nathaniel Cook d483ac8f0f chore: Specify calendar intervals, windowing and time zone behavior
Durations are changed to be a 3 vector to form a linear basis of
seconds, days, and months.
Interval comprehensions are introduced to be able to define complex
calendar intervals.
Specification is added around time zones.

The window function is update to default to not returning incomplete
windows.
2018-08-14 15:07:03 -06:00
Jonathan A. Sternberg 27c59297bc fix(query/control): fix the queueing metric
We decremented all, but forgot to decrement queueing when it was set and
the query spec could not be validated.
2018-08-14 16:02:46 -05:00
Jonathan A. Sternberg 9f829ae5bf fix(query/control): remove a deadlock
The call to `setErr` would grab a lock that `Pop` used, but `setErr`
requires the controller run loop to be executing for it to work. If we
reverse the order of these calls, it should be fine.
2018-08-14 15:49:15 -05:00
Jonathan A. Sternberg a591f2f90b
Merge pull request #628 from influxdata/js-controller-metrics
fix(query/control): fix controller metrics
2018-08-14 12:31:43 -05:00
Jonathan A. Sternberg 46605ac6b3 fix(query/control): finish the parent span once
When the controller moves to one of the finished states, it will finish
the parent span so that can be recorded. It presently will do this
multiple times when transitioning between different finished states.
2018-08-14 11:45:25 -05:00
Jonathan A. Sternberg f6e5feacbe fix(query/control): finish the parent span if compiling or queueing fails
This normally happens within the finishing states, but when compiling or
queueing fails it never enters those finished states and is instead
discarded. We need to signal that the query itself has finished in the
metrics.
2018-08-14 11:29:34 -05:00
Adam 6329f28064
feat(query/execute): Add Grow() functions to the table builder interface (#549)
* Added GrowXX functions to allocator.go

* Added Grow functions to table builder interface
2018-08-13 20:43:44 -04:00
Jonathan A. Sternberg 3e7a04e887
Merge pull request #624 from influxdata/js-godoc-query-package
docs(query): add package docs for the packages in the query package
2018-08-13 16:07:16 -05:00
Jonathan A. Sternberg c38e68c4b1
Merge pull request #570 from influxdata/js-document-query-control-package
docs(query/control): document the query/control package
2018-08-13 15:56:22 -05:00
Jonathan A. Sternberg a563ab4f34 docs(query/control): document the query/control package
This documents the responsibilities of what the Controller does and is
expected to do. It describes some behaviors that aren't implemented, but
acts as a guide for what the Controller should do as we continue
developing the query engine and improving the internal mechanics.
2018-08-13 15:49:14 -05:00
jlapacik f1e5da8656 add day and week literals to Flux grammar 2018-08-13 13:40:43 -07:00
Jonathan A. Sternberg 73b4b1d0d8 docs(query): add package docs for the packages in the query package 2018-08-13 15:21:02 -05:00
jlapacik 27b2093116 new join implementation
This commit provides a new join implementation that can join
tables with different group keys. It also implements a strategy
for evicting stale data from the join operation's cache when
it can be determined that a table will no longer be joined.

Currently early table eviction from the buffers of the join occurs
when the left-most group key column of both input streams are equal
and that column is part of the join key.
2018-08-13 10:51:57 -07:00
Mark Rushakoff cbccbcecf5 chore: fix typo in filename 2018-08-10 08:22:47 -07:00
Nathaniel Cook 6bf2820e81 update README 2018-08-08 15:31:37 -06:00
Nathaniel Cook 5bde0b5be6 fix: Update query services to use Request type
Moves idpe.QueryService into platform/query.ProxyQueryService
Splits the Request into ProxyRequest and Request.

Changes query.QueryService and query.AsyncQueryService to use a Request
type. This means that the Compiler interface is consumed by the service
to abstract out transpilation vs Flux compilation vs raw spec.

The transpiler handler is removed.

There are separate http handlers and service implementations for each of
the three query services.

Query logging types are moved into platform.

The ResultIterator now expects Cancel to always be called.

The fluxd binary exposes the query endpoint specified in the swagger
file.
2018-08-08 15:31:35 -06:00
Christopher Wolff d7f64171cb Take into account ':<type>' when computing column header widths 2018-08-07 11:12:38 -07:00
Jonathan A. Sternberg af6fe59902
Merge pull request #541 from influxdata/js-flux-readme
docs(query): modify the flux readme to turn it into a getting started instead
2018-08-06 14:04:57 -05:00
Jonathan A. Sternberg 418d486488 docs(query): modify the flux readme to turn it into a getting started instead
For details, the user can always look at the spec, but a good getting
started guide that works is needed.

At the moment, this does not use the influx command. It does include
instructions for how to get started with docker since that is easiest to
setup and use.
2018-08-06 13:48:27 -05:00
Adam Perlin 0e80e5774b
Flux drop and rename functions (#482)
* Add Flux Rename, Drop, and Keep functions.

* Add flux language tests for drop and rename; bugfixes around constructing drop/rename procedures

* Correct autcomplete error, remove debug statements

* Fix additional autocomplete error

* Add support for fn parameter to flux drop and rename functions

* Remove unneeded renameDropTransformation field

* WIP initial thoughts about merge/procedure rewrite logic

* Remove unnecessary external columnFn types

* Add additional query tests for drop/rename, add error when drop or rename refers to column that doesn't exist

* Change swapped test names

* Add keep function implementation

* Refactor rename/drop implementation to make use of helper methods

* Remove test skips forqueries that produce an expected error

* Make predicate return value logic clearer in drop implementation

* Add group key support to drop/rename/keep, update unit and query tests accordingly

* WIP refactor drop and rename to use new SchemaMutator interface

* Add unit tests for refactored drop, keep, and rename; bug fixes

* Update file structure for flux schema mutation functions

* Refactor mutation functions and interface

* Address final review drop/rename PR review comments

* Add builtin import to make sure builtins are initialized if test drop_rename_keep_test is run as standalone

* Small aesthetic change to schema_mutators.go
2018-08-06 11:19:55 -07:00
Michael Desa 8c87c9d132 revert #442 2018-08-01 14:54:32 -04:00
Nathaniel Cook f4e94c8655 Merged pull request #525 from influxdata/nc-agg-errors
fix: More specific error messages for aggregate errors
2018-08-01 11:37:29 -06:00
Leonardo Di Donato bdaee706d6 Fixing last changes obtained from master to make them use uint64 IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-08-01 18:20:59 +02:00
Leonardo Di Donato 5addb88eb5 MustIDFromString no more requires test instance
It panics now.
2018-08-01 18:20:59 +02:00
Leonardo Di Donato 3191de776d Refactoring code using platform.IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-08-01 18:20:59 +02:00
Leonardo Di Donato 4387206181 Other test for IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-08-01 18:20:59 +02:00
Leonardo Di Donato 711d4a3f33 Refactoring main package 2018-08-01 18:20:59 +02:00
Leonardo Di Donato 0778344cb0 Refactoring query package 2018-08-01 18:20:59 +02:00
Adam Perlin 3e98846a99
Specify how group key is handled in rename/drop spec (#524)
* Specify how group key is handled in rename/drop spec
2018-08-01 09:09:45 -07:00
Nathaniel Cook 590b9e61f4 fix: More specific error messages for aggregate errors 2018-07-31 16:58:01 -06:00
Adam Perlin ee7980dd4f
Add spec for flux rename/drop function (#462)
* Add initial rename specification to SPEC.md

* Tweak language in spec to be more explicit

* Update spec to be in accordance with final design decisions
2018-07-31 14:50:59 -07:00
Jonathan A. Sternberg 322486aa59
Merge pull request #521 from influxdata/js-default-parameters-for-range-spec
fix(query/influxql): include default parameters in the range spec
2018-07-31 13:36:23 -05:00
Nathaniel Cook 2848b4bf92 Merged pull request #516 from influxdata/nc-aggregate-type-err
fix: Properly check aggregate type
2018-07-31 12:33:33 -06:00
Nathaniel Cook 67bb9a2ce8 Merged pull request #519 from influxdata/nc-storage-time-overflow
fix: Explicilty handle overflow of currentTime is storage source
2018-07-31 12:31:53 -06:00
Jonathan A. Sternberg c94fc4d799 fix(query/influxql): include default parameters in the range spec 2018-07-31 12:53:34 -05:00
Jonathan A. Sternberg ced8f461fc fix(query): fix passing down the bucket id in the from call
The bucket id was not being copied when the from procedure was being
created so it never showed up and the bucket id was not set.
2018-07-31 12:53:05 -05:00
Nathaniel Cook 1a4bd6825b fix: Explicilty handle overflow of currentTime is storage source 2018-07-31 11:32:31 -06:00
Nathaniel Cook 553b15a217 fix: Properly check aggregate type 2018-07-31 10:30:35 -06:00
Mark Rushakoff 265235aaf1 refactor(query): move DefaultCompleter method to complete package
This is so Chronograf doesn't have to import the builtin package, which
finalizes builtin registration.

Also clarify that the builtin package should only be imported from main
or test packages.
2018-07-30 10:54:06 -07:00
Nathaniel Cook 21286235dd fix: Fix deadlock in query stats 2018-07-27 14:55:38 -06:00
Jonathan A. Sternberg feea4dff2e
Merge pull request #487 from influxdata/js-benchmark-end-to-end
tests(query/functions): add benchmarks for all of the query tests
2018-07-27 14:42:50 -05:00
Nathaniel Cook 920ef30a99 Merged pull request #494 from influxdata/nc-query-panic
fix: Panic in query/controller on Statistics
2018-07-27 09:30:49 -06:00
Nathaniel Cook 47b7f512da fix: Panic in query/controller on Statistics 2018-07-27 09:15:28 -06:00
Jonathan A. Sternberg 7494972d98 tests(query/functions): add benchmarks for all of the query tests
This uses the same code as the other end to end so we can benchmark the
entire query engine.
2018-07-26 16:09:13 -05:00
jlapacik 69e3627f42 controller sets Now time before enqueuing a query 2018-07-26 10:36:19 -07:00
Adam a84c86b06d
Fix initial transpiler grouping so that aggregates will compute (#460)
* feat(query/influxql): Fix initial transpiler grouping so that aggregates will compute

 --update spec

 --add mean test to demonstrate new feature
2018-07-25 17:56:33 -04:00
Nathaniel Cook 2588b14df4 Merged pull request #436 from influxdata/nc-fix-repl-now
fix: Update REPL to correctly compile Spec with now option
2018-07-25 15:54:59 -06:00
Adam 2ee4157ded
feat(query/functions) Update percentile function to provide a selector option add transpiler support. (#444) 2018-07-25 16:32:04 -04:00
Jonathan A. Sternberg 4b7bfb21c2 fix(query/influxql): influxql transpiler should set the now time
The now time is stamped by the influxql transpiler and used inside of
the actual query. It will result in more accuracy if we take the
timestamp we have created and send it as part of the spec to queryd
rather than force ourselves to ensure absolute times exist everywhere.
2018-07-25 08:34:41 -05:00
adamperlin 5bb0cae73f Add filtering to flux range function when not pushed down 2018-07-24 13:33:42 -07:00
adamperlin f6a5e47d4b Update formatting of flux increase built-in to align with standard style 2018-07-24 10:42:20 -07:00
adamperlin ca0b4e4549 Order all data by time in flux increase test case, add related non-negative derivative test case 2018-07-23 17:18:29 -07:00
adamperlin f8c204a62f Add increase to flux as built in function, change test data to account for counter wraps to values other than zero 2018-07-23 16:21:55 -07:00
jlapacik d70ec9a31f update flux grammar spec to include OptionStatement 2018-07-20 12:53:14 -07:00
Nathaniel Cook be817afc62 fix: Update REPL to correctly compile Spec with now option 2018-07-20 13:22:05 -06:00
Jonathan A. Sternberg f2a8ae22b2
Merge pull request #435 from influxdata/js-427-cancel-enqueue
fix(query/control): cancel the enqueue of a query if the context finishes
2018-07-19 13:59:00 -05:00
Jonathan A. Sternberg ff8c9cfb34 fix(query/control): cancel the enqueue of a query if the context finishes
If a query is attempting to be enqueued and it gets canceled, it will
now stop attempting to add it to the new queries queue and return the
error reported by the context. This allows the http server to cancel a
running query when the client disconnects for whatever reason without
continuing to attempt to process the canceled query.
2018-07-18 15:37:25 -05:00
Nathaniel Cook d568d7fd01 feat: Use DBRPMappings in 1.x read path 2018-07-18 09:46:57 -06:00
Lyon Hill be271bc6e4
Merge pull request #423 from influxdata/feat/query-eval
feat(query): split compile into two functions to allow Eval access
2018-07-17 16:48:03 -06:00
Lyon Hill 586d35ce98 update Eval docs 2018-07-17 16:17:55 -06:00
Lyon Hill ec2764f8d0 feat(query): split compile into two functions to allow Eval access 2018-07-17 16:12:17 -06:00
Lyon Hill cb04d22e73 feat(query): add task options 2018-07-17 15:52:33 -06:00
Nathaniel Cook 85b7d36147 feat: Add query statistics
Introduces the Statisticser interface which ResultIterators may
implement.

The HTTP implementation uses HTTP trailers to preserve the statistics.
This way we do not need to have all encoders and decoders support
statistics.
2018-07-17 09:16:27 -06:00
jlapacik 524c4ccf35 flux options interface
default now option value
2018-07-16 14:24:37 -07:00
Nathaniel Cook 336313bddb fix: Fix tests that are failing because of the rename
These tests were part of a PR when the rename was made.
The changes were not rebased before merge so we did not discover the
failures till after the merge.
2018-07-13 13:02:37 -06:00
Jonathan A. Sternberg 12b3e5de6d
Merge pull request #403 from influxdata/js-queryd-catch-execute-panics
feat(query/control): catch panics when executing a query in the controller
2018-07-13 13:33:57 -05:00
Adam Perlin b6afb5ff47
Merge pull request #398 from influxdata/ap-difference-panic-fix
Fix for panic when `difference` is called with no data
2018-07-13 10:42:12 -07:00
Nathaniel Cook d9b2377c9f Merged pull request #406 from influxdata/nc-rename-block
chore: Rename block to table
2018-07-13 10:56:44 -06:00
Nathaniel Cook 43ff647444 fix: Update Godoc parameter name 2018-07-13 10:43:20 -06:00
Adam Perlin ed1809a513
Merge pull request #390 from influxdata/ifql-test-metaquery
Add initial flux meta query tests
2018-07-13 09:27:33 -07:00
adamperlin 70fae6f77a Move length check out of loop 2018-07-13 09:17:59 -07:00
Nathaniel Cook 7902652290 chore: Rename local vars for b to tbl 2018-07-13 10:04:38 -06:00
Nathaniel Cook 80acc8d8c4 chore: Rename block to table 2018-07-13 09:56:35 -06:00
Adam Perlin 99e1f362af
Merge pull request #405 from influxdata/ifql-test-string-interp
Add flux string interpolation test
2018-07-13 08:55:36 -07:00
Nathaniel Cook e4848caa25 chore: Rename parition key to group key 2018-07-12 16:16:58 -06:00
Jonathan A. Sternberg 4a275e0e2e feat(query/control): catch panics when executing a query in the controller 2018-07-12 17:16:12 -05:00
adamperlin 4db4a832a3 Add flux string interpolation test 2018-07-12 15:06:59 -07:00
adamperlin becab773b3 Add additional measurements to flux measurement query test input 2018-07-12 13:18:02 -07:00
Nathaniel Cook 01ad9e99a7 Merged pull request #379 from influxdata/nc-bucket-id
feat(query): Add support for using bucketID in from
2018-07-12 13:42:29 -06:00
adamperlin 4885fd3049 Remove unnecessary condition from in flux difference function implementation 2018-07-12 12:42:16 -07:00
Nathaniel Cook 987b045f97 Merged pull request #381 from influxdata/nc-link
fix: Update Spec.md link
2018-07-12 13:40:19 -06:00
adamperlin 3e7c79a072 Fix off-by-one error in difference bounds check, update unit tests to account for n=1 and n=0 points 2018-07-12 11:38:24 -07:00
adamperlin d190ad369c Add fix for panic in flux difference function; add related tests 2018-07-12 11:38:20 -07:00
Jonathan A. Sternberg 3d67f92c82
Merge pull request #397 from influxdata/nc-controller-panic
fix(query): Fix panic in controller if planning errors
2018-07-12 12:50:30 -05:00
Nathaniel Cook 932c114649 fix(query): Fix panic in controller if planning errors 2018-07-12 11:47:34 -06:00
Adam Perlin a8ecbe52c5
Merge pull request #394 from influxdata/ifql-test-increase
Ifql test increase
2018-07-12 09:50:28 -07:00
Adam Perlin 9380d47a7d
Merge pull request #391 from influxdata/ifql-test-groupfield
Add flux test for explicitly grouping by field
2018-07-12 09:48:49 -07:00
adamperlin d1119b0b68 Update difference_panic flux test 2018-07-12 08:15:42 -07:00
Adam c8da4b02aa
feat(query/influxql): Add group-by time + offset support (#384)
previous versions only supported the first parameter to time() that set the window size.  This version supports the second parameter, which shifts the offset a fixed amount from the epoch
2018-07-12 10:46:29 -04:00
adamperlin a0300688d5 Add test cases for flux sum increase function and difference() panic 2018-07-11 20:32:08 -07:00
adamperlin ad2e467df9 Add flux test for explicitly grouping by field 2018-07-11 17:53:01 -07:00