Skip to content

Conversation

@sylph-eu
Copy link
Contributor

@sylph-eu sylph-eu commented May 7, 2024

Description

Partially addresses #7100.

This PR enables a pushdown of the following aggregation functions: COUNT(DISTINCT) (except varchars), COVARIANCE, and CORRELATION.

Implementation of the rest of the functions have certain nuances that require additional efforts:

  • Decimal implementation truncates digits outside of the scale, while Trino rounds them up.
  • Statistical functions return NaN values on empty sets, while Trino expects NULL.

I'll have a look whether limitations above can be workarounded to improve pushdown "coverage".

Additional context and related issues

Continuous work on #7100.

Release notes

(x) Release notes are required, with the following suggested text:

# ClickHouse
* Add support for pushing down execution of the `count(distinct)`, `corr`, `covar_samp`, `covar_pop` functions to the underlying database. ({issue}`7100`)

@cla-bot cla-bot bot added the cla-signed label May 7, 2024
@github-actions github-actions bot added the docs label May 7, 2024
@sylph-eu sylph-eu changed the title Clickhouse connector 5 Enable pushdown of a few aggregation functions for ClickHouse Connector May 7, 2024
@sylph-eu sylph-eu force-pushed the clickhouse_connector_5 branch from 93cd8fa to 46d51e9 Compare May 21, 2024 12:16
@sylph-eu sylph-eu requested a review from ebyhr May 22, 2024 06:18
@ebyhr ebyhr merged commit 1ed2eb7 into trinodb:master May 28, 2024
@github-actions github-actions bot added this to the 449 milestone May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants