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 custom query settings support #122

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

lio-p
Copy link
Contributor

@lio-p lio-p commented Jan 10, 2025

This PR adds support to add custom query settings using environment variable.

Related: #119

Example:

QUERY_CUSTOM_SETTINGS={"getPackageRanking": {"allow_experimental_parallel_reading_from_replicas": 1, "max_threads": 30}}

Add automatically to the query getPackageRanking the query level settings allow_experimental_parallel_reading_from_replicas and max_threads

Copy link

vercel bot commented Jan 10, 2025

@lio-p is attempting to deploy a commit to the ClickHouse Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Jan 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clickpy ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 4:45pm

@@ -724,6 +730,7 @@ export async function getPackageRanking(package_name, min_date, max_date, countr
const columns = ['project', 'date']
if (country_code) { columns.push('country_code') }
const table = findOptimalTable(columns)

return query('getPackageRanking',`WITH
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but query needto actually consume and send in the query...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The custom settings are passed directly to the clickhouse.query function. See line 761 in clickhouse.js

Copy link
Collaborator

@gingerwizard gingerwizard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surely query needs to actually use?

@gingerwizard
Copy link
Collaborator

i.e. query method needs to consume and send param as settings

@gingerwizard gingerwizard merged commit 7bc14a9 into ClickHouse:main Jan 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants