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

Add force_optimize_skip_unused_shards and optimize_skip_unused_shards to ClickHouseQueryParam #679

Closed
ruanwenjun opened this issue Jul 5, 2021 · 2 comments · Fixed by #736

Comments

@ruanwenjun
Copy link

see https://clickhouse.tech/docs/en/operations/settings/settings/#force-optimize-skip-unused-shards

@zhicwu
Copy link
Contributor

zhicwu commented Jul 5, 2021

In the new client/driver, you’ll be able to specify any setting as needed. But I think you can try any of below two approaches:

  1. Use multi-statement query like below:
set setting1=value1,setting2=value2;
select * from mytable;
  1. Add settings in your query
select *
from mytable
settings setting1=value1,setting2=value2

@zhicwu zhicwu added this to the 0.3.2 Release milestone Jul 5, 2021
@zhicwu zhicwu added the module-jdbc JDBC driver label Oct 6, 2021
@zhicwu zhicwu linked a pull request Oct 7, 2021 that will close this issue
@zhicwu
Copy link
Contributor

zhicwu commented Dec 29, 2021

With new option custom_http_params(comma separated) you should be able to customize settings as needed.

  • application scope
    use connection url like jdbc:ch://localhost/system?custom_http_params=force-optimize-skip-unused-shards%3D1 or set connection property custom_http_params to A=1,B=2.
  • request scope
    Statement s = conn.createStatement();
    ClickHouseRequest<?> req = s.unwrap(ClickHouseRequest.class);
    req.set("force-optimize-skip-unused-shards", 1);
    s.executeQuery("...");

@zhicwu zhicwu closed this as completed Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants