Commit Graph

532 Commits (41d93aea4d8e407b772e3e935f1e9e3ddb4dbe88)

Author SHA1 Message Date
Carol (Nichols || Goulding) 5e6dbec909
fix: Remove tombstones as they aren't functional currently 2023-04-14 13:36:08 -04:00
Andrew Lamb f46d06d56f
chore: Update DataFusion + arrow ecosystem to 37 (#7544)
* chore: Update datafusion and arrow/parquet to 37, tonic to 0.9.1

* refactor: Update for FieldRef and other API changes

* fix: Update field size calculation

* fix: Use `NullBuffer` directly

* fix: remove outdated comment

* chore: Update test for tonic

* chore: Run cargo hakari tasks

* chore: cargo update

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-14 12:43:01 +00:00
Chunchun Ye 69da3c2495
feat(flightsql): Support `GetCrossReference` metadata endpoint with an empty RecordBatch (#7548)
* feat: support CommandGetCrossReference metadata endpoint with tests

* chore: create two tables in the test for GetCrossReference endpoint

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-13 19:53:37 +00:00
Chunchun Ye 5182ab0037
chore: add more test and logic to grpc database header names (#7529)
* chore: support returning the database name if all the keys refer to the same database

* test: add test cases to check for same, different, and no database in request header

* chore: lint

* chore: more lint

* refactor: replace empty string with None for database_name

* refactor: simplify logic for NoFlightSQLDatabase error

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-13 18:28:29 +00:00
Chunchun Ye 8bf47df621
feat(flightsql): Support `GetImportedKeys` metadata endpoint with an empty RecordBatch (#7546)
* feat: support CommandGetImportedKeys metadata endpoint with tests

* chore: remove comments that is no longer valid

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-13 18:06:47 +00:00
kodiakhq[bot] 0020660b53
Merge branch 'main' into cn/remove-old-querier 2023-04-13 13:59:52 +00:00
Chunchun Ye e86e8de1a9
feat: support CommandGetExportedKeys metadata endpoint with tests (#7532)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-13 13:27:09 +00: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
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
Christopher M. Wolff cbd747db44
feat: update gap fill planner rule to use `interpolate` (#7494)
* feat: add INTERPOLATE fn and update planner gap-fill planner rule

* test: add an end-to-end test for interpolate()
2023-04-12 21:51:44 +00:00
Carol (Nichols || Goulding) acf857816e
fix: Remove old querier 2023-04-12 13:18:23 -04:00
Chunchun Ye fb6b3f66da
feat(flightsql): support `database`, `bucket`, and `bucket-name` as grpc header names (#7511)
* feat: support `database`, `bucket`, and `bucket-name` as grpc header names

* chore: lint

* chore: update doc to accept `database`, `bucket`, and `bucket-name` as parameter names

* chore: update doc to only show `database` as the parameter name

* refactor: consolidate header names into a const vec and update comments on database

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-12 16:58:44 +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
Carol (Nichols || Goulding) d025362ce0
fix: Remove old router 2023-04-12 10:15:48 -04: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
Marco Neumann f97e1765d8
fix: do not loose schema for empty query responses (#7506)
Within our query tests and our CLI, we've used to print out empty
query responses as:

```text
++
++
```

This is pretty misleading. Why are there no columns?! The reason is that
while Flight provides us with schema information, we often have zero
record batches (because why would the querier send an empty batch). Now
lets fix this by creating an empty batch on the client side based on the
schema data we've received. This way, people know that there are columns
but no rows:

```text
+-------+--------+------+------+
| count | system | time | town |
+-------+--------+------+------+
+-------+--------+------+------+
```

An alternative fix would be to pass the schema in addition to
`Vec<RecordBatch>` to the formatting code, but that seemed to be more
effort.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-11 14:35:29 +00:00
Chunchun Ye b131895fc2
feat(flightsql): Support `GetPrimaryKeys` metadata endpoint with an empty RecordBatch (#7496)
* feat: add CommandGetPrimaryKeys metadata endpoint and tests

* chore: update schema for the returned record batch

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-11 14:13:44 +00:00
Martin Hilton 1a42155077
chore: end to end tests for authorization (#7441)
* chore: end-to-end tests for authorization

Add tests to validate the behaviour of the authorization machinery
in the write and query paths.

In order to facilitate this an authorizer implentation has been
added to the the test helpers that runs an authorizer gRPC service
for the use of tests. The gRPC service is started in the process
that is running the test and listens on a OS-assigned port number.
The authorization service cannot be shared between tests so a
non-shared cluster must be used when the authorizer is configured.

The influxdb_iox_client has been enhanced so that the user can
configure additional headers in the flight client, which is used
for SQL and InfluxQL queries. This uses the same interface as the
Flight SQL client has for the same job.

* chore: fix lint errors

* chore: review suggestion

Consolate the authorization tests into fewer tests in order to avoid
repeating set-up and tear-down unnecessarily.
2023-04-11 09:56:45 +00:00
kodiakhq[bot] 3a8b9d9ae2
Merge branch 'main' into cn/remove-old-ingester 2023-04-10 13:37:01 +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
Carol (Nichols || Goulding) 6c2ce01f1e
fix: Remove old ingester and ioxd_ingester 2023-04-07 11:06:37 -04:00
Carol (Nichols || Goulding) 004a264d93
test: Remove a moot test for removed compactor command 2023-04-06 16:58:04 -04: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
Fraser Savage 9fcaee9ac9
Merge branch 'main' into savage/6824-update-namespace-service-limit-api-call 2023-04-05 14:52:44 +01: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
Marco Neumann f04962d630
feat: new query planning (#7250)
Closes #6098.
2023-04-03 10:31:03 +00:00
Carol (Nichols || Goulding) 5efc59d08a
docs: Fix out of date docs for test ChunkStage 2023-03-31 16:00:53 -04:00
Carol (Nichols || Goulding) 89d5cb7fb3
feat: Clarify test setup logging 2023-03-31 16:00:53 -04:00
Carol (Nichols || Goulding) 6335ed24fa
test: Use a setup that never persists for a test that expects ingester data
Fixes #7404.
2023-03-31 16:00:44 -04:00
Fraser Savage 30b292f3df
feat(cli): Update namespace service protection limits
This commit adds a client method to invoke the
UpdateNamespaceServiceProtectionLimits RPC API, providing a user
friendly way to do this through the IOx command line.
2023-03-31 17:14:20 +01:00
Andrew Lamb 555f2a67aa
refactor(flightsql): Build `GetDBSchemas` directly from DataFusion catalog (#7386)
* refactor: Build `GetDBSchemas` directly from DataFusion catalog

* fix: Apply suggestions from code review

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-30 13:28:34 +00:00
Andrew Lamb 5f372b022c
test: add new test for decoded table_schema (#7385)
Co-authored-by: Chunchun <14298407+appletreeisyellow@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-30 13:20:48 +00:00
Marco Neumann 4a067a635b
test: improve query test filter normalization (#7382)
- Only redact the actual time value in `FilteExec`, not the entire
  expression. This preserves important information about filter
  pushdowns.
- Apply similar time filter to `ParquetExec` because with #6098 we will
  push down more filters into `ParquetExec`, including retention
  policies.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-30 10:50:31 +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
Christopher M. Wolff f41c1a7945
feat: update gap fill planner rule to use LOCF (#7358)
* feat: update gap fill planner rule to use LOCF

* chore: cargo fmt

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-29 15:45:34 +00:00
Marco Neumann 75dba43ced
test: extend retention policy query test (#7352)
Add an ingester chunk to the parquet chunks.

Helpful for #6098.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-29 05:32:22 +00:00
Stuart Carnie a26cb6032a
feat: InfluxQL learns LOG function (arity 2) (#7333) 2023-03-28 20:22:27 +00:00
Carol (Nichols || Goulding) 621672b38f
test: Add an e2e test for write replication and fix it because it didn't work 😜 (#7344)
* test: Add an e2e test for write replication

* fix: Pass through rpc_write_replicas configuration to RpcWrite handler

---------

Co-authored-by: Dom <dom@itsallbroken.com>
2023-03-28 09:31:16 +00:00
Andrew Lamb 0d66b04f68
refactor(flightsql): Build `GetTables` directly from DataFusion catalog (#7325)
* refactor: Build GetTables response directly from SessionContext

* fix: fmt

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-24 19:15:24 +00:00
Andrew Lamb 35865e1ab3
refactor(flightsql): Build `GetCatalogs` directly from DataFusion catalog (#7327)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-24 18:34:56 +00:00
Andrew Lamb ce77d3bd74
refactor(flightsql): Build `GetTableTypes` response directly from the catalog (#7324)
* refactor(flightsql): Do not use plan for GetTableTypes

* test: Add an end to end test
2023-03-24 15:20:28 +00:00
Chunchun Ye 9cd2a8816a
feat(flightsql): Support `include_schema` param in `GetTables` metadata endpoint (#7307)
* feat(flightsql): Add support for table_schema in GetTables and complies

feat(fightsql): Add support for table_schema in GetTables

support actual schema

it compiles / does not fail

* chore: resolve merge conflict

* chore: make table_schema optional

* test: update e2e test for `include_schema` = true

* chore: remove info!() and update test `flightsql_schema_matches`

* chore(deps): Bump rustix from 0.36.11 to 0.37.3 (#7308)

* chore(deps): Bump rustix from 0.36.11 to 0.37.3

Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.36.11 to 0.37.3.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.36.11...v0.37.3)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: Run cargo hakari tasks

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* chore: make real error for existing columns

* chore: user match instead of unwrap() on column names

* chore: use datafusion::physical_plan::collect() to get record batches

* chore: use `concat_batches` to combine multiple batches into single one and fix db schema test

* chore: add doc comment for GetTables

* chore: remove pretty print

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-24 14:59:30 +00:00
Andrew Lamb e929053109
test(fligthsql): Schema test coverage for GetTables table_schema=true (#7313)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-23 14:13:42 +00:00
Fraser Savage 8471baf567
refactor(cli): e2e test assert namespace not in list after deletion 2023-03-23 13:43:43 +00:00
Fraser Savage 5735aae998
feat(cli): Add namespace delete command
This adds the CLI action to call the namespace soft-deletion
gRPC endpoint and an associated e2e CLI test.
2023-03-23 11:23:00 +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
Chunchun Ye 87708dc64a
feat(flightsql): Add filters to `GetTables` metadata endpoint (#7289)
* feat: add optional param to GetTables

* chore: add the third param to query plan

* feat: add table_types param

* chore: clippy

* test: add test cases with filters

* chore: update query to avoid SQL injection

* refactor: update where clause and cleanup

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-22 20:14:01 +00:00
Andrew Lamb 7f7d0b8d52
fix(flightsql): Send correct schema in GetFlightInfo for Queries (#7283)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-22 13:58:44 +00:00
kodiakhq[bot] 18405a5919
Merge branch 'main' into cn/shard-tests 2023-03-22 13:36:27 +00:00
Andrew Lamb 779234eb20
chore(flightsql): Add tests that schema and data matches (#7280)
* fix(flightsql): Tests for matching schema in FligthSQL

* fix: Update influxdb_iox/tests/end_to_end_cases/flightsql.rs
2023-03-21 15:40:21 +00:00
Carol (Nichols || Goulding) 635b22b5a9
fix: Explicitly use memory catalog for invalid compactor CLI tests
To avoid the command picking up the catalog from your `.env`.
2023-03-20 16:40:46 -04:00
Carol (Nichols || Goulding) d8bd185fa0
test: Add compactor shard e2e tests 2023-03-20 15:52:47 -04:00
Andrew Lamb 184565b552
feat(flightsql): Implement FlightSQL `GetSqlInfo` endpoint (#7198)
* feat(flightsql): Implement GetSqlInfo endpoint

* chore: Add some comments to clarify the tests intent
2023-03-20 19:34:18 +00:00
Andrew Lamb 795a79a7ad
feat(flightsql): Add `GetTables` metadata endpoint without filters (#7238)
* test: Add getTables jdbc_client example

* feat: add `CommandGetTables` in FlightSqlClient

* feat: add `CommandGetTables` in flightsql cmd and planner

* test: add e2e test for `CommandGetTables`

* chore: clippy

* chore: comment out the test with filters

* test: update jdbc test expected value for tables

---------

Co-authored-by: Chunchun <14298407+appletreeisyellow@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-20 19:20:13 +00:00
Carol (Nichols || Goulding) 528d83e989
test: Re-enable running compactor once in step tests
Putting back the test that I removed in
<https://github.com/influxdata/influxdb_iox/pull/6850>

now that they can use `run compactor2 --compaction-process-once
--compaction-process-all-partitions`

thanks to <https://github.com/influxdata/influxdb_iox/pull/6886>!
2023-03-20 13:20:43 -04:00
Andrew Lamb 2bc495b29e
feat(flightsql): Support `GetTableTypes` metadata API (#7242)
* feat(flightsql): Support `GetTableTypes` metadata API

* chore: comment about possible optimization

* chore: fix logical conflict
2023-03-17 13:12:23 +00:00
Andrew Lamb 3f0073807f
chore(flightsql): `insta`ize flightsql end to end tests (#7236)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-16 14:41:49 +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
Marco Neumann d2874f5c02
test: fix chunk boundaries for retention query tests (#7235)
See code comment, found while working on #6098.
2023-03-16 13:14:08 +00:00
Andrew Lamb c819d4f865
feat(flightsql): Implement `GetDbSchemas` metadata API (#7213)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-16 10:13:51 +00:00
Andrew Lamb 6d6fd8f663
feat(flightsql): implement basic `CommandGetCatalogs` support (#7212)
* refactor: reduce redundancy in test

* chore: implement basic get_catalog support

* fix: clippy
2023-03-15 21:52:59 +00:00
Stuart Carnie 2b74f07fe5
feat: Support `GROUP BY` with tags in raw `SELECT` queries (#7109)
* chore: Normalise name of Call expression to lowercase

Simplifies matching functions in planner, as they are guaranteed to be
lowercase.

This also ensures compatibility with InfluxQL when generating column
alias names, which are reflected in updated tests.

* chore: Ensure aggregate functions fail gracefully.

* feat: GROUP BY tag support

* feat: Ensure schema-level metadata is propagated

Requires: https://github.com/apache/arrow-rs/issues/3779

* chore: Add some tests to validate GROUP BY output

* chore: Add clarifying comment

* chore: Declare message in flight.proto

The metadata is public API, so best practice is to encode this in a way
that is most compatible for clients in other languages, and will also
document the history of schema changes.

Added tests to validate the metadata is encoded correctly.

* chore: Placate linters

* chore: Use correct column in test cases

* chore: Add `is_projected` to the TagKeyColumn message

`is_projected` is necessary to inform a client whether it should include
the tag key is used exclusively for the group key (false) or also
projected in the `SELECT` column list.

* refactor: Move constants to `schema` crate per PR feedback

* chore: rustfmt 🙄

* chore: Update docs for InfluxQlMetadata

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

---------

Co-authored-by: Andrew Lamb <alamb@influxdata.com>
2023-03-07 22:40:23 +00:00
Andrew Lamb ed0704ac8d
chore: Update datafusion (#7100)
* chore: Update datafusion

* chore: iox_query to compile for API changes + update tests

* chore: Run cargo hakari tasks

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
2023-03-06 17:59:24 +00:00
Andrew Lamb e19ce98407
chore: Update datafusion + arrow/arrow-flight/parquet to 34.0.0 (#7084)
* chore: Update datafusion + arrow/arrow-flight/parquet to 34.0.0

* chore: Run cargo hakari tasks

* chore: Update plans

* chore: Update querier expected output

* chore: Update querier tests to use insta

* fix: sort output too

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-01 11:25:01 +00:00
Stuart Carnie 2ed5758ddb
feat: InfluxQL planner learns how to project multiple measurements (#7063)
* feat: Planner learns how to project multiple measurements

Closes #6896

* chore: Update test

* chore: PR feedback
2023-02-27 00:50:06 +00:00
Christopher M. Wolff 0282eb4750
feat: streaming implementation of gap filling (#7037)
* feat: streaming implementation of gap filling

* chore: cargo fmt

* refactor: when gapfilling, concatenate input batches less frequently

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-23 15:42:41 +00:00
Andrew Lamb f93baf7693
chore: Update DataFusion and `arrow` / `arrow-flight` / `parquet` to `33.0.0` (#7045)
* chore: Update DataFusion and arrow/arrow-flight/parquet to 33.0.0

* fix: Update test output

* fix: update more test output

* fix: Update querier test output

* chore: Run cargo hakari tasks

* test: fix formatting

Fix formatting of batch pretty printing.

* test: fix formatting

Fix formatting of batch pretty printing.

* test: fix formatting for selector tests

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: Dom Dwyer <dom@itsallbroken.com>
Co-authored-by: Christopher Wolff <chris.wolff@influxdata.com>
2023-02-22 21:24:20 +00:00
kodiakhq[bot] 48e6cce746
Merge branch 'main' into cn/less-shard-id 2023-02-22 15:05:37 +00:00
Stuart Carnie 929ac9081e
feat: Rewrite logical expression to match InfluxQL behaviour (#7031)
* chore: Move to inline snapshots

* chore: Container for the DataFusion and IOx schema

* chore: Simplify using logical expression helper functions

* feat: Rewrite conditional expressions using InfluxQL rules

* feat: Add tests to validation conditional expression rewriting

* feat: Rewrite column expressions

* chore: Rewrite expression to use false when possible

This allows the planner to optimise away the entire logical plan to an
empty plan in many cases.

* feat: Complete cast postfix operator support

Added `unsigned` postfix operator, as the feature was mostly complete.

Closes #6895

* chore: Remove redundant attribute
2023-02-21 20:01:31 +00:00
Carol (Nichols || Goulding) 65ba208f88
fix: Remove shard_id from the Parquet File protobuf in the catalog service 2023-02-17 13:53:03 -05:00
Andrew Lamb 27890b313f
chore: Update datafusion (#6997)
* chore: Update datafusion

* chore: update the plans

* fix: update some plans

* chore: Update plans and port some explain plans to use insta snapshots

* fix: another plan

* 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-02-16 17:03:25 +00:00
Carol (Nichols || Goulding) b11228c72e
test: Write an e2e test of namespace soft-deletion (#7002)
Co-authored-by: Dom <dom@itsallbroken.com>
2023-02-16 09:59:14 +00:00
Carol (Nichols || Goulding) 9e27709c84
test: Add an e2e test of just the ingester's API 2023-02-13 16:36:59 -05:00
Andrew Lamb 2751c77de6
chore: add extra debugging to help track down jdbc_client failures (#6968)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-13 12:14:39 +00:00
Andrew Lamb 143cb26e87
chore: Update datafusion again (#6958)
* chore: Update datafusion pin

* chore: Update plans

* 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-02-13 10:28:44 +00:00
Christopher M. Wolff a2510c8343
feat: partial implementation of gap filling operator (#6911)
* feat: partial implementation of gap filling operator

* chore: code review feedback

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-10 19:03:34 +00:00
Carol (Nichols || Goulding) 7b80b03b28
test: Test with multiple ingesters, like in production 2023-02-09 17:31:28 -05:00
Carol (Nichols || Goulding) 1794147b3c
fix: Only test querier panic logging; router2 and ingester2 now exit on panic 2023-02-09 13:56:07 -05:00
Carol (Nichols || Goulding) b5464aa82e
fix: Remove test that compacts once for now 2023-02-09 13:56:07 -05:00
Carol (Nichols || Goulding) 38f8e18357
fix: Only run end-to-end tests against Kafkaless 2023-02-09 13:56:06 -05:00
Carol (Nichols || Goulding) d7c59da46b
fix: Switch more tests over to the kafkaless architecture 2023-02-09 13:56:06 -05:00
Stuart Carnie a2945a77a4
fix: Implement EXPLAIN, ORDER BY and default ordering (#6864)
* chore: Add more tests

* chore: Fix default ordering; implement ORDER BY

* feat: Add EXPLAIN support

* chore: Add additional tests to validate GROUP BY expansion

* chore: More test cases for TZ, and failing log scalar function
2023-02-07 22:18:52 +00:00
Carol (Nichols || Goulding) f1f475d552
fix: Remove compactor generate (#6872)
This debugging tool was more useful in previous situations where it was
harder to get real data as input for the compactor.

It's currently causing a flaky test that isn't worth investigating.

Fixes #6190 by making it moot.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-06 19:19:15 +00:00
Dom Dwyer b8ec022ea6
test(e2e): HTTP error response
Ensure a HTTP error response contains a well-formed JSON structure
containing "code" and "message" fields (for backwards compatibility with
existing InfluxDB versions) and a correct "content-type" header.
2023-02-06 17:10:30 +01:00
Andrew Lamb ae10b33f0c
chore: Update datafusion (#6868)
* chore: Update datafusion

* chore: Run cargo hakari tasks

* fix: Update error message

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
2023-02-06 14:22:45 +00:00
Raphael Taylor-Davies d3601a59f8
chore: update DataFusion, upgrade `arrow` `arrow-flight` and `parquet` to `32.0.0` (#6756)
* chore: update DataFusion

* fix: test

* chore: format

* chore: clippy

* chore: update arrow

* chore: arrow upgrade fallout

* chore: Run cargo hakari tasks

* chore: remove failing warm compaction test

* fix: flight error propagation

* chore: update parquet size

* fix: Update error message

* chore: Update parquet metadata test

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: Andrew Lamb <alamb@influxdata.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-06 11:35:39 +00:00
Carol (Nichols || Goulding) ca8558e636
chore: Unnest test code out of the module and clean up long lines 2023-02-03 14:20:30 -05:00
Carol (Nichols || Goulding) b17d1c0862
test: Port more query tests to kafkaless 2023-02-03 13:56:01 -05:00
Carol (Nichols || Goulding) 30fea67701
fix: Move variables within format strings. Thanks clippy!
Changes made automatically using `cargo clippy --fix`.
2023-02-03 13:06:17 -05:00
Carol (Nichols || Goulding) b55e4ffa21
test: Port table_schema tests to end-to-end and get rid of query_tests (#6828)
* test: Port table_schema query_tests to end-to-end

* fix: Remove now outdated query_tests crate

---------

Co-authored-by: Andrew Lamb <alamb@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-03 17:41:08 +00:00
Andrew Lamb 673d1019f0
fix: Normalize for flaky tests (#6845) 2023-02-03 17:20:11 +00:00
Andrew Lamb 0d01306fd2
chore: port remote end to end tests to new write path (#6838)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-03 15:33:49 +00:00
Andrew Lamb b9ab09e944
chore: remove kafka full querier end to end tests (#6834)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-03 15:25:24 +00:00
Andrew Lamb ef98b8c348
chore: Port `influxrpc` end to end tests to new writepath (#6839)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-03 14:58:18 +00:00
Andrew Lamb 05ca71f91f
chore: Remove old ingester end to end tests (#6837)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-03 14:43:27 +00:00
Andrew Lamb 755d3586ea
chore: port cli end to end tests to kafkaless write path (#6836)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-03 14:35:05 +00:00
Andrew Lamb 012c35bf3e
chore: Port flightsql end to end tests for new kafkaless writepath (#6835)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-03 14:26:26 +00:00
Andrew Lamb acc258e9aa
chore: Update influxql end to end tests to kafkaless write path (#6833)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-03 14:11:55 +00:00