Commit Graph

214 Commits (b1790760119b99f3f785201985d6a262ee1f8f2c)

Author SHA1 Message Date
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
Stuart Carnie 85f461fbda
Merge branch 'main' into sgc/issue/7739_select_ir_01 2023-05-05 06:29:21 +10:00
Marco Neumann 2cfb30d5df
refactor: remove non-struct selector functions (#7743)
Clean up for #7533.
2023-05-04 10:25:52 +00:00
Stuart Carnie b47e0efc85
feat: Step 1 on N for an intermediate representation of `SELECT`
The end goal is that each `Select` node will contain a schema to be
referenced directly by the InfluxQL planner. Additionally, further
refinement of the field data types used by the `Select` node
are expected, to remove ambiguity from the planner.
2023-05-04 18:27:32 +10:00
Stuart Carnie 43baecbb1a
chore: handle aliased time column in sort expression 2023-05-03 12:04:24 +10:00
Stuart Carnie 19ea80390a
chore: ignore time column when processing SELECT 2023-05-03 11:04:54 +10:00
Stuart Carnie 91f5464375
chore: add additional tests 2023-05-03 09:23:15 +10:00
Stuart Carnie 24378bd460
chore: `time` is always present and at first position of projection 2023-05-03 07:47:14 +10:00
Stuart Carnie 89143a72fa
chore: Remove schema::Schema dependency
Subquery support cannot rely on IOx schema, as this metadata does not
propagate through DataFusion `LogicalPlan` nodes.
2023-04-28 10:08:30 +10:00
Stuart Carnie 482221a7d4
chore: Redundant attribute 2023-04-28 09:56:07 +10:00
Stuart Carnie b9024582b0
fix: Ensure InfluxQL internal errors have a distinct message
Closes #7606
2023-04-28 09:55:32 +10:00
Stuart Carnie b33b56d76a
Merge branch 'main' into sgc/issue/subquery_6891_02 2023-04-28 06:14:42 +10:00
Marco Neumann 949d131e77
refactor: only use struct-style `select` in InfluxQL planner (#7636)
* refactor: only use struct-style `select` in InfluxQL planner

For #7533 we need to track more columns apart from `time` and `value`
and having a simple variant and multiple complex ones gets overly
complicated soon. The aggregator is internally identical anyways, so
let's only use one and then pull out the struct fields that we need.

I'll also change the InfluxRPC planner to use the struct variant next,
so we have a single `select` system both in the planners and in `query_functions`.

* docs: improve

* docs: explain test

Co-authored-by: Andrew Lamb <alamb@influxdata.com>

---------

Co-authored-by: Andrew Lamb <alamb@influxdata.com>
2023-04-27 13:29:11 +00:00
Stuart Carnie 14c809f943
chore: No longer necessary, as the rewriter handles this behaviour 2023-04-27 08:09:52 +10:00
Stuart Carnie 789aab2f5d
feat: Rewriter is now smarter for subqueries
Rewriter drops `MeasurementSelection` entries from the `FROM` clause
that do not project any fields directly from a measurement. Subqueries
are an exception, such that an outer query may project only tags
from the inner subquery.
2023-04-27 08:07:40 +10:00
Stuart Carnie 44ac3ca960
chore: Better not to clone 2023-04-27 08:06:06 +10:00
Stuart Carnie a133c56a9c
feat: Evaluate data types of binary expressions (#7670)
* feat: Evaluate data types of binary expressions

This is necessary to ensure column data types of projections of a
subquery are accurately determined.

* chore: rustfmt 🧹
2023-04-26 21:05:25 +00:00
Christopher M. Wolff 2d592a0295
feat: teach parser to allow arithmetic functions (#7620)
* feat: teach parser to allow arithmetic functions

* refactor: remove unnecessary lowercasing of fn names

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-24 17:09:22 +00:00
Marco Neumann 9730c52c8a
fix: InfluxQL output sorting (#7633)
* test: remove #7513 workarounds from `issue_6112.influxql`

* fix: `SHOW TAG VALUES` output sorting

* fix: `SHOW MEASUREMENTS` output sorting

* fix: `SHOW TAG KEYS` output sorting
2023-04-24 13:37:25 +00:00
Stuart Carnie 0cc6147d6f
fix: Need to handle Regex operators
Ignoring LIKE for now as they aren't used by the InfluxQL planner
2023-04-21 13:39:34 +10:00
Stuart Carnie 7a49c3484e
feat: Documentation to describe time range behaviour 2023-04-21 09:31:54 +10:00
Stuart Carnie 79fcb9bfb9
chore: Use idiomatic initialisation
Co-authored-by: Christopher M. Wolff <chris.wolff@influxdata.com>
2023-04-21 09:25:14 +10:00
Stuart Carnie 9416fcfb88
Merge branch 'main' into sgc/issue/time_range_7610 2023-04-21 07:53:34 +10:00
Stuart Carnie b2279abb59
feat: Rewrite time range expressions to apply to entire result set 2023-04-21 07:53:19 +10:00
Marco Neumann 370413b2d2
feat: `SHOW TAG KEYS ... WHERE <condition>` (#7601)
Ref https://github.com/influxdata/idpe/issues/17474 .
2023-04-20 09:16:35 +00:00
Marco Neumann 9eac89ebfb
fix: also include metadata in empty InfluxQL select results (#7604)
At least the schema metdata and the measurements column should be there.
2023-04-20 08:12:07 +00:00
Christopher M. Wolff 7a6862ee3a
refactor: let date_bin_gapfill allow omitted origin (#7595)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-19 14:56:52 +00:00
Marco Neumann ce273b6006
feat: `SHOW MEASUREMENTS ... WHERE <condition>` (#7590)
Ref https://github.com/influxdata/idpe/issues/17474 .

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-19 08:59:54 +00:00
Marco Neumann 53abef0447
feat: `SHOW TAG VALUES ... WHERE <condition>` (#7589)
Ref https://github.com/influxdata/idpe/issues/17474 .

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-19 08:10:56 +00:00
Stuart Carnie fc9b89da44
feat: `SELECT DISTINCT` support 2023-04-18 16:51:02 +10:00
Stuart Carnie b2dfe30a42
chore: use `error` module 🧹 2023-04-18 16:50:48 +10:00
Stuart Carnie dbf7e73d3e
feat: COUNT(DISTINCT) 2023-04-18 16:50:24 +10:00
Stuart Carnie bf392eeb4c
feat: identify `SELECT DISTINCT <ident>` projections
These are special, so they have a new projection type
2023-04-18 16:49:11 +10:00
Stuart Carnie 8f78fe7b08
chore: rewrite `DISTINCT <ident>` to `Call` expression
This simplifies downstream processing of the AST if DISTINCT is
consistent.
2023-04-18 16:47:52 +10:00
Stuart Carnie c506d88381
chore: Use functions from `error` module 2023-04-18 06:24:24 +10:00
Stuart Carnie ad3e6aadea
Merge branch 'main' into sgc/issue/last_7538
# Conflicts:
#	iox_query_influxql/src/plan/planner.rs
2023-04-18 06:18:02 +10:00
Stuart Carnie 753f6aa85e
chore: Grammar 2023-04-18 06:02:06 +10:00
Marco Neumann 87ecdc5eaa
feat: InfluxQl `SHOW TAG KEYS` planner+exec (#7451)
Closes https://github.com/influxdata/idpe/issues/17363 .
2023-04-17 13:31:33 +00:00
Marco Neumann e7511c0f33
feat: basic InfluxQL `SHOW MEASUREMENTS` (#7504)
No WHERE-clauses hat result in actual data checks yet, just pure metdata
queries.

Ref https://github.com/influxdata/idpe/issues/17358 .
2023-04-17 11:28:01 +00:00
Marco Neumann bda9c07c0b
feat: basic InfluxQL `SHOW TAG KEYS` support (#7526)
- No `ON` clause
- No `WHERE` clause
- No time restriction yet
- No `FROM <db>.<retention>`

Ref https://github.com/influxdata/idpe/issues/17360 .

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-17 10:01:41 +00:00
Stuart Carnie 4ef8daf498
chore: clippy 🔨 2023-04-17 12:09:04 +10:00
Stuart Carnie 3f4e38aa78
refactor: tidy up the implementation of the function_to_df_expr function
* Also fixes an issue that `FILL(<number>)` would fail when using the
  `struct_selector_<name>` functions
2023-04-16 10:04:53 +10:00
Stuart Carnie 252da2b75f
chore: add tests for the selector functions 2023-04-16 08:42:37 +10:00
Stuart Carnie 8f5f3b2057
chore: clarify comment 2023-04-16 08:36:59 +10:00
Stuart Carnie acd6cff631
chore: validate single-selector with tags or fields is not implemented 2023-04-16 08:21:19 +10:00
Stuart Carnie 8274d584f5
chore: update all remaining code to use `error` and `error::map` module 2023-04-16 08:00:12 +10:00
Stuart Carnie 69d75745cc
feat: add limited `last`, `first`, `min` and `max` selector functions
Returns a `NotImplemented` error when attempting to execute a
selector query, which projects a single selector function and additional
tags or fields until #7533 is implemented.

Introduced `error` module to simplify error handling and ensure
consistency of error messages.
2023-04-16 07:59:28 +10:00
Stuart Carnie 03ea8ea2b8
feat: add `last` selector function
This does not complete the implementation, as we must still use the
timestamp of the `struct_selector_last` when the projection semantics
are selector
2023-04-15 13:54:42 +10:00
Stuart Carnie 007d5b90f3
chore: add APIs to find selector user-defined aggregate functions
This will be used to complete queries that have selector semantics,
meaning they project a single selector function and therefore
use the timestamp for the time column.
2023-04-15 13:54:42 +10:00
Stuart Carnie d11097cf18
chore: add APIs to find selector user-defined aggregate functions
This will be used to complete queries that have selector semantics,
meaning they project a single selector function and therefore
use the timestamp for the time column.
2023-04-15 13:54:42 +10:00
Stuart Carnie 42074e7a9d
chore: refactor and rename `validate_select`
This will be used to determine the semantics of the projection clause
2023-04-15 13:54:42 +10:00
Stuart Carnie 3529762726
chore: remove `println` 2023-04-15 13:54:42 +10:00
Andrew Lamb 3ebd07358b
chore: Update DataFusion pin, upgrade `date_bin` and `InfluxQL` to use `Interval(MonthDayNano)` (#7516)
* chore: Update datafusion

* chore: Update for change in PhysicalSortExpr

* refactor: Update date_bin_gapfill to take IntervalMonthDayNano, fix FlightSQL

* 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-04-13 10:43:32 +00:00
dependabot[bot] e811a69a1e
chore(deps): Bump serde_json from 1.0.95 to 1.0.96 (#7535)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.95 to 1.0.96.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.95...v1.0.96)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-13 10:07:32 +00:00
Stuart Carnie 5965cee179
feat: Update InfluxQL end-to-end test output (#7512)
* feat: Specialises test output formatting for each language

* Also fixes an error uncovered in the `write_columnar` when tag
  columns are `NULL`

Closes #7145

* chore: Run cargo hakari tasks

* chore: Add sorted output until #7513 is addressed

* chore: clippy 📋

* feat: Add `options` to `write_columnar`

* Added ability to configure border rendering, including removing
  borders. This helps avoid variable width issues with EXPLAIN output,
  which tends to vary and cause flaky test failures.

* chore: rustfmt 🧹

* chore: update expected output

* chore: clarify what "this" is

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
2023-04-13 09:58:12 +00:00
Marco Neumann c7197a289e
fix: gRPC error code for invalid InfluQL (#7519)
This was "internal". The mapping works like this: we take the
`DataFusionError` and call `find_root` which should traverse the
`External(...)` chain (even through Arrow) to find the last error that
is not within the Arrow/DataFusion land. This is then mapped by us.

`DataFusionError::External(...)` is no further inspected and mapped
straight to "internal". I think this if fine because in the end we're
mostly dealing w/ DataFusion stuff anyways.

I've slightly changed the error mapping in the planner to emit
`DataFusionError::Plan(...)` instead which we map to "invalid argument".
I think this is way better for the user.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-12 16:00:38 +00:00
Marco Neumann e7fcb25904
feat: `SHOW FIELD KEYS` InfluxQL plan+exec (#7405)
Closes https://github.com/influxdata/idpe/issues/17362
2023-04-12 09:09:29 +00:00
Stuart Carnie 772b79b86b
feat: Validate the semantics of the projection clause of a SELECT (#7500)
* feat: Validate the semantics of the projection clause of a SELECT

Closes #7499

* chore: Complete sentences are helpful 😂
2023-04-11 22:43:23 +00:00
Stuart Carnie b629023f45
feat: Add `FILL(linear)` support (#7466)
* feat: Add FILL(linear) support

Closes #6916

* chore: Remove old test output

* chore: Fix `FILL(linear)` test
2023-04-08 21:34:30 +00:00
Stuart Carnie b9479a2b3c
refactor: `limit` function supports multiple measurements and tag sets (#7464)
* fix: Add sort operator after window aggregate operator

Closes #7460

* fix: Refactor `LIMIT` and `OFFSET` implementation

These changes should allow the `limit` function to be used
generically with any plan following the same conventions.

* chore: No need to reorder this

* chore: Add documentation to the `limit` function
2023-04-08 21:22:54 +00:00
Stuart Carnie 9f5fec42b8
feat: Teach InfluxQL how to plan `LIMIT` and `OFFSET` with `GROUP BY` (#7447)
* feat: Support LIMIT and OFFSET with GROUP BY

* fix: Compile error

* chore: Improve function name and comment

* chore: rustfmt

* chore: fix clippy warnings

Allowing the too-many-arguments warning for project_select,
as it will require some refactoring after this PR has already
been reviewed. It may be refactored in the future when subqueries are
implemented
2023-04-05 23:01:56 +00:00
Christopher M. Wolff d57a4f8947
refactor: make null-as-missing default behavior for LOCF (#7443)
* refactor: make null-as-missing default behavior for LOCF

* test: update InfluxQL test

---------

Co-authored-by: Christopher Wolff <cwolff@athena.tail244ec.ts.net>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-04 18:03:09 +00:00
Stuart Carnie a1b29b3ebb
fix: Incorrect results when planning aggregate expressions (#7431)
* fix: Incorrect results when mixing non-existent fields in aggregates

* chore: Improve comments around aggregates
2023-04-04 00:19:50 +00:00
Stuart Carnie 2dddda7c33
refactor: InfluxQL parser improvements (#7403)
* chore: Simplify insta snapshots

* chore: Extract struct-like enums to structs

This is in line with DataFusion, which also represents many of its
expression types as struct. The change permits explicit visit
methods for these new types.

These changes will be used by rewriting and visitors to treat the
types, such as Call as an atomic unit that can be replaced.
2023-04-02 21:41:49 +00:00
Stuart Carnie 19a0c7fe9c
feat: Teach InfluxQL how to process `FILL(null|previous|<value>)` (#7359)
* chore: Publicise gap-filling APIs

Helps #6916

* feat: IOx learns `FILL(null|previous|<value>)`

Helps #6916

* chore: More test cases

* chore: Revert change to TreeNodeVisitor

* chore: Update snapshot with expected gap-filling changes
2023-03-29 23:11:20 +00:00
Stuart Carnie a26cb6032a
feat: InfluxQL learns LOG function (arity 2) (#7333) 2023-03-28 20:22:27 +00:00
Andrew Lamb 43e236e040
chore: Update datafusion again (#7353)
* chore: Update DataFusion

* refactor: Update predicate crate for new transform API

* refactor: Update iox_query crate for new APIs

* refactor: Update influxql for new API

* 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-03-28 16:21:49 +00:00
dependabot[bot] 1ad0160d30
chore(deps): Bump serde_json from 1.0.94 to 1.0.95 (#7348)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.94 to 1.0.95.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.94...v1.0.95)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-28 11:09:59 +00:00
Stuart Carnie 08ef689d21
feat: Teach InfluxQL how to plan an aggregate query (#7230)
* feat: Display failed query

Allows a user to immediately identify the failed query.

* feat: API improvements to InfluxQL parser

* feat: Extend `SchemaProvider` trait to query for UDFs

* fix: We don't want the parser to panic on overflows

* fix: ensure `map_type` maps the timestamp data type

* feat: API to map a InfluxQL duration expression to a DataFusion interval

* chore: Copied APIs from DataFusion SQL planner

These APIs are private but useful for InfluxQL planning.

* feat: Initial aggregate query support

* feat: Add an API to fetch a field by name

* chore: Fixes to handling NULLs in aggregates

* chore: Add ability to test expected failures for InfluxQL

* chore: appease rustfmt and clippy 😬

* chore: produce same error as InfluxQL

* chore: appease clippy

* chore: Improve docs

* chore: Simplify aggregate and raw planning

* feat: Add support for GROUP BY TIME(stride, offset)

* chore: Update docs

* chore: remove redundant `is_empty` check

Co-authored-by: Christopher M. Wolff <chris.wolff@influxdata.com>

* chore: PR feedback to clarify purpose of function

* chore: The series_sort can't be empty, as `time` is always added

This was originally intended as an optimisation when executing an
aggregate query that did not group by time or tags, as it will produce
N rows, where N is the number of measurements queried.

* chore: update comment for clarity

---------

Co-authored-by: Christopher M. Wolff <chris.wolff@influxdata.com>
2023-03-23 01:13:15 +00:00
Andrew Lamb 8ab553180e
chore: Update datafusion again (#7276)
* chore: Update DataFusion pin

* chore: Update for new Expr type

* fix: deprecated

* chore: Run cargo hakari tasks

* docs: Update predicate/src/lib.rs

* fix: fmt

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-21 18:25:04 +00:00
Andrew Lamb 7dfaa05e8a
chore: Update datafusion again (#7208)
* chore: update datafusion again

* fix: update test

* fix: use table_reference

* fix: clean up import

* 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-03-16 14:34:40 +00:00
Stuart Carnie fe48a685ec
refactor: Move InfluxQL behaviour from iox_query to new crate (#7156)
* refactor: Break unnecessary dependencies from `iox_query` crate

In the process, the test code has been simplified.

* refactor: Move InfluxQL plan module to iox_query_influxql crate

* refactor: Move remaining behaviour from iox_query to iox_query_influxql

* chore: rustfmt 🙄

I was under the impression `clippy` would catch formatting
2023-03-08 22:29:20 +00:00