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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
* 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
* 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
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.
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.
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.
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.
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.
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
* 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
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.