24.8.14 Backport of #84770: Handle NULLs in ALTER MODIFY COLUMN#1370
24.8.14 Backport of #84770: Handle NULLs in ALTER MODIFY COLUMN#1370zvonand merged 2 commits intocustomizations/24.8.14from
Conversation
…umn_null_to_default Handle NULLs in ALTER MODIFY COLUMN
|
This is an automated comment for commit c8d0661 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
|
Code from upstream was merged clearly. The PR contains a test that passes. |
PR #1370 Audit ReviewAI audit note: This review was generated by AI (gpt-5.3-codex). Audit update for PR #1370 (24.8.14 Backport of ClickHouse#84770: Handle NULLs in ALTER MODIFY COLUMN) Confirmed defectsMedium: Shared default-expression AST is reused without cloning in conversion pipeline
/// Converting a column from nullable to non-nullable may cause 'Cannot convert column' error when NULL values exist.
/// Users should specify DEFAULT expression in ALTER MODIFY COLUMN statement to replace NULL values.
if (isNullableOrLowCardinalityNullable(column_in_block.type) && !isNullableOrLowCardinalityNullable(required_column.type))
{
ASTPtr default_value;
if (auto it = column_defaults.find(required_column.name); it != column_defaults.end())
default_value = it->second.expression;
...
auto convert_func = makeASTFunction("_CAST",
makeASTFunction("ifNull", std::make_shared<ASTIdentifier>(required_column.name), default_value),
std::make_shared<ASTLiteral>(required_column.type->getName())); if (column_default)
{
/// expressions must be cloned to prevent modification by the ExpressionAnalyzer
auto column_default_expr = column_default->expression->clone();Coverage summary
|
PR #1370 CI TriageSummary
Verdict: PASS — No failures caused by this PR. The CI report explicitly confirms: New Fails in PR: 0, Regression New Fails: 0, Checks New Fails: 0 (compared with base sha Detailed AnalysisPre-existing Flaky Tests (Unrelated)
This is a known flaky test related to parallel quorum insert timing. It failed on the first run and passed on the rerun, confirming it is not related to this PR's changes. Infrastructure Issues (Unrelated)Sign aarch64 / Sign release — Persistent CI Infrastructure Failure
Integration Tests Timeout — Resolved on Rerun
Recommendations
|
@zvonand can you please check the audit review, if it makes sense to raise an issue for this? |
|
This is only a backport, almost 1:1 matches upstream's code In backports, we take the upstream PRs as is |
|
@zvonand can we at least just make sure there is nothing critical in the audit review? I can mark it as verified afterwards. |
|
I do not see anything critical. Again, this is only a backport, we take it as is. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
ALTER MODIFY COLUMN now requires explicit DEFAULT when converting nullable columns to non-nullable types. Previously such ALTERs could get stuck with cannot convert null to not null errors, now NULLs are replaced with column's default expression. (ClickHouse#84770 by @vdimir)
CI/CD Options
Exclude tests:
Regression jobs to run: