Commit Graph

49545 Commits (80de52f15ffec1d21c7321483cdaac04bf8abc4c)

Author SHA1 Message Date
Jackson Newhouse 80de52f15f
fix(processing_engine): Update Dockerfile and pip installer so pip works. (#25987) 2025-02-11 09:08:01 -08:00
Trevor Hilton 9646691d96
fix: serialize distinct cache in catalog (#25990)
The distinct cache info for tables was not serialized in the catalog.
This fixes it, but also updates the catalog serialization to use the
snapshot type serialization from the Catalog type all the way down.

The Eq and PartialEq impls were removed from Catalog and InnerCatalog
as they were only used in tests, and wer replaced by pure insta snapshot
tests.

A test was added to check that the distinct cache serializes/deserializes
2025-02-11 11:04:31 -05:00
Trevor Hilton 04f10ad290
fix: distinct cache panic on projection pushdown (#25988)
Fixed a bug in the distinct cache where projection that skipped column
in the cache hierarchy caused a panic.

This simplifies the display of the projection in the DistinctCacheExec
in EXPLAIN output to not include the column index, and only the name.
2025-02-11 09:22:54 -05:00
peterbarnett03 dca5350b10
fix: docker command was wrong (#25984) 2025-02-10 15:13:29 -05:00
Trevor Hilton f5b561b6c9
refactor: use macro to define id types (#25986)
* refactor: use macro to define catalog id types

* refactor: make catalog table limit test faster
2025-02-10 14:30:17 -05:00
clia c94237942e
fix: typo in influxdb3 client docs (#25977) 2025-02-09 21:10:33 -05:00
Michael Gattozzi cf1dd5c831
fix: broken format for JSON queries and add tests (#25980)
In #25927 we missed that JSON queries were broken despite having some
tests use the format. This fixes JSON queries such that they now
properly contain a comma between RecordBatches. This commit also
includes tests for the formats that now stream data back (CSV, JSON, and
JSON Lines) so that we won't run into this issue again.
2025-02-06 20:25:18 -05:00
Trevor Hilton 1ac67a3ca1
fix: remove request uri from error log (#25981) 2025-02-06 14:47:22 -05:00
Trevor Hilton c9f4d45937
chore: backport change from enterprise (#25978) 2025-02-06 12:42:50 -05:00
praveen-influx 6ca3411862
chore: remove log line (#25976) 2025-02-05 22:23:46 +00:00
praveen-influx 5b2354c7ab
feat: port changes back to core from enterprise (#25975)
Includes 2 main changes
- update the function signature for `cache_parquet_files`
- bring in `Evict` variant for parquet `CacheRequest`
2025-02-05 22:22:04 +00:00
praveen-influx 3058140faf
feat: remove unnecessary item in log (#25974) 2025-02-05 21:45:46 +00:00
praveen-influx fa69045f5b
chore: fixes for the build (#25973)
- missing clone/copy impl for NoProcessingEngine
- scope the visibility of a method
2025-02-05 17:44:24 +00:00
Jackson Newhouse fbcb9403c4
feat(processing_engine): log processing engine logging calls to sys events. (#25939) 2025-02-04 15:16:04 -08:00
wayne fa18b6d8da
refactor: DRY up influxdb3_client code (#25962)
* deduplicate QueryParams->QueryRequest and Format->QueryFormat
* move WriteParams into influxdb3_types crate
* DRY up client HTTP request handling code in *RequestBuilder.send
  methods.
* DRY up a bunch of other non-Builder http request handling
2025-02-04 08:54:37 -07:00
wayne 27653f5a76
fix: enable workspace lints on all crates, fix all lints (#25961) 2025-02-03 17:38:20 -07:00
wayne ca25ab6f70
fix: remove accidentally-commited dbg! macro (#25958) 2025-02-03 15:48:35 -07:00
Jackson Newhouse f58f3439cd
fix(processing_engine): ensure default SIGINT behavior from python. (#25957) 2025-02-03 14:31:04 -08:00
wayne 0fffcc8c37
refactor: introduce influxdb3_types crate (#25946)
Partially fixes https://github.com/influxdata/influxdb/issues/24672

* move most HTTP req/resp types into `influxdb3_types` crate
* removes the use of locally-scoped request type structs from the `influxdb3_client` crate
* fix plugin dependency/package install bug
  * it looks like the `DELETE` http method was being used where `POST` was expected for `/api/v3/configure/plugin_environment/install_packages` and `/api/v3/configure/plugin_environment/install_requirements`
2025-02-03 11:28:47 -07:00
Jackson Newhouse 1dab1707ce
fix(processing_engine): Don't set current_dir to plugin_dir when creating virtual environment. (#25931) 2025-02-03 09:43:35 -08:00
praveen-influx 911ba92ab4
feat: clear query buffer incrementally when snapshotting (#25948)
* feat: clear query buffer incrementally when snapshotting

This commit clears the query buffer incrementally as soon as a table's
data in buffer is written into parquet file and cached. Previously,
clearing the buffer happened at the end in the background

* refactor: only clear buffer after adding to persisted files

* refactor: rename function
2025-02-02 16:51:53 +00:00
Trevor Hilton 23b77946f4
refactor: remove buffer index and literal guarantee analysus in filter (#25949)
This removes the buffer index from the write buffer in core and lifts the
literal guarantee analysis from the ChunkFilter.
2025-01-31 14:43:10 -05:00
Jackson Newhouse d9dd8a32a2
fix(processing_engine): Use the configured request path for Request plugins. (#25945) 2025-01-31 10:36:47 -08:00
Michael Gattozzi 20fdc7b51b
feat: stream data back for CSV and JSON queries (#25927)
This commit allows us to stream data back for CSV and JSON formatted
queries. Prior to this we would buffer up all of the data in memory
before sending it back. Now we can make it so that we only buffer in
one RecordBatch at a time to reduce memory overhead.

Note that due to the way the APIs for writers work and for how Body in
hyper 0.14 works we can't use a streaming body that we can write too.
This in turn means we have to use a manually written Future state
machine, which works but is far from ideal.

Note this does not include the pretty and parquet files as streamable.
I'm attempting to get the pretty one to be streamable, but I don't think
that this one and parquet are as likely to be streamable back to the
user. In general we might want to discourage these formats from being
used.
2025-01-31 13:25:30 -05:00
Michael Gattozzi b7d2475ea6
chore: move separate cli and server tests (#25934)
This commit restructures our tests to look like Enterprise in their
layout. We break cli.rs into it's own module, combine the server tests
and cli tests under one lib.rs file and handle the changes for
visibility and import paths needed to make things work. the packages
tests have been cfged out as a module so that it would not need to be
added on a per test basis. Note that those tests fail locally for me
currently, but it seems like we weren't testing these in CI at the
moment.

There is no issue for this.
2025-01-31 11:41:44 -05:00
Jackson Newhouse 3a2a830a39
fix: persist create database action. (#25944) 2025-01-30 16:01:41 -08:00
praveen-influx 56ca85ef8e
feat: introduce parquet caching in query path (#25937)
* feat: introduce parquet caching in query path

This commit scans the parquet files that will be used in query to check
if they can be cached. There are three conditions to satisfy,
  - not cached already
  - cache has enough space
  - file times overlap with the cache policy times

closes: https://github.com/influxdata/influxdb/issues/25906

* refactor: rename env var
2025-01-30 21:16:37 +00:00
wayne 05da40fa9b
fix: clarify table creation conflict error message (#25936)
Also include a basic CLI integration test to exemplify the new error message.
2025-01-30 13:08:35 -07:00
wayne bb92eb0759
feat: add precision flag to write subcommand (#25935)
* feat: add --precision flag to 'influxdb3 write'
* test: add tests to validate 'influxdb write --precision'
2025-01-30 11:08:17 -07:00
wayne 99c9d02baa
feat: add 'show system' subcommand to display system tables (#25912)
test: add 'show system' subcommand tests
2025-01-29 10:44:19 -07:00
Jackson Newhouse 8840d99e9d
feat(processing_engine): integration with virtual environments. (#25895)
* feat(processing_engine): integration with virtual environments.

* feat: Initial scaffolding for environment managers (pip, pipx, uv).

* feat(processing_engine): CLI for package management, remove pipx support.

* feat(processing_engine): test installations in virtualenvs.

* feat(processing_engine): Automatically setup virtual environment on startup.
2025-01-28 15:30:17 -08:00
Trevor Hilton 705a1659ad
fix: last cache with specific value columns can be queried (#25924) 2025-01-27 14:59:24 -05:00
Paul Dix 9a5424693c
feat: Update trigger creation to validate plugin file present (#25918)
This updates trigger creation to load the plugin file before creating the trigger.

Another small change is to make Github references use filenames and paths identical to what they would be in the plugin-dir. This makes it a little easier to have the plugins repo local and develop against it and then be able to reference the same file later with gh: once it's up on the repo.
2025-01-27 12:31:49 -05:00
Michael Gattozzi b9a8adbe98
feat: persist snapshots in parallel (#25901)
This speeds up snapshot persistence by taking all of the persist jobs
and running them simultaneously on a JoinSet. With this we can speed
things up a bit by not waiting for each file to persist before the next
one can be persisted. Instead we now can run all the persisting at the
same time using the tokio runtime.

Closes #24658
2025-01-27 11:44:23 -05:00
Paul Dix d49276a7fb
feat: Refactor plugins to only require creating trigger (#25914)
This refactors plugins and triggers so that plugins no longer need to be "created". Since plugins exist in either the configured local directory or on the Github repo, a user now only needs to create a trigger and reference the plugin filename.

Closes #25876
2025-01-27 11:26:46 -05:00
Michael Gattozzi 43e186d761
feat: add no_sync write_lp param for fast writes (#25902) 2025-01-24 13:34:38 -05:00
Michael Gattozzi 061b62a09b
feat(cli): write & query via stdin, string & file (#25907)
This change allows *both* the write and query commands to accept input
via stdin, string, or by a file. With this change larger queries are more
feasible to write as they can now be written in a file and smaller
writes via a string are now possible. This also makes the program work
more like people would expect it to, especially on unix based systems.

This commit also contains three tests to make sure the functionality works
as expected.

Closes #25772
Closes #25892
2025-01-24 10:02:44 -05:00
praveen-influx 4ef972eab4
feat: first stab at locally updating parquet cache (#25904)
* feat: first stab at locally updating parquet cache

closes: https://github.com/influxdata/influxdb/issues/25887

* refactor: use enums to separate out the modes

This commit introduced the `Immediate` and `Eventual` modes for
fulfilling the cache request. In immediate mode since the data is
readily available to be cached, we can avoid extra requests to object
store.

part of: https://github.com/influxdata/influxdb/issues/25887
2025-01-24 14:36:06 +00:00
Trevor Hilton 07bd04b423
fix: add alias for node_id to writer_id for backward compatibility (#25910) 2025-01-23 22:10:16 -05:00
Trevor Hilton d451ef0de6
refactor: writer-id to node-id (#25905) 2025-01-23 18:09:24 -05:00
Paul Dix 266e1ff78c
fix: fix pugin code that broke main (#25909) 2025-01-23 17:53:44 -05:00
Paul Dix c672ee8d1f
feat: each plugin type uses its own channel (#25908) 2025-01-23 12:35:50 -08:00
Jackson Newhouse f1ea2d8747
feat(processing_engine): Add every mode for scheduled plugins. (#25891) 2025-01-23 11:22:57 -08:00
Michael Gattozzi 63bd5096f5
feat: loosen 72 hour query/write restriction (#25890)
This commit does a few key things:

- Removes the 72 hour query and write restrictions in Core
- Limits the queries to a default number of parquet files. We chose 432
  as this is about 72 hours using default settings for the gen1
  timeblock
- The file limit can be increased, but the help text and error message
  when exceeded note that query performance will likely be degraded as
  a result.
- We warn users to use smaller time ranges if possible if they hit this
  query error

With this we eliminate the hard restriction we have in place, but
instead create a soft one that users can choose to take the performance
hit with. If they can't take that hit then it's recomended that they
upgrade to Enterprise which has the compactor built in to make
performant historical queries.
2025-01-23 10:02:26 -05:00
Trevor Hilton 44ca7a4d36
refactor: reduce catalog locks when getting chunks (#25896)
* refactor: reduce catalog locks when getting chunks

The main refactor was to change the ChunkContainer trait to use the
DatabaseSchema and TableDefinition types directly in the signature, vs.
the names, which then required an additional catalog lock and lookups for
both entities. This was already handled upstream in the QueryTable, so
there was no need to do the lookups again.

This required the addition of a test helper in influxdb3_write::test_helpers
that provides convenience methods for getting record batches from the
WriteBuffer. We have been implementing such a method manually in several
places, so this is nice to have it unified. This provides a blanket impl
so that anything implementing WriteBuffer gets the method.

Some other house cleaning was included.

* refactor: clean up test helpers in influxdb3_write

* refactor: pass original df filters forward with ChunkFilter

* chore: clippy
2025-01-22 14:38:46 -05:00
Paul Dix f3efa35670
feat: reloads plugins if modified (#25865)
This updates plugins so that they will reload the code if the local file is modified. Github pugins continue to be loaded only once when they are initially created or loaded on startup.

This will make iterating on plugin development locally much easier.

Closes #25863
2025-01-22 06:21:07 -08:00
Paul Dix e87f8862b3
feat: Add request plugin capability (#25864)
* feat: Add request plugin capability

Adds the request plugin type. Triggers can be bound to an API endpoint at /api/v3/engine/<path>. Requests will get yielded to the plugin with the query parameters, request parameters, and request body.

I didn't implement the test endpoint for this plugin type as it seems much more natural for users to save the file and make a new request. Once #25863 is done it'll make it very easy.

Closes #25862

* chore: fix spelling in error message
2025-01-21 20:22:27 -08:00
praveen-influx d39a4a2f21
feat: rename json_lines to jsonl for cli (#25888)
closes: https://github.com/influxdata/influxdb/issues/25873
2025-01-21 17:32:55 +00:00
Trevor Hilton d1fd155b21
feat: use u64 hash in buffer index instead of str literal (#25883)
* feat: use u64 hash in buffer index instead of str literal

* refactor: move hash of column after if branch and add docs
2025-01-21 09:09:25 -05:00
praveen-influx 447f66d9a7
fix: allow default browser header (#25885)
Although the `format` in the request is used, the value coming
through the header is parsed earlier. So, when that lookup in
the header fails an error is returned (`InvalidMimeType`).

In this commit, there are extra checks to allow the default `Accept`
header values that come from the browser by defaulting it to `json`

closes: https://github.com/influxdata/influxdb/issues/25874
2025-01-21 13:43:07 +00:00