Skip to content

Revert "Add aggregate function gini" - #113868

Merged
Manerone merged 4 commits into
ClickHouse:masterfrom
groeneai:revert-gini-combinator-propagation
Aug 13, 2026
Merged

Manerone merged 4 commits into
ClickHouse:masterfrom
groeneai:revert-gini-combinator-propagation

Conversation

@groeneai

@groeneai groeneai commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

Reverts #112280

Closes: #113763

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

Besides adding gini, #112280 added nine getArgumentsThatCanBeOnlyNull overrides across eight combinator files and made -If union the nested set, so those combinators forward that set from the function they wrap.

The Null combinator uses that set to decide whether an argument that can only be NULL folds the aggregate into AggregateFunctionNothing. Forwarding it removes the fold one level up, so expressions chaining one of them on top of -If changed type and value. Measured on debug builds of this branch and its parent:

expression before #112280 after
countIfOrNull(number, NULL) UInt64 0 Nullable(UInt64) NULL
sumIfResample(0, 2, 1)(number, NULL, number % 2) Nullable(Nothing) NULL Array(UInt64) [0, 0]
sumIfState(number, NULL) folded Nullable(Nothing) AggregateFunction(sumIf, UInt64, Nullable(Nothing))

Two of the new overrides sit outside the -If family, reaching expressions with no -If at all.

A partial revert is not available: gini declares argument 0 in getArgumentsThatCanBeOnlyNull itself, and one forwarding path carries both that declaration and the -If filter index, so keeping gini without the propagation contradicts its own test.

gini is unreleased (the merge is not an ancestor of 26.7, 26.6, 26.5, 26.3 or 25.8, and never reached CHANGELOG.md), so this withdraws no released behaviour. A behaviour-neutral re-land following the sum family, as @Manerone specified, comes separately.

The docs page is removed here too. It did not come from the reverted merge: 2d4afadac21e7b4 moved it into the live Mintlify tree, so it arrived via the master merge. Its navigation entry, legacy redirect and slug-map row go with it, or those would point at a missing target. Regenerating is not an option: the aggregate family in autogenerate_docs.py lists that page directory and carries skip_if_empty, so an unregistered function's page is never revisited.

Verified by byte identity rather than a new test: of the 14 source and test paths the merge touched, 13 match their pre-merge blobs, and registerAggregateFunctions.cpp differs only by unrelated MergedJSONPatch lines master added in e3698631b023165.

cc @Manerone

Version info

  • Merged into: 26.8.1.1317 (included in 26.8 and later)

