Commit Graph

11 Commits (204d919a92f349a4db255c0202da6a94970d6d08)

Author SHA1 Message Date
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
Nathaniel Cook 1708a41fa7 refactor: update query functions for Flux builtins 2019-01-11 13:11:57 -07:00
Nathaniel Cook 2a1d76eb2d chore: Update flux dependency for the type-inference changes 2018-10-31 17:11:11 -06: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
Stuart Carnie ac75af2f58 refactor: Migrate query package to influxdata/flux repository 2018-09-06 11:13:48 -07:00
Adam 67bb5af1fb
regex support added to transpiler (#356)
* feat(query/influxql): add regex support to transpiler
also added test case to querytest

* Add raw_with_condition test to transpiler unit tests

* add unit tests for regex conditions on raw query
2018-07-09 16:54:00 -04:00
Jonathan A. Sternberg 27cd61e22d refactor(query/influxql): modify the transpiler compilation tests to remove skip
The transpiler compilation tests will now not allow skip to be
specified. Instead, it must return an error message that starts with
`unimplemented` and then the reason will be used as the skip message.

This way, it will be easier to identify the failing tests in the
transpiler. In the previous method, it was possible for a test to be
marked as skip, but for the transpiler to return the wrong error message
because the test did not differentiate between an unimplemented error
message and an incorrect error message.
2018-07-06 09:21:41 -05:00
Jonathan A. Sternberg adec513306 feat(query/influxql): add additional error details for a few unimplemented errors 2018-07-03 15:37:53 -05:00
Jonathan A. Sternberg 3aed4b2a3d feat(query/influxql): modify the encoder to allow more flexibility from the transpiler
This extra flexibility makes it easier for the transpiler to generate a
specification since the map step can be focused on only generating the
columns related to fields. In particular, it makes it easier to
implement wildcards for tags because the tags will get passed along with
the partition key.
2018-07-02 13:38:12 -05:00
Jonathan A. Sternberg bcd0545728 fix(query/influxql): have the transpiler use the _time column for the time
The spec says to use the `_time` column for the time in the output, but
we were mapping `r._time` to `time` and using the `time` variable. This
modifies the encoder to use the `_time` column and rename it to `time`
for the column name.
2018-07-02 12:48:15 -05:00
Jonathan A. Sternberg 1b31a1150c refactor(query/influxql): follow the transpiler readme
There are a few changes to how the transpiler works. The first is that
the streams are now abstracted behind a `cursor` interface. The
interface keeps track of which AST nodes (like variables or function
calls) are represented by the data inside of the stream and the method
of how to access the underlying data. This makes it easier to make a
generic interface for things like the join and map operations. This also
makes it easier to, in the future, use the same code from the map
operation for a filter so we can implement conditions.

This also follows the transpiler readme's methods and takes advantage of
the updates to the ifql language. This means it will group the relevant
cursors into a cursor group, perform any necessary joins, and allow us
to continue building on this as we flesh out more parts of the
transpiler and the language.

The cursor interface makes it so we no longer have to keep a symbol
table mapping the generated names to the locations because that is all
kept within the incoming cursor rather than as a separate data
structure.

It also splits the transpiler into more files so it is easier to find
the relevant code for each stage of the transpiler.
2018-06-08 13:07:10 -05:00