Stuart Carnie
f114842711
feat: Push outer query time-range to subqueries
...
Added additional end-to-end tests to validate time-range behaviour
2023-06-06 16:33:01 +10:00
Stuart Carnie
8c71f30145
chore: Don't wrap `TimeRange` in an `Option`
...
It is unnecessary, because both the lower and upper are already
optional values.
2023-06-06 15:07:47 +10:00
Stuart Carnie
9e2550c933
Merge branch 'main' into sgc/issue/7829_time_bounds_3
...
# Conflicts:
# iox_query_influxql/src/plan/planner.rs
2023-06-06 12:55:43 +10:00
Stuart Carnie
01a22f8a2c
chore: Simplify WHERE clause handling
...
We don't need `Context` in the expression rewriting, which eliminates
a redundant `Context::default()` call in all the `SHOW` (metadata)
queries. Also simplified the time-range handling of metadata queries,
as we now have API to extract the time range from a `WHERE` clause
predicate and add the time filter to the same `Filter` logical plan
node.
2023-06-06 12:54:05 +10:00
Andrew Lamb
f571aeb445
chore: Update DataFusion pin ( #7916 )
...
* chore: Update DataFusion pin
* chore: Update cargo
* fix: update for API changes
* fix: Update plans
* chore: Update for new api
* fix: Update plans
* chore: Update for API changes more
---------
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-06-05 18:38:59 +00:00
Stuart Carnie
d8c2f2c679
refactor: Simplify `TimeRange` to match InfluxQL OG behaviour explicitly
2023-06-05 15:14:13 +10:00
Stuart Carnie
8c51d855e4
chore: `super` is shorter
2023-06-02 13:56:58 +10:00
Stuart Carnie
61e19c9036
refactor: Use InfluxQL implementation for simplifying time ranges
2023-06-02 13:40:02 +10:00
Stuart Carnie
d5719f9be2
refactor: Moved simplification of time range expressions to parser
2023-06-02 09:50:01 +10:00
Stuart Carnie
8c02f81456
chore: Add some docs to the execution_props API
2023-05-31 12:31:38 +10:00
Stuart Carnie
d9d7419693
refactor: move time range logic to separate module
...
The `rewrite_expression` module was getting large, so made sense to
move time range logic to its own module.
2023-05-31 12:28:03 +10:00
Stuart Carnie
0a7e162911
refactor: rename into planner submodule
2023-05-31 12:14:12 +10:00
Stuart Carnie
8f2c235b15
refactor: these are APIs for transforming InfluxQL expressions
2023-05-31 12:09:32 +10:00
Stuart Carnie
600ed6652c
refactor: rewrite time-range expressions to a single range
...
Fixes gap filling, which was confused by multiple lower or upper
time bounds.
2023-05-30 15:46:45 +10:00
Christopher M. Wolff
2a07b53879
feat: add more tag predicate rewrite logic for InfluxQL ( #7869 )
...
* feat: add more tag predicate rewrite logic for InfluxQL
* chore: cargo fmt
* chore: fmt
* test: add more tests
---------
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-26 21:53:52 +00:00
Stuart Carnie
6c8cab1073
chore: Separate scope from context, as it is a separate concern
2023-05-26 12:12:11 +10:00
Stuart Carnie
377e108152
chore: No need to be exported from current module
2023-05-26 12:12:10 +10:00
Dom Dwyer
928a4d163e
build: remove unused dependencies from crates
...
This commit fixes loads of crates (47!) had unused dependencies, or
mis-configured dependencies (test deps as normal deps).
I added the "unused_crate_dependencies" to all crates to help prevent
this mess from growing again!
https://doc.rust-lang.org/beta/nightly-rustc/rustc_lint_defs/builtin/static.UNUSED_CRATE_DEPENDENCIES.html
This has the minor downside of false-positives when specifying
dev-dependencies for test/bench binaries - these are files in /test or
/benches (not normal tests). This commit includes a workaround,
importing them in lib.rs (gated by a feature flag). I think the
trade-off of better dependency management is worth it!
2023-05-23 14:55:43 +02:00
Stuart Carnie
46031b2031
chore: rustfmt 🧹
2023-05-23 10:10:41 +10:00
Stuart Carnie
66623398a8
chore: add some additional tests to validate multiple data sources
2023-05-23 09:52:01 +10:00
Stuart Carnie
963e9ea60e
chore: Use BTreeSet per PR feedback
...
See: https://github.com/influxdata/influxdb_iox/pull/7808#discussion_r1200974643
2023-05-23 09:43:05 +10:00
Stuart Carnie
e9cbe4e589
chore: Fix broken reference
2023-05-22 16:55:41 +10:00
Stuart Carnie
50289ebab7
chore: Update insta snapshots
2023-05-22 16:30:55 +10:00
Stuart Carnie
c9b6695a44
chore: No need to use deref
2023-05-22 16:30:38 +10:00
Stuart Carnie
af76865b2c
feat: complete InfluxQL subquery compatibility
...
Closes #7794
2023-05-22 16:22:54 +10:00
Stuart Carnie
ccd73a0b32
chore: remove duplicate code
2023-05-22 16:20:26 +10:00
Stuart Carnie
e88d8befdb
Merge branch 'main' into sgc/issue/7794_subquery_inconsistency
2023-05-19 18:45:58 +10:00
Stuart Carnie
4d069800dd
feat: Generate plan for each table and then union final plans together
...
Closes #7794
2023-05-19 18:45:35 +10:00
Stuart Carnie
8bb98ab21c
chore: Improve docs
2023-05-19 09:24:33 +10:00
Andrew Lamb
6344fe8c3f
chore: Add rationale for `clippy::future_not_send` ( #7822 )
...
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-18 16:58:56 +00:00
Stuart Carnie
04617a4362
Merge branch 'main' into sgc/issue/7794_subquery_inconsistency
2023-05-18 07:24:00 +10:00
Marco Neumann
62fed73bcd
refactor: upgrade DataFusion to `19b03240920ad63cac916b42951754c0337bdac8#19b03240920ad63cac916b42951754c0337bdac8` ( #7813 )
...
I need:
- https://github.com/apache/arrow-datafusion/pull/6226 .
Changes in code due to:
- https://github.com/apache/arrow-datafusion/pull/6332
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-17 13:57:12 +00:00
Stuart Carnie
39cffcbc92
chore: Add API to find all VarRef instances of a `SELECT` statement
2023-05-17 16:43:16 +10:00
Stuart Carnie
b299937d18
chore: Resolve tags in GROUP BY clause
...
Any `VarRef`s in the `Select` where the `data_type` field is `None`
indicates there is no field or tag found in the schema of any children
in the `FROM` clause
2023-05-17 14:55:10 +10:00
Stuart Carnie
9cecb3504c
chore: Remove redundant call to `to_lowercase`
...
Function call names are normalised to lowercase by the parser.
2023-05-17 14:32:57 +10:00
Stuart Carnie
c9f8151302
feat: Resolve data types for `VarRef` nodes in the `WHERE` condition
2023-05-17 12:31:37 +10:00
Stuart Carnie
76aa1ac3d6
feat: Refactor node used to represent a tag in a `GROUP BY`
...
* Use `VarRef` for `Tag`, to ensure a consistent representation of a
column reference across `GROUP BY`, `SELECT` projection and `WHERE`
clause.
* Rename `tags` to `tag_names`
* `tags` now returns `VarRef`
2023-05-17 12:29:02 +10:00
Stuart Carnie
90328e5d0f
chore: PR feedback
2023-05-17 09:24:55 +10:00
Stuart Carnie
d9729ede7d
chore: Fix rustdoc links
2023-05-16 09:21:49 +10:00
Stuart Carnie
2e30442a86
Merge branch 'main' into sgc/issue/6879_subquery_01
2023-05-16 09:15:03 +10:00
Stuart Carnie
4068249349
chore: Fix rustdoc links
2023-05-16 09:13:08 +10:00
Andrew Lamb
7735e7c95b
chore: Update DataFusion again ( #7777 )
...
* chore: Update datafusion again
* chore: Run cargo hakari tasks
---------
Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-15 12:38:45 +00:00
Stuart Carnie
7ba619a32b
feat: outer GROUP BY pushed down to subqueries; more Cloud 2 examples
2023-05-15 15:31:20 +10:00
Stuart Carnie
e75a95bca7
chore: clippy 🧹
2023-05-15 15:30:39 +10:00
Stuart Carnie
62a4c02836
feat: Handle default FILL behaviour for subqueries
2023-05-15 11:22:26 +10:00
Stuart Carnie
c77c4b3d23
feat: support nested aggregate subqueries
2023-05-15 09:31:06 +10:00
Stuart Carnie
0dd1826e3c
feat: add the merged tag set for the `Select` query
2023-05-15 09:30:28 +10:00
Stuart Carnie
f7a8850f62
chore: docs
2023-05-15 09:29:45 +10:00
Stuart Carnie
914d2a9e02
chore: docs
2023-05-15 07:27:47 +10:00
Stuart Carnie
553476c646
fix: time should be added to all subqueries of arbitrary depth
2023-05-15 07:22:24 +10:00