Repository navigation
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
f9928b1 to
d9dc16f
Compare
Local pipeline review — ✅ PASSschema: doris-repo-review/v1
status: PASS
pr: apache/doris#70362
commit: d9dc16fea95eb5a8fd51e9587ae78e87792f4c4a
base: 66122209cac78805a96a42f44d2a4a20b428f038
reviewed_at: 2026-11-07T13:33+08:00
reviewer: eldenmoon
model: gpt-6-astra
effort: xhigh
findings: {blocker: 0, major: 0, minor: 0, nit: 0}
rounds: 1
converged: trueNotes for maintainers
Reviewed locally with the |
|
/run buildall |
FE UT Coverage ReportIncrement line coverage |
|
/run buildall |
FE UT Coverage ReportIncrement line coverage |
|
run cloud_p0 |
|
run external |
|
run cloud_p0 |
|
run external |
|
run feut |
|
run nonConcurrent |
|
run cloud_p0 |
|
run external |
|
run feut |
|
run nonConcurrent |
|
run p0 |
|
run cloud_p0 |
|
run external |
|
run feut |
|
run nonConcurrent |
|
run p0 |
### What problem does this PR solve? Related PR: apache#70359 Problem Summary: heavy schema change builds CastExpr directly without the nullable metadata normally supplied by Nereids. Changing a NOT NULL DATETIMEV2 column's scale therefore sends a non-nullable CAST to BE even though the existing converter returns a nullable column, and the alter task is cancelled with a declared/actual result type mismatch. At the schema-change construction site, reuse Cast.castNullable with the already resolved source/target types and source slot nullability, and set the existing nullableFromNereids metadata before task serialization. Keep legacy CastExpr fallback, runtime filters, BE conversion and storage unchanged. ### Release note Fix heavy schema change failures when modifying DATETIMEV2 scale. ### Check List (For Author) - Test: 56 FE unit tests passed; FE build/Checkstyle and unchanged BE ASAN build passed; expanded SQL golden generation passed with the scoped fix - Behavior changed: Yes. Schema change tasks declare the existing converter's nullable result correctly; conversion semantics are unchanged. - Does this need documentation: No
### What problem does this PR solve? Related PR: apache#70359 Problem Summary: check the CAST expression actually serialized by a heavy schema change task when DATETIMEV2 scale increases or decreases, including a nullable source column. Protect the legacy Variant-to-date fallback from unrelated changes. SQL regression checks existing rows, SQL NULL, the maximum datetime, and new microsecond writes after a scale change. ### Release note None ### Check List (For Author) - Test: 56 FE unit tests passed; FE build/Checkstyle and BE ASAN build passed; test_schema_change_cast_nullable and test_alter_table_column_nullable passed (2 suites); golden generated by run-regression-test.sh - Behavior changed: No - Does this need documentation: No
d9dc16f to
3631150
Compare
|
run buildall |
|
run external |
|
run p0 |
|
run external |
|
run nonConcurrent |
|
run external |
|
run nonConcurrent |
|
run p0 |
|
run compile |
|
run feut |
|
run external |
|
run nonConcurrent |
|
run external |
|
run nonConcurrent |
|
run external |
4 similar comments
|
run external |
|
run external |
|
run external |
|
run external |
|
run nonConcurrent |
What problem does this PR solve?
Related PR: #70359
Problem Summary: a heavy schema change that changes a NOT NULL DATETIMEV2 column's scale can be cancelled by BE with a result type mismatch, for example:
SchemaChangeJobV2 directly creates a legacy CastExpr without the nullable metadata normally supplied by Nereids translation. The legacy fallback does not recognize DATETIMEV2 scale conversion, while the existing BE converter returns a nullable physical column.
Fix
At the schema-change CAST construction site, compute nullability using the existing
Cast.castNullablefunction, the already resolved source/target types, and the source slot nullability. Store it through the existingsetNullableFromNereidsmetadata, which takes precedence when serializing the task expression.This changes one production file. It adds no per-type special case and leaves
CastExpr.isNullable, normal query translation, and runtime-filter construction unchanged. The skipped string-to-string and DECIMALV2-to-DECIMALV2 paths remain unchanged.Validation
build.sh --fepassed with zero Checkstyle violations. The unchanged BE was built with ASAN viabuild.sh --be.Compatibility and performance
BE CAST conversion semantics and storage formats are unchanged. No new Thrift fields, public APIs, or dependencies are introduced. The task declares the nullable result already returned by the converter; required-column constraints remain in effect.
The inference runs while constructing each changed-column expression, reusing types that are already resolved. There is no new per-row work. Other direct CastExpr entry points were inspected; their legacy fallback is preserved to avoid changing runtime-filter behavior. No performance benchmark is claimed.
Release note
Fix heavy schema change failures when modifying DATETIMEV2 scale.
Check List (For Author)