Commit Graph

143 Commits (1444df8557f8cbb931b1c8619e237cc763a486df)

Author SHA1 Message Date
Christopher M. Wolff 8b106bcee1
feat(storage): add mean aggregate array cursor and tests (#19019) 2020-07-23 09:49:53 -07:00
jlapacik b7e2330fa3 test: offset tests for min and max read cursors 2020-07-20 12:23:37 -07:00
jlapacik 36987bec0f feat: add offset parameter to window cursors 2020-07-20 12:23:37 -07:00
Christopher M. Wolff c695be2f56
feat(storage/reads): add min/max aggregate array cursors (#18957) 2020-07-20 10:17:04 -07:00
jlapacik c86ce5b325 feat(storage): read cursor for window last 2020-06-29 13:12:47 -07:00
Brett Buddin 0c268e205b
fix(storage): Push-down a predicate to match tags for SHOW MEASUREMENT calls (#18740)
* fix(storage): Push-down a predicate to match tags for SHOW MEASUREMENTS calls.

* chore: Address feedback.

* fix(tsm1): Split behavior based on existence of predicate for show measurements.

* fix(tsm1): Allow parenthesis expression on the LHS of a predicate.

* fix(tsm1): Create a separate tag predicate verifier that rejects negative comparisons.

* fix(tsm1): Additional test cases for show measurements with predicate.
2020-06-29 14:31:54 -04:00
jlapacik 7f1caec697
feat: limit cursors (#18467)
* feat(storage): first array cursor

* feat: add first and last to rpc messages

* test(launcher): push down group first and group last

* feat(storage): window first array cursor

* test(launcher): push down bare first and bare last

* feat(storage): add capabilities for group first and group last

* refactor: rename first to limit

* refactor: make zero value for every period meaningful

* refactor: standardize launcher pushdown tests
2020-06-15 12:21:35 -07:00
Christopher M. Wolff 796e5fbfb7
refactor(storage/reads): refactor/generalize aggregate array cursor code and add tests (#18414) 2020-06-11 16:01:47 -07:00
Christopher M. Wolff cbaced1901
test(storage/reads): create a test helper for agg array cursor tests (#18398) 2020-06-08 14:04:41 -07:00
Christopher M. Wolff 3dbfffd851
refactor(storage/reads): refactor and add unit tests for *WindowCountArrayCursor (#18354) 2020-06-08 11:30:49 -07:00
jlapacik eba496d1bd
feat: grouped aggregate rewrite rules (#18342)
* feat: flags for pushing down new aggregates

* refactor: grouped aggregate rewrite rules

The storage operation ReadGroup aggregates per series on the storage
side. The planner will rewrite grouped aggregate queries to call
ReadGroup, which will perform a partial aggregation, followed by
another operation that will perform the rest of the aggregation on
the compute side.

* feat: storage capabilities for grouped aggregates

* fix: changes from review

* feat: group read operation name should include aggregate
2020-06-04 14:36:15 -07:00
Christopher M. Wolff 19a2496a28
fix(storage/reads): fix off-by-one error in WindowCountArrayCursor (#18343) 2020-06-02 16:04:22 -07:00
Paul Hummer 7c48976f94 test: add test for windowed count aggregate
This patch adds tests for `ReadWindowAggregate` and the one supported
window aggregate, the count aggregate.

Fixes #18183
2020-05-29 10:08:52 -06:00
Yiqun (Ethan) Zhang 7125db5e62
fix: remove unused imports (#18269) 2020-05-28 14:39:05 -05:00
Yiqun (Ethan) Zhang 41156ca646
feat(query): implement window count aggregate pushdown (#18043) 2020-05-28 13:42:38 -05:00
jlapacik 34e581ca0a Merge branch 'master' into chore/merge-master 2020-05-12 11:18:25 -07:00
Stuart Carnie bf1ad403f7
fix(reads): Fix ResultSetToLineProtocol to generate correct output
The ResultSetToLineProtocol test class was not generating correct
line protocol for string output (appending `i`)

In addition, the PR improves the mock.NewResultSetFromSeriesGenerator
type with options. The one option added is `WithGeneratorMaxValues`,
to limit the total number of values produced by the SeriesGenerator.
2020-05-08 12:39:54 -07:00
Yiqun Zhang e341a51ff0 fix: fmt 2020-05-05 01:43:22 -05:00
Yiqun (Ethan) Zhang 8bb5065769 refactor: unify WindowAggregateCapability (#17901) 2020-05-05 01:35:02 -05:00
Yiqun (Ethan) Zhang 3c2ab1b681
feat(query): Reader implementation for WindowAggregate (#17885) 2020-04-29 10:42:16 -05:00
Yiqun (Ethan) Zhang a7e3679aaf
refactor: rename the store-side WindowAggregateReader interface to WindowAggregateStore (#17880) 2020-04-28 13:44:46 -05:00
Yiqun (Ethan) Zhang e29eeabcec
feat: complete ReadWindowAggregateRequest (#17871) 2020-04-27 10:51:43 -05:00
Jonathan A. Sternberg 69bdae7f7d
refactor(storage/reads): refactor the capabilities interface (#17850)
The capabilities interface will now return a mapping of capabilities to
a capabilities object. The capabilities object will contain a list of
features supported by the capability.
2020-04-23 16:16:52 -05:00
Jonathan A. Sternberg d764ca3798
refactor(query): return detailed capabilities for the read window aggregate interfaces (#17836)
This modifies the read window aggregate interfaces to future-proof it
if and when we add additional capabilities to the method. Previously,
the interface was all or nothing. If we modified the RPC call itself, we
would have to make a new interface to denote the change to the Go code.

This changes the interface so now a `WindowAggregateCapability` exists.
This way, we can modify the struct to include things like:

```
type WindowAggregateCapability struct {
    WindowPeriodCapability bool
    MeanAggregateCapability bool
}
```

This way we can learn if the RPC call itself supports some specific
option. If the first iteration doesn't support a mean aggregate or the
mean aggregate is only supported by single server implementations, the
window aggregate can tell the caller that it won't be able to compute
the mean aggregate.

Since it fills in a struct with these capabilities, the struct can
safely introduce new values. If a downstream consumer wants to take
advantage of that functionality, then all interfaces in the chain have
to be updated to consume the upstream capabilities.
2020-04-23 10:22:33 -05:00
Jonathan A. Sternberg 60c58ad805
feat(query): add interface for the window aggregate capability (#17801)
Added an interface for an additional storage capability. This interface
will allow for checking if the reader supports the window aggregate call
and another method for invoking the call if it does.

This is implemented using a single interface. If the reader implements
the interface, it indicates that the client is capable of reading the
response. The `HasXXX` method is intended to check if the store supports
the operation. This method also takes a context because it could require
a remote call or to wait for one.
2020-04-21 14:15:38 -05:00
Stuart Carnie c76f30682c
fix(storage): Feedback in response to PR review
* Adds clarifying documentation
* Regenerate protocol buffers with updated documentation
2020-04-16 15:19:28 -07:00
Stuart Carnie 6325591deb
feat(storage): New data types for measurement schema gRPC APIs
This commit

* adds new request and response data types for schema gRPC calls
* adds fmt.Stringer implementation to cursors.FieldType
* adds APIs to sort a slice of MeasurementField values,
* upgrades the gogo protobuf package to v1.3.1, which
  includes improvements to serialization.
2020-04-16 14:51:31 -07:00
Stuart Carnie abb6821f89
chore(storage): Remove redundant gRPC service from protobuf definition 2020-04-13 16:27:58 -07:00
Faith Chikwekwe edc1a7413d fix(storage/reads): update sortKey sorting method to use null byte as delimeter 2020-04-06 14:52:19 -07:00
Ben Johnson e639f99d03 fix(storage): Add filter regression test 2020-04-06 14:19:16 -06:00
Ben Johnson abfe5a54a0 fix(storage): Fix query cursor read that caused cursor truncation.
Filter cursors buffer points in between calls to Next() if the number
of read points exceeds 1000. Previously, this buffer was being cleared
out before being iterated over which caused queries to return a resultset
which had a number of rows divisable by 1000.

This change moves the clearing of the buffer until after the points have
been read. This change affects any queries which read more than 1000 points
from a single series & have a filter that can be successfully applied to at
least one of those points.
2020-04-06 13:54:16 -06:00
Jonathan A. Sternberg 6e4cf7ffef
refactor: fix imports from go template files (#17615) 2020-04-03 17:40:36 -05:00
Jonathan A. Sternberg 0ae8bebd75
refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
Yiqun (Ethan) Zhang 48efdb52ea
build(flux): update Flux to v0.65.0 (#17484) 2020-03-27 18:42:19 -04:00
Jacob Marble 26ca766459
refactor(tsdb): move series file to its own package (#17224)
* refactor(storage): move type ByTagKey to the only package that uses it

* refactor(tsdb): use types in tsdb/cursors

* refactor(tsdb): remove unused type SeriesIDElems

* refactor(tsdb): inline only use of tsdb.ReadAllSeriesIDIterator

* refactor(tsdb): move series file to its own package

* refactor(storage): remove platform->influxdb aliases
2020-03-12 11:32:52 -07:00
Jacob Marble cdbf532f57
refactor(storage): remove dead code and rename a few things (#17217)
* refactor(storage): remove CursorIterators type

* refactor(storage): remove unused tsdb.MarshalTags()

* refactor(storage): remove unused package tsdb/internal

* refactor(storage): rename tsdb/metrics.go to tsdb/series_file_metrics.go

* refactor(storage): remove unused type tagValueSliceIterator

* refactor(storage): rename field row to seriesRow

* refactor(storage): rename tsdb/index.go to tsdb/series_iterators.go
2020-03-12 10:45:48 -07:00
Sebastian Borza eeece73675
chore(storageflux): update failing tests 2020-03-10 17:54:07 -05:00
Sebastian Borza a50e69451e
feat(storageflux): move flux components out to separate package 2020-03-10 17:54:04 -05:00
Jacob Marble 9e8da7c313
refactor(storage): cleanup in storage/reads (#17163)
* refactor(storage): remove cursorContext.limit and .count

* refactor(storage): remove one-impl interface

* refactor(storage): remove one-line multiShardArrayCursors.newAggregateCursor()

* refactor(storage): mostly rename fields and variables

* refactor(storage): multiShardArrayCursors has one shard

* refactor(storage): drop misleading 'multiShard' from names
2020-03-10 07:50:47 -07:00
Jacob Marble 8bfe05e554
refactor(storage): remove reads.ResponseWriter (#17137)
ResponseWriter is only used in IDPE, so move it to that repo.
2020-03-06 15:54:11 -08:00
Jacob Marble 39b7c2ab76
refactor(storage): export IndexSeriesCursor (#17134)
* refactor(storage): add readSource field accessors

* refactor(storage): remove unused limitSeriesCursor

* refactor(storage): export IndexSeriesCursor

This allows IDPE to use the same implementation, rather than duplicate
code. Also copied unit tests from IDPE.

* chore: go fmt
2020-03-06 14:05:03 -08:00
Jacob Marble 5efde876d7
refactor(storage): rename things so flux and influxql influence is clear (#17108)
* refactor(storage): rename things so flux and influxql influence is clear

* chore: go fmt
2020-03-05 15:23:05 -08:00
Jacob Marble 1facad82dd
refactor(storage): move unused code to repo that needs it (#17090)
* refactor(storage): move unused code to repo that needs it

Turns out that a bunch of code is only needed in IDPE. This change
removes that code, and another PR adds it to IDPE.

* refactor(storage): export KeyMerger

* refactor(storage): export NilSortHi and NilSortLo

* refactor(storage): move StringIterator & friends to IDPE

* refactor(storage): unexport a few test helper funcs
2020-03-05 14:15:51 -08:00
Stuart Carnie f1990cc92c
feat(mock): Add SeriesGenerator to ResultSet transformation
In addition, adds a ResultSetToLineProtocol function, which
transforms a `ResultSet` into InfluxDB line protocol.
2020-02-12 14:20:31 -07:00
Greg 41e771a464
feat(http): expose list of available telegraf plugins (#16233) 2019-12-17 16:53:19 -07:00
Jonathan A. Sternberg fe94c5cae4
feat(storage/reads): add cache to reuse tags when reading from storage (#16041)
This adds an lru cache for the columns that are produced as tags. When
producing the columns that are part of the group key, it will generate
the column and then keep it in an lru cache to reuse for future tables.
The start and stop column are effectively cached for every table because
they are special and will be the same for all of the tables.

For the tags, it retains the most recently used since they may be used
by a future table. That way most of the columns will get shared with
each other.

When the size differs, a slice is used so the underlying data is still
shared, but the size is different.
2019-11-27 08:31:53 -06:00
Jonathan A. Sternberg 2b4e6283ce
perf(storage/reads): remove the duplicate filter (#16024)
This removes the duplicate filter that is used by the reader. The
storage engine shouldn't be sending us duplicate tables anyway and this
code hurts performance in high cardinality queries because of the memory
it uses to keep track of all of the keys that have been seen.
2019-11-22 12:38:16 -06:00
Brandon Farmer d83fabeabc feat(influxdb): user disabling 2019-09-23 11:57:16 -07:00
George 8109d161bb
perf(storage): expose ability to peek on stream readers (#14901) 2019-09-04 13:57:36 +00:00
Stuart Carnie f60c2ec3ba
fix(reads): Remove issue reference from test per feedbakc 2019-08-16 13:00:06 -07:00