This reverts merge f75ec00 (ClickHouse#112280) in
full, restoring all 15 files to their pre-merge content.

Besides adding `gini`, that pull request added nine
`getArgumentsThatCanBeOnlyNull` overrides across eight combinator files
and changed `-If`'s existing one to union the nested set, so a combinator
now forwards that set from the function it wraps. The `Null` combinator
uses the set to decide whether an argument that can only be NULL folds
the whole aggregate into `AggregateFunctionNothing`, so forwarding it
removed the fold one level up and changed the result type and value of
pre-existing expressions that chain one of those combinators on top of
`-If`. A combinator that gained no override keeps the empty set that
`IAggregateFunction::getArgumentsThatCanBeOnlyNull` returns by default,
so it contributes nothing of its own: `-Merge`, `-Array`, `-ForEach`,
`-Tuple` and `-Map` gained none, and
`sumIfForEach([number, number], [NULL, NULL])` still returns
`Array(UInt64)` `[0, 0]`.

Measured on debug builds of this branch and of its parent commit, which
contains the merge: `countIfOrNull(number, NULL)` moved from `UInt64` `0`
to `Nullable(UInt64)` `NULL`, `sumIfResample(0, 2, 1)(number, NULL,
number % 2)` from a scalar `Nullable(Nothing)` to `Array(UInt64)`
`[0, 0]`, and `sumIfState(number, NULL)` from a folded `Nothing` to a
real `AggregateFunction(sumIf, UInt64, Nullable(Nothing))` state. Those
two trees are equivalent to the merge and to its first parent on this
surface, by measurement rather than by assumption: for all 15 files the
merge touched, the blobs at the parent commit equal the blobs at the
merge, and the blobs at this branch's head equal the blobs at
f75ec00^1; no file under `src/AggregateFunctions/Combinators/`
differs between f75ec00^1 and this head; and of the 46 commits
between the merge and this branch's parent, the three that touch
`src/AggregateFunctions/` all belong to the unrelated PromQL `deriv`
scaling pull request 112360.

Four of the new overrides also insert their own column index, and the
two outside the `-If` family reach expressions with no `-If` at all,
such as `sumArgMin(1, NULL)`.

A partial revert is not available. `gini` declares argument 0 in
`getArgumentsThatCanBeOnlyNull` itself, and the same forwarding path
carries both that declaration and the `-If` filter index, so removing the
propagation while keeping `gini` would silently change `gini`'s own
combinator results and contradict assertions in its committed test.

`gini` is unreleased: the merge is not an ancestor of 26.7, 26.6, 26.5,
26.3 or 25.8, and it never reached `CHANGELOG.md`, so the revert returns
26.8-dev to its pre-merge state without withdrawing released behaviour.
A behaviour-neutral re-land of `gini` follows in a separate pull request.

Verified by byte identity rather than by a new test: all 15 files hash
equal to their `f75ec003a3ee^1` blobs, which is the whole correctness
criterion for a revert.

Closes: ClickHouse#113763
@groeneai

groeneai commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: 2 rounds, 3 findings, all fixed before publication

An independent reviewer read the resulting tree cold, without the author's
evidence, and a second model re-reviewed the whole change against the intended
PR contract. Every finding below was resolved before this PR was opened.

Round 0 cleared the code and bounced the commit message for two
misattributed measurements (a provenance clause naming builds that were never
made, and a subset count stated as a whole set). Both are corrected in the
message you see.

Round 1 found the code and the message clean and corrected three claims in
the PR description and in the checklist comment.

Finding Verdict Resolution
❌ The description said combinators that gained no override, "such as -Merge", are unaffected. False for the natural reading of that sentence. Agreed -Merge consumes a -State, and -State did gain an override, so a -Merge chain changes transitively: sumIfMerge(sumIfState(number, NULL)) gives Code: 43 ILLEGAL_TYPE_OF_ARGUMENT on this branch against UInt64 0 on the merge-containing arm. The description now states the property that is true, that such a combinator contributes nothing of its own, with a measured witness (sumIfForEach([number, number], [NULL, NULL]) reads Array(UInt64) [0, 0] on both arms) and the transitive case named explicitly.
❌ Row (b) of the checklist comment carried the same reassurance in a stronger form, "-Merge, -Array, -ForEach, -Tuple and -Map chains still fold". Agreed Same refutation, plus "still fold" is the wrong predicate for the control too: the -ForEach shape does not fold on either arm, it simply does not change. Rewritten. The underlying partition is correct and was re-derived: of the twelve registered combinators, seven gained an override and five did not.
⚠️ The description wrote the pre-merge value of sumIfState(number, NULL) as a folded Nothing while the adjacent row gave its type explicitly. Agreed Measured type is Nullable(Nothing); the row now says so, matching what toTypeName() returns.

Independently re-derived this round, with a negative or positive control on each
so that a clean result is distinguishable from a broken probe:

  • Revert correctness. git diff f75ec003a3ee^1 HEAD over the 15 paths the merge
    touched is empty, and the same command against the merge itself is not (679
    lines). Eleven paths are restored in place and hash equal to their pre-merge
    blobs; the other four were added by the merge and are deleted again, so no
    path exists at either end. The file set is exactly the merge's set, in both directions. No file
    under src/AggregateFunctions/Combinators/ differs from f75ec003a3ee^1,
    against a control of 10 differing at the merge.
  • Nothing dangles. AggregateFunctionGini, registerAggregateFunctionGini and
    the docs slug match zero files on this branch, against 2, 2 and 1 at the
    merge, and on master they live only in the three files this revert touches.
    A loose gini grep is not usable here: it returns hundreds of pre-existing
    arrayNormalizedGini hits.
  • Override census. Nine new override declarations across eight combinator files,
    with -If's pre-existing one converted to a union; four of the nine insert
    their own column index, and the first grep a reader runs returns five because
    it also counts that converted line.
  • Pre-existing coverage is safe. The three stateless tests using an -If
    chain under -OrNull are byte-identical to their pre-merge form, untouched by
    the merge, and all use a constant 0/1 or a non-constant predicate as the
    filter, so none reaches the onlyNull() fold that changed.
  • Unreleased. The merge is diverged against 26.7, 26.6, 26.5, 26.3 and 25.8,
    against a control commit reading behind_by: 0, and gini appears zero times
    in CHANGELOG.md.
  • Freshness at publication time. All 15 files are byte-identical between this
    branch's base and current master, compared per path, with a control file
    correctly reading as changed. The gini merge is still an ancestor of
    master, so nobody has reverted it, and no open pull request matches gini
    or 112280.

The second model's final pass returned no findings, having read every changed
file in full, the deleted sources, tests and docs, the factory caller, the
registration plumbing, the existing NULL tests and the sibling combinators.
No new test accompanies this change, deliberately: for a revert, byte identity
with the pre-merge tree is a stronger criterion than any behavioural assertion
written here, and it is verified above.

@groeneai

groeneai commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation (a-i)
# Check Answer
a Deterministic repro? Yes, and it is not a flake: the defect is a deterministic type/value change, reproduced on 7 of 7 witness expressions. The two arms are a debug build of this branch's parent commit 31081d9f050140 (Build ID 0502ee8df849bfcb439c04b60c0879b53245a021), which contains the merge, against a debug build of this branch (532bc81a548ba6d81db0cd9c0e4b21f0140c4522). Neither commit is f75ec003a3ee itself, and the arms are equivalent to it on this surface by measurement, not by assumption: for all 15 files the merge touched, the blob hashes at 31081d9f050140 equal those at the merge (15 of 15) and the blob hashes at this branch equal those at f75ec003a3ee^1 (15 of 15), git diff f75ec003a3ee^1 HEAD -- src/AggregateFunctions/Combinators/ is empty, and only 3 commits touched src/AggregateFunctions/ in the 46 between the merge and that parent, all from the unrelated PromQL deriv() scaling change. One clickhouse local invocation per statement with a fresh --path, since a multi-statement -q aborts at the first error.
b Root cause explained? AggregateFunctionFactory::get applies the Null combinator when any argument is Nullable. AggregateFunctionCombinatorNull::transformAggregateFunction reads nested_function->getArgumentsThatCanBeOnlyNull() and folds the whole aggregate into AggregateFunctionNothing for any argument where arguments[i]->onlyNull() and the index is not in that set. Pre-merge exactly one override existed (AggregateFunctionIf.h, a flat {num_arguments - 1}), so a second combinator wrapping -If hit the base {}, the filter index was lost one level up, and the fold fired. #112280 added nine overrides across eight combinator files and made -If's union the nested set, so the index now survives the chain and the fold no longer happens. Four of the nine also insert their own column index (git diff f75ec003a3ee^1 f75ec003a3ee -- src/ | grep -cE '^\+.*arguments\.insert\(' is 5, counting the converted -If line), and the two of those outside the -If family reach expressions with no -If at all. Five of the twelve registered combinators gained no override (-Merge, -Array, -ForEach, -Tuple, -Map), so each contributes nothing of its own: sumIfForEach([number, number], [NULL, NULL]) reads Array(UInt64) [0, 0] on both arms. That is not the same as saying chains through them are unchanged, and the distinction is measured rather than assumed: -Merge consumes a -State, which did gain an override, so sumIfMerge(sumIfState(number, NULL)) differs between the arms (Code: 43 ILLEGAL_TYPE_OF_ARGUMENT on this branch, where the inner state folds, against UInt64 0 on the merge-containing arm).
c Fix matches root cause? This is a full revert of the merge, which is what removes the propagation at its source. No guard, no widened bound, no masking.
d Test intent preserved / new tests? No new test, deliberately: a revert's correctness criterion is byte identity with the pre-merge tree, which is strictly stronger than any behavioural test written here. The only test the revert touches is 04651_gini_aggregate, deleted because it asserts gini, which this change removes. No other test asserts either the old or the new behaviour for the regressed shape: a search for a literal NULL as an -If filter under a second combinator across all stateless .sql returns one hit, 02715_or_null.sql:23, whose filter is a non-constant predicate. Pinning that gap is PR 2's job.
e Demonstrated in both directions? Yes. 7 of 7 witnesses differ between the two binaries described in row (a), and 6 of 6 controls are identical, so the probe discriminates rather than flagging everything. Witnesses (this branch, then the merge-containing arm): countIfOrNull(number, NULL) UInt64 0 / Nullable(UInt64) NULL; uniqIfOrNull same pair; sumIfState(number, NULL) folded Nullable(Nothing) / AggregateFunction(sumIf, UInt64, Nullable(Nothing)); sumIfResample(0, 2, 1)(number, NULL, number % 2) Nullable(Nothing) / Array(UInt64) [0, 0]; sumArgMin(1, NULL) and sumIfArgMin(number, NULL, number) folded / Nullable(UInt64) NULL; gini(NULL) Code: 46 UNKNOWN_FUNCTION / Float64 nan. Controls identical on both: countIf(number, NULL), sumIf(number, NULL), countIfOrNull(number, CAST(number > 2 AS Nullable(UInt8))), sumOrNull(NULL), sumState(NULL), count(number). Each arm asserted SELECT lower(buildId()) equal to its own binary's NT_GNU_BUILD_ID before any row was read.
f General across code paths? The whole merge is reverted, so every path it touched returns to its pre-merge form. Verified by census rather than assertion: getArgumentsThatCanBeOnlyNull occurs on 3 lines in src/ before the merge, 23 after, and 3 again on this branch, in the same three files. already_transformed, added by the merge, has no consumer outside the reverted file and is now absent. git grep for AggregateFunctionGini/registerAggregateFunctionGini in src/ returns nothing, so deleting the file leaves no dangling referrer, and no CMake list names it (the directory is glob-based).
g Generalizes across inputs? Not applicable in the usual sense, since nothing is being fixed by new logic. The equivalent obligation, that the restored content is exactly the pre-merge content for every input, is discharged by byte identity: git diff f75ec003a3ee^1 HEAD restricted to the 15 paths the merge touched is empty, with the same command against the merge commit non-empty as a negative control. Eleven paths are restored in place and hash equal to their pre-merge blobs; the remaining four were added by the merge and are deleted again, so no path exists at either end (an absent path has no blob at all, not the empty-file hash).
h Backward compatible? Nothing engaged. No setting or default changes: check_settings_changes_history returns '' for this file list, with two controls reddening (adding SettingsChangesHistory.cpp, and the fail-close path). No serialization-version change either: the pre-merge -State shapes are what 26.7 already writes, and the merge's own -State shapes never shipped. gini is unreleased, so the removal withdraws nothing users can have: the merge is not an ancestor of 26.7, 26.6, 26.5, 26.3 or 25.8, and gini never reached CHANGELOG.md.
i Invariants and contracts preserved? The invariant this change establishes is byte identity with f75ec003a3ee^1, verified over all 15 paths as an empty diff (11 blob-equal in place, 4 absent at both ends). Behavioural evidence that nothing else depended on the propagation: the 18 stateless tests exercising these combinators give identical verdicts on both binaries (18 OK on each, 0 only-in-revert failures, 0 reason-bucket changes), and 88 aggregate-function gtests pass. UniqueKeyProbeTest is excluded as a pre-existing trunk abort, reproduced with the same message on three unrelated worktrees' binaries and absent from this diff. Test numbering stays valid: check_gaps_in_tests_numbers returns [] on the post-revert file list, with an injected 99999_probe.sql reporting Gap (4811, 99999) > 100 so the clean verdict is not a broken probe; eight other 04651_ stems remain.

Drift was measured against origin/master twice during this work, at fa125eaf379ad55b and again at 8a14c7c2a17202c3 (roughly 160 and 200 commits after the merge; that count moves with every push, so the predicate matters and the digit does not). Both times: git rev-list --count f75ec003a3ee..origin/master -- <file> is 0 for all 15 files, and git show f75ec003a3ee:<f> hashes equal git show origin/master:<f> for 15 of 15, so the revert lands on pre-merge content with no three-way resolution. Reverse-apply of the merge's first-parent diff reports rc=0 at both heads, and nobody has reverted it upstream (git log --grep=gini -i over the window is empty, and registerAggregateFunctions.cpp still matches gini twice on master).

@clickhouse-gh

clickhouse-gh Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [25c2e67]

Summary: ✅


AI Review

Summary

This PR cleanly reverts the unreleased gini aggregate function and the getArgumentsThatCanBeOnlyNull propagation that came with it, including the published Mintlify docs surface (navigation, redirect, and slug-map entries). I rechecked the current diff, all prior discussion, and the current tree for leftover registrations, docs, or propagation overrides, and I did not find any remaining correctness or user-facing issues.

Final Verdict

✅ No review findings in the current head.

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.70% 86.70% +0.00%
Functions 92.00% 92.00% +0.00%
Branches 79.00% 79.00% +0.00%

Changed lines: Changed C/C++ lines covered: 24/26 (92.31%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Aug 7, 2026
@groeneai

groeneai commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

Docs check (Mintlify) needs the pr-autogenerated-docs label on this PR

No direct edits to generated or read-only docs fails on one path, and I cannot clear it from inside the PR. The check_readonly_copies half passes; only the generated-region half fails.

Root cause. The revert deletes docs/en/sql-reference/aggregate-functions/reference/gini.md (status D, 0 10 in git diff --numstat, so a pure deletion and never an edit). That file's body is an empty marker pair. _read_file returns b"" for a deleted path (check_autogenerated_regions.py:88-90), so find_violations compares [b'\n'] against [] and reports a violation. Running the shipped checker locally reproduces it, and I confirmed the guard is over-broad only for this shape:

arm result
delete a docs file with an empty marker pair FAIL
delete a docs file with a non-empty marker pair FAIL
delete a docs file with no markers (control) PASS
edit inside a region, a real violation (control) FAIL
edit outside a region (control) PASS

Why keeping the file is not an option. docs/en/ is retired. PR 112141 deleted all 919 files from it, 365 of them carrying a marker pair, and docs/en/ held 0 files immediately before gini merged. 112280 then re-added this single file into the emptied tree. It is also unpublished: docs/_migration/slug-map.csv has 0 rows for docs/en/ and 0 for gini, against 159 rows for aggregate-functions/reference, and 112280 added no slug entry. The generator cannot own it either, since autogenerate_docs.py never references docs/en and drives aggregate pages from docs/reference/functions/aggregate-functions/. Keeping it would leave a doc page for a function that no longer exists, in a tree that was deliberately emptied.

The ask. PR 112141 is the precedent for exactly this operation at 365 times the scale, and it carries pr-autogenerated-docs, applied before merge by the guard's own author. I verified against the real guard body that the label makes this check pass while the read-only-copies half still runs:

labels guard result generated-region half
none (current) fail runs
pr-autogenerated-docs pass skipped
an unrelated label (control) fail runs

I do not have triage permission, so I cannot apply it. Could you add pr-autogenerated-docs here?

The alternative is to teach find_violations that a pure deletion is not an edit inside a region. That is a change to shared CI tooling with its own test, so it belongs in its own PR rather than in a revert, and it is not needed to land this one. I am happy to open it if you would prefer that route.

cc @Manerone

@Manerone Manerone self-assigned this Aug 10, 2026
@Manerone

Copy link
Copy Markdown
Contributor

@Blargian this is the revert I mentioned here. From what I understood the CI now fails due to changing auto generated docs. Solution would be to tag this with pr-autogenerated-docs, is it fine if I do it here?

@groeneai

Copy link
Copy Markdown
Collaborator Author

Yes please, that is exactly the right unblock. One precision on the cause: it is a pure deletion rather than an edit - the revert removes docs/en/sql-reference/aggregate-functions/reference/gini.md (status D, 0 10 in git diff --numstat), and find_violations cannot tell a deleted generated file from an edited one. PR 112141 is the precedent and carries the same label for deleting all 919 files of that retired tree; the full measurement is in my comment above.

cc @Manerone

@Manerone Manerone added the pr-autogenerated-docs PR that regenerates docs artifacts from source; exempt from the autogenerated-region edit guard label Aug 11, 2026
The revert removed the implementation and the stateless test, but the
documentation page reached `master` through a separate migration commit
(`2d4afadac21e7b4`, "Docs: move `gini` page to Mintlify") and so arrived on
this branch via the master merge rather than through the reverted merge
itself. Left in place, `master` would keep publishing a reference page that
advertises `gini` as an aggregate function introduced in v26.8.0 while no such
function is registered.

The page is in the live Mintlify tree, not the retired `docs/en/` tree that an
earlier pass over this branch measured, so it is genuinely published: it is
reachable from `docs/reference/navigation.json`, its legacy Docusaurus URL is
served by an entry in `docs/_site/redirects.json` (added by
`56cabc939444e43`), and `docs/_migration/slug-map.csv` maps the old slug onto
it. All four artifacts go together; removing only the page would leave a
navigation entry and a redirect pointing at a missing target.

Regenerating instead of deleting is not an option here. The aggregate family in
`autogenerate_docs.py` discovers its work by listing the page directory and
carries `skip_if_empty`, so once the function is unregistered the generator
neither refreshes nor removes the page; it would dangle indefinitely.

v26.8.0 is unreleased, so no published release advertises the function.
@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Aug 12, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 25c2e6719 with master 90967e9ed (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of e1d2ef130; compile times per translation unit against the most recent warmup build that recompiled it).

⚠️ Significant changes: object file sizes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 691.97 MiB 688.36 MiB -3.61 MiB (-0.52%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Object file sizes ⚠️

124 object files changed (-264.92 KiB total), 0 added.

Object file Master PR Δ
src/Functions/array/CMakeFiles/clickhouse_functions_array.dir/arrayElement.cpp.o 7.77 MiB 7.28 MiB -508.22 KiB (-6.39%)
src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDocumentation.cpp.o 303.13 KiB 369.68 KiB +66.55 KiB (+21.95%)
src/CMakeFiles/dbms.dir/Processors/Formats/Impl/AvroRowInputFormat.cpp.o 818.34 KiB 852.87 KiB +34.52 KiB (+4.22%)
src/CMakeFiles/dbms.dir/Storages/MergeTree/ConditionTemplate.cpp.o 147.29 KiB 172.69 KiB +25.40 KiB (+17.25%)
src/CMakeFiles/dbms.dir/Functions/FunctionsConversion_impl19.cpp.o 524.35 KiB 548.98 KiB +24.62 KiB (+4.70%)
src/CMakeFiles/dbms.dir/Functions/FunctionsConversion.cpp.o 20.57 MiB 20.59 MiB +24.05 KiB (+0.11%)
src/CMakeFiles/dbms.dir/Functions/FunctionsConversion_impl17.cpp.o 782.17 KiB 804.68 KiB +22.51 KiB (+2.88%)

738 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

21 translation units recompiled, 126 s compile time in total, 21 of them have a recent master baseline.

Job report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 25c2e67

CI is fully finished on this head with real coverage: 176 check-runs, 0 queued or in progress,
Config Workflow and Finish Workflow both success, and the praktika report shows 174 leaves with
0 dropped jobs.

Check / test Reason Owner / fixing PR
(none) 153 success, 23 skipped, 0 failures nothing to own
Sync - CH Inc sync (private, not actionable)

Docs check (Mintlify) ran on this head (it was skipped as unaffected on the previous one) and
passed, which is the check the pr-autogenerated-docs label was added for. The 23 skips each carry a
reason (performance comparison not labelled, bugfix validation, flaky checks with no changed tests,
toolchain and docker manifest builds), so none of them masks a dropped job.

Session id: cron:our-pr-ci-monitor:20260812-213000

@Manerone
Manerone added this pull request to the merge queue Aug 13, 2026
Merged via the queue into ClickHouse:master with commit 4c1b75d Aug 13, 2026
181 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 13, 2026
@groeneai groeneai added the groeneai-origin-request PR origin: a maintainer pinged or directed groeneai label Aug 19, 2026
pull Bot pushed a commit to Mu-L/ClickHouse that referenced this pull request Aug 21, 2026
Re-lands the gini aggregate function that was reverted in ClickHouse#113868, with the
three changes @Manerone specified in issue ClickHouse#113763: no
getArgumentsThatCanBeOnlyNull override, no returns_default_when_only_null
property, and no argument_type->onlyNull() branch in the creator.

The property was what made the factory build a real gini instance over
Nullable(Nothing) instead of letting AggregateFunctionFactory::getImpl return
nullptr, so gini(NULL) produced Float64 nan where every sum-family function
folds to Nullable(Nothing). Without the property the fold happens in the Null
combinator before any other combinator is applied, and the creator's only-null
branch becomes unreachable, which is why createAggregateFunctionSum has no
equivalent.

Runtime Nullable handling is a separate axis via getOwnNullAdapter and is
unchanged: gini over [1, NULL, 3] still returns 0.25.

The docs artifacts restore what ClickHouse#113868's wholesale revert removed from
@Blargian's merged Mintlify port (ClickHouse#114314): the gini.mdx page plus its
slug-map, navigation and redirect entries, taken verbatim from that commit.

Reported-by: Manerone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai manual approve Manual approve required to run CI pr-autogenerated-docs PR that regenerates docs artifacts from source; exempt from the autogenerated-region edit guard pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

4 participants