Skip to content

Cherry pick #97213 to 26.1: Fix FunctionVariantAdaptor exception when nested function returns Nothing type#97259

Merged
robot-clickhouse merged 4 commits intobackport/26.1/97213from
cherrypick/26.1/97213
Feb 18, 2026
Merged

Cherry pick #97213 to 26.1: Fix FunctionVariantAdaptor exception when nested function returns Nothing type#97259
robot-clickhouse merged 4 commits intobackport/26.1/97213from
cherrypick/26.1/97213

Conversation

@robot-clickhouse
Copy link
Copy Markdown
Member

Original pull-request #97213

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

alexey-milovidov and others added 4 commits February 17, 2026 17:08
…hing type

When `FunctionVariantAdaptor` executes a function on a Variant column
that contains a single variant (e.g., `Array(Nothing)` from an empty
array literal `[]`), the nested function can return a result of type
`Nothing`. The code only checked for `Nullable(Nothing)` via `onlyNull`
but missed plain `Nothing`, causing a failed cast to the expected
`Variant(...)` result type and a `LOGICAL_ERROR` exception.

Add `isNothing` checks alongside existing `onlyNull` checks in all
three execution paths (single variant no NULLs, single variant with
NULLs, multiple variants) to treat `Nothing` results as defaults/NULLs.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=42be5daa2cfd617b45ee36eeec6d72fd405fba41&name_0=MasterCI&name_1=AST%20fuzzer%20%28amd_debug%29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ot support Variant type inference in UNION ALL

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…-type

Fix FunctionVariantAdaptor exception when nested function returns Nothing type
@robot-clickhouse robot-clickhouse added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-critical-bugfix labels Feb 18, 2026
@robot-clickhouse robot-clickhouse merged commit f025da2 into backport/26.1/97213 Feb 18, 2026
133 of 149 checks passed
@robot-clickhouse robot-clickhouse deleted the cherrypick/26.1/97213 branch February 18, 2026 08:26
@clickhouse-gh clickhouse-gh bot added the ready-for-backport PR is eligible for backporting (merged 7+ days ago, not reverted) label Mar 27, 2026
@maxknv maxknv removed the ready-for-backport PR is eligible for backporting (merged 7+ days ago, not reverted) label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants