* refactor: use concrete backend type in `ChangeRequest`
* refactor: "remove if"-checks shall NOT count as "used"
* test: improve docs
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
* chore: Refactor `FROM` clause parser to be generic
This will allow us to use it for `DELETE` statements, which has
a more restrictive requirement, only allowing regular expressions
or single part identifiers.
* feat: Add `DELETE` series statement
* chore: Add test case for insignificant whitespace between operators
NOTE: Added a skipped test until #5663 is implemented
* feat: Add `DROP MEASUREMENT` statement
* chore: Add DropMeasurementStatement struct
* chore: `Statement` enum contains only `Box`ed types
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
The default statement logging verbosity of the `sqlx` crate is INFO, which
is frankly surprising.
The reason we didn't bother with lowering this before is that the `sqlx` crate
emits logs using the `log` crate, and we're using the `tracing` crate for logging too.
We did bridge the two logging ecosystems with https://docs.rs/tracing-log/latest/tracing_log/
but until https://github.com/influxdata/influxdb_iox/pull/5680 the bridge wasn't really working
so we didn't notice the *very* verbose logs of sqlx sstatement logging (which log our whole SQL multiline statements as INFO logs...)
* refactor: concurrent table scan in "field columns"
Similar to #5647 and #5649.
* docs: improve
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
See <https://rustsec.org/advisories/RUSTSEC-2021-0139.html>.
This follows the migration that `tracing-subscriber` will perform:
https://github.com/tokio-rs/tracing/pull/2287
Note that `tracing-subscriber` is not released yet, so for the time
being we will have `ansi_style` and `nu-ansi-style` in our dependency
list. It's likely that `tracing-subscriber` will backport and and
release this change rather soon though, because people are getting
annoyed by RUSTSEC warnings.
* feat: Add `SHOW DATABASES`
* feat: Add `SHOW RETENTION POLICIES`
* chore: Drive by clean up, use consistent names for functions
* feat: Parse `SHOW TAG KEYS` statement
* chore: drive-by: Ensure parsing succeeds when whitespace omitted
* feat: `SHOW TAG VALUES` statement
* feat: `SHOW FIELD KEYS` statement
* chore: Finish docs
* chore: Add additional docs to `FromMeasurementClause`
NOTE: technically, the EBNF does not match the current implementation,
but will be addressed in #5662
Instead of passing the ShardId into each function for child nodes of the
Shard, store it. This avoids the possibility of mistakenly passing the
wrong value.
A partition belongs to a table - this commit stores the table name in
the PartitionData (which was readily available at construction time)
instead of redundantly passing it into various functions at the risk of
getting it wrong.
When we construct a PartitionData we have the ShardId and TableId. This
commit stores them in the PartitionData for later use, rather than
repeatedly passing them in again when constructing snapshots, at the
risk of passing the wrong IDs.
Partition::snapshot_to_persisting() passes the ID of the partition it is
calling `snapshot_to_persisting()` on. The partition already knows what
its ID is, so at best it's redundant, and at worst, inconsistent with
the actual ID.
Changes the ingest code path to eliminate scanning the parquet_files
table to discover the last persisted offset per partition, instead
utilising the new persisted_sequence_number field on the Partition
itself to read the same value.
This lookup blocks ingest for the shard, so removing the expensive query
from the ingest hot path should improve catch-up time after a
restart/deployment.
This will work the same way that compacting level 0 -> level 1 does
except that the resulting files won't be split into potentially multiple
files. It will be limited by the memory budget bytes, which should limit
the groups more than the max_file_size_bytes would.