66047f4372
* feat: InfluxQL learns how to plan some queries Also added a means to test the planner and execution * chore: Update module docs * chore: Document the planner functions * chore: Update end_to_end_cases crate * chore: Clarify why `SLIMIT` and `SOFFSET` return `NotImplemented` * chore: Address lint issues * chore: Fix rustdoc link issue * chore: Remove InfluxQL tests from query_tests crate Will follow conventions established by @carols10cents when new query_tests crate is merged. * chore: `now` field `now` is a DataFusion built-in scalar function * chore: remove unused code * chore: Add additional arithmetic expression tests * chore: Establish pattern for identifying and tracking InfluxQL issues * chore: Add tests for case sensitivity issues * chore: group tests into modules and functions This avoids mass rewriting of insta snapshots as new tests are added to each function. When tests are added in the middle, existing snapshots are renamed (-N+1, -N+2, etc) resulting in having to review numerous additional snapshots. |
||
---|---|---|
.. | ||
cases | ||
generate | ||
src | ||
Cargo.toml | ||
README.md |
README.md
This crate contains "integration" tests for the query engine. Specifically, it runs queries against a fully created database instance, records the output, and compares it to expected output.
Some tests simply have their inputs and outputs hard coded into #[test]
annotated tests as is
Rust's norm.
The tests in src/runner
are driven somewhat more dynamically based on input files.
Cookbook: Adding a new Test
How to make a new test:
- Add a new file .sql to the
cases/in
directory - Regenerate file:
(cd generate && cargo run)
- Run the tests `` cargo test -p query_tests`
- You will get a failure message that contains examples of how to update the files
Example output
Possibly helpful commands:
# See diff
diff -du "/Users/alamb/Software/influxdb_iox/query_tests/cases/in/pushdown.expected" "/Users/alamb/Software/influxdb_iox/query_tests/cases/out/pushdown.out"
# Update expected
cp -f "/Users/alamb/Software/influxdb_iox/query_tests/cases/in/pushdown.out" "/Users/alamb/Software/influxdb_iox/query_tests/cases/out/pushdown.expected"
Cookbook: Adding a new test scenario
Each test can be defined in terms of a "setup" (a set of actions taken to prepare the state of database).
In the future, we envision more fine grained control of these setups (by implementing some of the database commands as IOX_TEST commands), but for now they are hard coded.
The SQL files refer to the setups with a specially formatted comment:
-- IOX_SETUP: OneMeasurementFourChunksWithDuplicates
To add a new setup, follow the pattern in scenario.rs of get_all_setups
.