PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.
This PR adds a settings method to ClickHouseQueryBuilder to add these options to a SELECT query.
All current (Clickhouse 24.4) settings keys are snake-case. Therefore I opted to use the settings keys directly as kwargs to the settings method, allowing passing multiple settings pairs in one call in a Pythonic/ideomatic way.
Summary
Clickhouse SQL has an optional
SETTINGS
clause withSELECT
s which can be used to configure all kinds of options.This PR adds a
settings
method toClickHouseQueryBuilder
to add these options to aSELECT
query.All current (Clickhouse 24.4) settings keys are snake-case. Therefore I opted to use the settings keys directly as kwargs to the
settings
method, allowing passing multiple settings pairs in one call in a Pythonic/ideomatic way.Test Plan
Added a unit test to exercise the new function.