Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: ClickHouse query settings #22373

Open
typedarray opened this issue Feb 5, 2025 · 0 comments
Open

Feature request: ClickHouse query settings #22373

typedarray opened this issue Feb 5, 2025 · 0 comments
Labels
sink: clickhouse Anything `clickhouse` sink related type: feature A value-adding code addition that introduce new functionality.

Comments

@typedarray
Copy link

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

The ClickHouse sink currently exposes three query settings as explicit sink options:

  • input_format_skip_unknown_fields
  • date_time_input_format
  • insert_distributed_one_random_shard

This allowlist seems somewhat arbitrary. I'd like to configure other settings, like async_insert.

Attempted Solutions

No response

Proposal

Add a query_settings option in the sink configuration of type object containing a key/value map of query settings. These would just need to be appended to the URL as query params, just like the 3 that are currently supported. As far as I can tell, all clickhouse setting values are uint, float, or string, so they should work just fine in the various Vector config file formats.

sinks:
  my_clickhouse_sink:
    type: clickhouse
    inputs:
      - my_source
    endpoint: http://localhost:8123
    database: mydatabase
    table: mytable
    query_settings:
      input_format_skip_unknown_fields: 1
      date_time_input_format: best_effort
      async_insert: 1
      async_insert_busy_timeout_ms: 3_000

References

No response

Version

No response

@typedarray typedarray added the type: feature A value-adding code addition that introduce new functionality. label Feb 5, 2025
@pront pront added the sink: clickhouse Anything `clickhouse` sink related label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sink: clickhouse Anything `clickhouse` sink related type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

No branches or pull requests

2 participants