Commit Graph

30 Commits (efdc6e592bb60a5357d90c045834d8943b4822c9)

Author SHA1 Message Date
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
Edd Robinson 9403c1ec8e Ensure error strings not capitalised ST1005 2018-11-30 10:54:24 +00:00
Lorenzo Affetti eda4a59c35 Support for median in transpiler 2018-11-27 17:23:29 +01:00
Chris Goller 2bea48f15a refactor(testing): rename MustIDFromString to MustIDBase16 2018-10-11 09:54:19 -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
Michael Desa 8c87c9d132 revert #442 2018-08-01 14:54:32 -04: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 0778344cb0 Refactoring query package 2018-08-01 18:20:59 +02:00
Nathaniel Cook d568d7fd01 feat: Use DBRPMappings in 1.x read path 2018-07-18 09:46:57 -06:00
Jonathan A. Sternberg f694fa9637 refactor(query/influxql): move transpiler spec tests to its own package
The package contains all of the transpiler specs and allows them to be
put into different files instead of keeping all of the tests in the same
file. They are all Go code so they are type checked rather than being
loaded as JSON from disk.

Additionally, to make it easier for a developer, the tests will report
the exact file and line where the test was created. So rather than
hunting for which file a test is located in, you will get something nice
like the following:

    --- FAIL: TestTranspiler/SELECT_count(value)_FROM_db0..cpu_WHERE_host_=_'server01' (0.00s)
        testing.go:51: aggregates_with_condition.go:16: unexpected error: unimplemented function: "count"

As can be seen, the test that failed can be found in the
`aggregates_with_condition.go` file at line 16 which is where the test
was created by the `AggregateTest` function and the relevant spec can be
found in that same file.
2018-07-06 12:12:08 -05: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 691fa9ba97 feat(query/influxql): support for windowing
The transpiler now supports basic windowing. The window offsets are not
supported yet at all.

For windowing, we use the window function to split the points, perform
the aggregate/selector operation, and then we put them back into the
same window so they are within the same table as they originally were
located in. This is now reflected in the spec and the code.
2018-07-05 15:34:26 -05:00
Jonathan A. Sternberg eee8ad2d21 tests(query/influxql): port over the compiler tests for influxql
The compiler tests from the github.com/influxdata/influxdb/query have
been moved over to the influxql transpiler in platform. The framework
has updated to include a skip option so that all of the tests can be
there, but not all of them have to succeed at the moment. If a test
starts succeeding but is marked as one that should be skipped, it will
also cause an error to prevent us from doing work on the transpiler
without marking the test as something not to skip anymore (so progress
is always made).
2018-07-03 10:58:27 -05:00
Jonathan A. Sternberg 98597551d3 feat(query/influxql): support for group by
The transpiler now supports grouping by tags.
2018-07-03 10:18:03 -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 94db4dc285 fix(query/influxql): fix a broken test that didn't get updated with the bucket change 2018-06-21 09:31:25 -05:00
Jonathan A. Sternberg fad9b30705
Merge pull request #120 from influxdata/js-transpiler-buckets
feat(query/influxql): transpile using buckets instead of the database
2018-06-20 14:47:18 -05:00
Jonathan A. Sternberg a1ccecd873 fix(query/influxql): messed up a transpiler unit test
One of the transpiler unit tests got messed up during a recent PR. This
restores the unit test for conditionals.
2018-06-13 09:47:03 -05:00
Jonathan A. Sternberg 86defc1e37 feat(query/influxql): transpile using buckets instead of the database
The transpiler should use a bucket for the `from()` call instead of the
database parameter which will likely be deprecated. The bucket that it
will read data from is `db/rp` and, if the retention policy isn't
specified, `autogen` will be used as the default.
2018-06-11 10:13:11 -05:00
Jonathan A. Sternberg b1ab4e87f6 feat(query/influxql): support multiple select statements 2018-06-08 16:10:50 -05:00
Jonathan A. Sternberg 119021dc67 feat(query/influxql): implement filter conditions for tags in the transpiler 2018-06-08 14:18:41 -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
Jonathan A. Sternberg ea1809c0bf fix(query/influxql): add group spec back to the transpiler
The latest version of influxdb has fixed whatever was wrong with the
group function so this works properly again.
2018-05-31 11:43:58 -05:00
Jonathan A. Sternberg a44374a0c5 feat(query/influxql): encode influxql json results correctly
This fixes the encoder so that it will encode the response correctly to
a JSON blob using the outputs of the transpiler. The transpiler has also
been modified to pass through the correct values so the map function is
correctly constructed and the aggregate function is also correctly
constructed.

This removes the group function temporarily because it does not seem to
be working.
2018-05-31 11:07:27 -05:00
Jonathan A. Sternberg 174ce83f5d feat(query/influxql): use yield name to specify the statement id
The transpiler will now yield each statement using the statement id so
the result encoder can properly order the results and encode the
statement id. This behavior is now in the transpiler spec.
2018-05-24 16:33:51 -05:00
Nathaniel Cook 20345b8701 rewrite imports 2018-05-21 15:20:06 -06:00
Nathaniel Cook c0b01f16f8 update transpiler and influxql encoders 2018-05-19 15:28:37 -06:00
Adam 64e3c840ea Relocated several source files from private repo to here. 2018-05-17 11:35:53 -04:00