vectordotdev / vectordotdev/vector
New `cratedb` sink
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.6k
- Forks
- 2.3k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 146
Description
CrateDB is a distributed SQL database developed and maintained by @crate. I would like to add a CrateDB sink to Vector.
I have an initial working version that is based on the existing HttpService using CrateDB's HTTP endpoint for bulk inserts.
Since I'm quite new to working with @rust-lang I would love advice and support on what to change/do better, if the integration is accepted.
There are a few issues that I don't know yet how to solve:
- CrateDB supports arrays and objects as column values. The existing
json_parsertransform "flattens" nested structures like this
to{ "message": { "key1": { "k1": "v1", "k2": "v2" }, "key2": ["v3", "v4"] } }
. However, I'd like the the data sent to CrateDB to be{ "key1.k1": "v1", "key1.k2": "v2", "key2[0]": "v3", "key2[1]": "v4" }{ "key1": { "k1": "v1", "k2": "v2" }, "key2": ["v3", "v4"] } - I'm not sure how to hook into and evaluate the response that comes back when sending requests using
HttpService. CrateDB provides error codes for bulk inserts that I'd like to use for logging warnings/info messages in Vector.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the initial working version linked in the issue, then compare it with Vector's existing HttpService and json_parser. Check CrateDB's HTTP bulk-operations and bulk-errors documentation to define the expected request and response handling. Done means an accepted CrateDB sink that preserves nested arrays and objects and reports relevant bulk-insert errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sql
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100