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
Stuart Carnie
4e96f814db
chore: Improve docs
2023-05-15 07:21:36 +10:00
Stuart Carnie
f4a19fc6c1
fix: Aggregate subqueries with push-down `GROUP BY tags`
2023-05-12 16:53:16 +10:00
Stuart Carnie
87dca540a7
feat: More subqueries succeeding
2023-05-12 13:55:42 +10:00
Stuart Carnie
c2335b9f26
chore: Add compatibility mode, to follow InfluxQL OG behaviour 😬
2023-05-12 13:53:59 +10:00
Stuart Carnie
1a947d6bf1
chore: Planner can use Arrow type
2023-05-12 12:50:16 +10:00
Stuart Carnie
248f596bda
chore: Additional subquery tests
2023-05-12 12:49:26 +10:00
Stuart Carnie
9560e50fa2
chore: `let` syntax is clearer
2023-05-12 12:49:06 +10:00
Stuart Carnie
92414f224f
feat: Planner can depend on `data_type` of `Field`
2023-05-12 12:48:12 +10:00
Stuart Carnie
80545feee0
feat: `TypeEvaluator` needs to know about `DISTINCT`
2023-05-12 12:46:45 +10:00
Stuart Carnie
e9e0f22d64
feat: Teach `TypeEvaluator` about scalar functions
2023-05-12 12:13:50 +10:00
Stuart Carnie
687e2f1003
chore: Move TagSet and more cleanup
2023-05-11 12:42:43 +10:00
Stuart Carnie
f234442534
chore: some initial tests for validating column schema inference
2023-05-11 09:46:38 +10:00
Stuart Carnie
26c96b356f
chore: rename test function to avoid collisions with future tests
2023-05-11 09:46:15 +10:00
Stuart Carnie
1d837b175e
feat: add schema support to DataSource::Subquery; fix incompatibilities
2023-05-10 14:33:34 +10:00
Stuart Carnie
3c25272eeb
chore: More cleanup
2023-05-09 13:00:12 +10:00
Stuart Carnie
707a700481
chore: Remove unnecessary Result type
2023-05-09 12:59:56 +10:00
Stuart Carnie
54c063cc67
fix: field_and_dimensions doesn't error
2023-05-09 12:48:22 +10:00
Stuart Carnie
01744865b2
fix: Don't skip explicit reference to Tag fields
2023-05-09 12:47:24 +10:00
Stuart Carnie
bd760330f2
feat: Initial experimental subquery support
2023-05-09 09:42:49 +10:00
Stuart Carnie
4fc5a90d60
chore: Update docs
2023-05-09 09:24:19 +10:00
Stuart Carnie
74b5c32440
refactor: Cleanup rewriter
2023-05-09 09:24:19 +10:00
Stuart Carnie
e4b6a8f77a
chore: Resolve aliases for all `SELECT` queries, not just the outer
2023-05-09 09:24:18 +10:00
Stuart Carnie
9227bc032f
chore: Remove fragile `is_tag_field` API
2023-05-05 17:15:59 +10:00
Stuart Carnie
3099733de6
chore: Introduce root `SelectQuery`
...
This is used to gather shared state for the query vs `Select`, which
represents state for each `SELECT` statement.
First example is tracking whether a statement projects multiple
unique measurements. This changed improved one of the plans, as it
no longer needs to sort the `iox::measurement` column.
2023-05-05 16:48:27 +10:00
Stuart Carnie
f026d546b0
chore: Refactor `select_statement_to_plan`
...
This is an improvement over the previous version, and prepares the
planner for implementing subqueries and passing schema to the
`project_select` function.
2023-05-05 13:35:32 +10:00
Stuart Carnie
e7d6819602
chore: Correct docs
2023-05-05 12:25:58 +10:00
Stuart Carnie
a218d97dcf
chore: Use `Select` rather than `SelectStatement` in planner
2023-05-05 12:17:15 +10:00
Stuart Carnie
03b4195976
chore: Rename TableReference to DataSource to avoid conflicts with DF
2023-05-05 11:03:56 +10:00
Stuart Carnie
8deb1832e7
chore: Expose TypeEvaluator for more efficient type evaluation
2023-05-05 10:54:45 +10:00
Stuart Carnie
7b19bf014b
chore: Reorganise `rewrite_statement` unit tests
2023-05-05 10:12:17 +10:00
Stuart Carnie
8b60a95a77
chore: Unnecessary use of `borrow`
2023-05-05 10:12:02 +10:00
Stuart Carnie
f8b1d37d5a
fix: Consistent alias names with InfluxQL OG
...
Fixes #7750
2023-05-05 10:11:37 +10:00
Stuart Carnie
7e47d48d01
chore: SLIMIT and SOFFSET are not implemented
2023-05-05 07:48:20 +10:00