Skip to content

[fix](ivm) Use type zero values for missing hidden slots - #69268

Merged
yujun777 merged 2 commits into
apache:masterfrom
yujun777:fix/ivm-hidden-slot-date-default
Oct 21, 2026
Merged

yujun777 merged 2 commits into
apache:masterfrom
yujun777:fix/ivm-hidden-slot-date-default

Conversation

@yujun777

@yujun777 yujun777 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Related issue: #65418

Problem Summary:

An IVM base table can carry a DATETIME sequence column through function_column.sequence_col. The table's hidden __DORIS_SEQUENCE_COL__ is then a DATETIMEV2 slot. During an incremental refresh a join's snapshot side does not produce that column, and the rewrite must synthesize its type's zero value. The previous handling only covered numeric, string-like, and bitmap types, so planning failed with:

no default value for IVM hidden slot: __DORIS_SEQUENCE_COL__, type=DATETIMEV2(6)

This is independent of cloud mode: a base table with a DATETIME sequence column and a join in the MV query reproduces it on a shared-nothing cluster.

Fix: DataType now declares zeroValue(), which returns a non-SQL-NULL, deterministic expression without slot references when the type has a safe value to synthesize. Concrete types supply zero values such as 0, '', 0000-01-01 00:00:00, 0.0.0.0, JSON null, and empty bitmap/HLL values. Types without a safe value return Optional.empty(), causing IVM planning to fail loudly. IvmUtil.getCommonHiddenSlotDefault uses this API instead of branching on type categories.

Release note

Fix an IVM defect where a base table with a DATETIME sequence column could not be incrementally refreshed when the MV query contained a join.

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
  • Does this need documentation?

    • No.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@yujun777

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@yujun777

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all 46 changed paths at bf20210. Review converged in 2 rounds: both scope reviewers and the separate risk reviewer returned NO_NEW_VALUABLE_FINDINGS against the unchanged final inline set. One P2 defect is reported: the new public default-value API throws for valid DECIMALV2(p,p). No P0/P1 finding or existing blocking inline comment was identified. No additional user focus was supplied.

Critical checkpoint conclusions:

  • Goal: the DATE/DATETIME hidden-slot planning failure is addressed by exact-typed, non-null defaults; source sequence masking keeps these placeholders separate from MV ordering and row identity.
  • Scope and reuse: the broad type edits implement one coherent API using existing literal and empty-state function classes; the existing IVM dispatch is centralized.
  • Concurrency and locking: no shared mutation, thread, lock, blocking work or lock-order change is introduced.
  • Lifecycle and initialization: defaults are created on demand; no new resource ownership, release obligation or static initialization cycle was found.
  • Configuration: no configuration item or dynamic-update contract changes.
  • Compatibility: concrete type inheritance is covered; no persisted format, backend function symbol or rolling-upgrade wire contract changes.
  • Thrift/protobuf: no definitions or field IDs change.
  • Parallel paths: checked incremental delta remapping, pre/post snapshots, full-refresh and sink defaults, aggregate/plain MOW and append-only DUP behavior, and supported join alternatives. Unsupported mark/semi/anti joins remain rejected.
  • Conditions and failure handling: non-hidden-slot and ROW_LSN rejection remain intact; unavailable defaults still fail with slot/type context. The decimal API defect is described inline with its bounded impact.
  • Test coverage: new unit assertions directly cover DATEV2 and DATETIMEV2(6) defaults. The regression uses strict INCREMENTAL, requires task SUCCESS and disables transparent rewriting; it covers both join sides' updates and simultaneous new keys. It cannot pass by automatic full-refresh fallback. Negative cases and the wider type matrix are not exhaustively covered by the new tests.
  • Expected results: every new output row matches the SQL mutations, with ordered results. Generation provenance of the .out file was not independently verified.
  • Observability: existing IVM exception/task diagnostics remain appropriate; this expression-construction change introduces no operational state requiring new metrics.
  • Transactions, persistence and failover: no journal, stream-offset, version or commit/publish state changes; existing visibility and MoW transaction mechanisms remain in place.
  • Writes, atomicity and crashes: no new write protocol, partial-commit path or crash-cleanup resource is introduced.
  • FE/BE propagation: existing literal serialization retains concrete types/scales, including temporal values; no new transmitted variable is needed.
  • Performance: construction remains bounded per planned hidden slot, with no added data scan, per-row work or external IO.

Coverage limits: this was a static review; no build, unit test, regression run or cluster execution was performed. The regression places the sequence-bearing table on the logical left, so it reads that table's post snapshot and does not force the new temporal pre-snapshot placeholder end to end. A reversed logical join would strengthen that coverage; the helper is directly covered by the unit assertions. Other temporal scales/legacy types and outer-join/delete variants were traced statically. These are disclosed validation limits; no unresolved correctness candidate remains beyond the verified inline P2. The P2 concerns the newly documented type API; no current decimal-hidden-slot SQL refresh failure is claimed.

Review converged after 2 round(s).


@Override
public Optional<Expression> defaultValue() {
return Optional.of(new DecimalLiteral(this, BigDecimal.ZERO));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Scale decimal zero before validating the default literal

DecimalV2Type.createDecimalV2Type(9, 9).defaultValue() throws AnalysisException instead of returning zero. BigDecimal.ZERO has precision 1 and scale 0, and DecimalLiteral.checkPrecisionAndScale validates it before the constructor rescales it, so its integer width (1) exceeds precision - scale (0). This affects valid DECIMALV2(p,p) defaults requested through the new API; the former IntegerLiteral(0).castTo(type) scaled zero first. Construct zero at getScale() before passing it to DecimalLiteral, and cover the precision-equals-scale case. This is an API-contract defect; the current IVM hidden-slot path does not produce decimal columns.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: zero now carries the type scale before DecimalLiteral validates it (BigDecimal.ZERO.setScale(getScale())), and the same fix is applied to DecimalV3Type. IvmUtilTest now covers DECIMAL(9,9) for both V2 and V3.

Also reversed the regression join so the sequence-bearing table is the right child; a delta on the left dimension then makes it the pre-snapshot side, so the suite exercises the temporal placeholder end to end.

@yujun777
yujun777 force-pushed the fix/ivm-hidden-slot-date-default branch from bf20210 to f00f625 Compare October 19, 2026 08:26
@yujun777

Copy link
Copy Markdown
Contributor Author

/review

@yujun777

Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new actionable findings at f00f625a287be0bdf78795137fbb534f338152db. Reviewed all 46 changed paths, their production callers and literal translation. Two complete-scope reviewers and one independent risk reviewer returned NO_NEW_VALUABLE_FINDINGS; both initial risk questions were dismissed with evidence.

The concrete refresh path is Delta(dim) JOIN PreSnapshot(datetime-sequenced base). Snapshot remapping must construct the missing DATETIMEV2 hidden-slot default before the enclosing normalized projection masks the source sequence. The new typed literal satisfies that requirement without replacing the visible seq_dt, row identity or IVM's separately allocated BIGINT sequence. Both new regression MVs place the datetime base on the right to exercise this branch.

The existing decimal default finding is fixed: both decimal implementations scale zero before construction, and the unit test invokes V2/V3 DECIMAL(9,9) defaults. No existing P0/P1 finding remains to carry forward. No additional user focus was supplied.

Critical checkpoint conclusions:

  1. Goal and evidence: the temporal placeholder resolves the identified planning failure; DATEV2/DATETIMEV2 unit assertions and aggregate/plain regression scenarios target the changed behavior. Execution was not performed.
  2. Scope and abstraction: explicit per-type implementations centralize value construction; IvmUtil retains hidden-column policy. No unrelated source change identified.
  3. Concurrency and locking: no new threads, shared mutable state, metadata locks or lock-order changes.
  4. Lifecycle and initialization: no new owned resources or static initialization dependency; expressions are constructed on demand.
  5. Configuration: no production configuration added; regression settings disable transparent SELECT and DML rewrites.
  6. Compatibility: no persistent layout or protocol change; concrete type descendants implement or inherit the added Java method. Existing literal representations are reused.
  7. Thrift/protobuf IDs: no gensrc changes; cross-branch field-ID comparison is inapplicable.
  8. Parallel paths: incremental delta, pre/post snapshot, complete refresh, BindSink and append-only detail paths were traced; common defaults share this API.
  9. Conditions and failure behavior: unknown hidden slots, mandatory ROW_LSN mapping, special overrides and absent type defaults retain explicit failure semantics. The append-only ROW_LSN exception remains model-specific.
  10. Test coverage: JUnit 5 checks selected defaults and decimal precision-equals-scale; the integration suite covers dimension updates, greater source sequence updates and pending inserts on both sides. Explicit INCREMENTAL disallows silent fallback after the established baseline.
  11. Test results: all eight ordered output blocks agree with the SQL operations by static analysis. Runtime success and automatic-generation provenance were not independently verified.
  12. Observability: existing PLAN_REWRITE_FAILED errors retain slot/type context and task failure diagnostics; no additional instrumentation is needed for constant construction.
  13. Transactions, persistence and failover: no edit-log, stream-offset, baseline publication or transaction operation changed.
  14. Data writes and correctness: source placeholders remain outside business values, row identity and sink ordering; no change to visible-version or delete-bitmap handling was identified.
  15. FE-BE propagation: no new transmitted variable; existing literal-to-legacy and Thrift conversion paths preserve concrete type parameters.
  16. Performance: construction adds constant planning work and avoids the former numeric/string cast path; no added row-wise loop, scan or multiplicative plan expansion.
  17. Further recheck: reviewed parameterized lengths/scales, temporal minima, JSON versus SQL NULL, empty collection types, descendant completeness and source/sink sequence separation; no additional verified issue.

Review converged in round 1 with zero new inline findings and no unresolved static candidate or uncovered changed path. This was a static-only review: no builds, tests or source modifications. The tests sample the new default API and do not exhaust every type, temporal precision, NULL, deletion or lower-sequence case; runtime validation remains outside this invocation.

Review converged after 1 round(s).

…lots

An IVM base table can carry a DATETIME sequence column through
function_column.sequence_col, which makes its hidden __DORIS_SEQUENCE_COL__ a
DATETIMEV2 slot. The incremental rewrite asks for the hidden slot's default
value when a join's snapshot side does not produce the column, but the
default-value handling only covered numeric, string-like and bitmap types, so
planning failed with "no default value for IVM hidden slot:
__DORIS_SEQUENCE_COL__, type=DATETIMEV2(6)".

Key changes:
- Add an abstract DataType#defaultValue() and implement it in every concrete type with that type's non-null default value.
- Resolve common hidden slot defaults through DataType#defaultValue() in IvmUtil instead of branching on type categories.
- Add an IVM regression suite covering a DATETIME sequence column with aggregate and plain join materialized views.

Unit Test:
- IvmUtilTest#testCommonHiddenSlots
- IvmUtilTest#testDefaultValueForEveryType
- regression-test/suites/mtmv_p0/ivm/test_ivm_datetime_sequence.groovy
@yujun777
yujun777 force-pushed the fix/ivm-hidden-slot-date-default branch from f00f625 to e777b7b Compare October 19, 2026 09:35
@yujun777

Copy link
Copy Markdown
Contributor Author

run buildall

@yujun777

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new actionable findings in the static review of all 46 changed paths at e777b7b. Review converged in 1 round: two complete-review agents and a separate temporal-risk agent returned NO_NEW_VALUABLE_FINDINGS on the unchanged empty finding set; all candidates and risk items have evidence-based dispositions.

The existing decimal-zero finding is corrected: both decimal implementations scale zero before construction, and the unit test covers DECIMAL(9,9). There are no applicable existing P0/P1 comments to carry forward. The focus file contains no additional user concerns.

Required critical checkpoint Conclusion
Goal and supporting test Typed DATE/DATETIME defaults address the missing snapshot-sequence planning failure. The revised dimension-left/base-right join reaches the temporal pre-snapshot fallback; unit tests inspect type, scale and date components.
Scope and clarity The common fallback delegates to a consistent type API; all 41 added implementations and the DataType contract were checked. The storage-column masking change is explanatory text.
Concurrency and locking No new threads, shared mutable state, locks or lock-order change. Existing refresh synchronization is unchanged.
Lifecycle and initialization Defaults are built on demand with existing literal/function constructors; no new static initialization dependency or resource lifetime.
Configuration No new configuration or dynamic-update requirement.
Compatibility Concrete subclasses implement or inherit the new internal API. No storage/wire format change; existing prerelease IVM compatibility policy applies.
Thrift/protobuf ids No gensrc definition changes.
Parallel paths Incremental snapshot alignment, complete refresh, sink defaults and append-only DUP paths share the helper. Both join orientations and source/MV sequence separation were traced. Cloud/non-cloud refresh orchestration is unchanged.
Special conditions and errors Common-slot validation, the explicit missing-ROW_LSN failure, and exceptional-default precedence remain intact. Unsupported defaults still raise the contextual IvmException.
Test coverage JUnit additions cover temporal defaults and decimal(p,p). The regression covers aggregate/plain joins, dimension updates, higher-sequence base upserts and both-side insertion; it disables SELECT/DML MV rewrites and uses strict INCREMENTAL refresh.
Expected test results All eight ordered output blocks match the SQL data changes by inspection. The wait helper requires task SUCCESS; strict INCREMENTAL does not silently fall back to COMPLETE.
Observability Existing planning errors retain slot/type context and failure classification; existing refresh/task logging is sufficient for the new path.
Transactions and persistence No EditLog, offset persistence or failover logic changed. Snapshot capture and success-only snapshot/epoch recording remain in existing orchestration.
Writes and atomicity Placeholder construction only changes planning; existing insert transaction, MoW and crash-cleanup behavior is preserved.
FE/BE transmission No new transmitted fields. Temporal literal copying/folding/translation retain their concrete type and scale; canonical year-zero date parsing was checked.
Performance Fixed-size literal/empty-collection construction adds no scans, RPCs, row loops or unbounded allocation.
Other invariants No new data-visibility, row-identity, delete-bitmap, ownership or silent-error defect established. A decimal256/session-gating candidate was dismissed because the former cast path used the same gated constructor and no newly affected supported caller was found.

Limits: no builds or tests were run, as required by this review environment. Runtime behavior and output-generation provenance are unverified. The new regression exercises DATETIMEV2(6) inner joins; DATEV2, other scales and reverse join orientation were traced statically, and restart/crash cases were not executed. No unresolved static correctness candidate or unreviewed changed path remains.

Review converged after 1 round(s).

@yujun777

Copy link
Copy Markdown
Contributor Author

run p0

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28637 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit e777b7bb9da9b9b54e6256a7bc98c2b7fb61c644, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17621	5157	5041	5041
q2	2182	337	258	258
q3	10169	1380	824	824
q4	4679	465	335	335
q5	7462	795	540	540
q6	180	182	150	150
q7	773	800	618	618
q8	9275	1323	1049	1049
q9	5448	4225	4185	4185
q10	6834	1286	1008	1008
q11	430	244	224	224
q12	634	392	278	278
q13	18102	3675	3016	3016
q14	279	269	251	251
q15	q16	754	733	654	654
q17	1238	764	584	584
q18	6976	6162	6107	6107
q19	1109	962	597	597
q20	383	333	224	224
q21	5612	2486	2424	2424
q22	376	326	270	270
Total cold run time: 100516 ms
Total hot run time: 28637 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5997	5914	6533	5914
q2	719	612	582	582
q3	5634	5839	5180	5180
q4	2011	2161	1548	1548
q5	5653	5889	5748	5748
q6	231	184	138	138
q7	2241	1998	1745	1745
q8	3015	2706	2661	2661
q9	7959	7988	7645	7645
q10	3624	3599	3135	3135
q11	584	401	390	390
q12	684	664	510	510
q13	3310	3576	3026	3026
q14	284	301	275	275
q15	q16	657	674	619	619
q17	7725	7074	6876	6876
q18	12977	12188	12837	12188
q19	925	794	813	794
q20	2113	2141	1929	1929
q21	5664	4592	4676	4592
q22	495	446	418	418
Total cold run time: 72502 ms
Total hot run time: 65913 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 150850 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit e777b7bb9da9b9b54e6256a7bc98c2b7fb61c644, data reload: false

query5	4309	574	419	419
query6	447	201	192	192
query7	4803	444	225	225
query8	342	184	167	167
query9	8763	3120	3111	3111
query10	471	323	265	265
query11	5976	3848	3554	3554
query12	146	90	89	89
query13	1249	467	360	360
query14	6110	3975	3645	3645
query14_1	3470	3402	3437	3402
query15	213	202	179	179
query16	962	451	459	451
query17	937	682	534	534
query18	2413	434	304	304
query19	217	173	143	143
query20	88	86	84	84
query21	214	127	107	107
query22	13049	13126	12815	12815
query23	13486	12822	12400	12400
query23_1	12608	12492	12510	12492
query24	7416	857	462	462
query24_1	478	481	477	477
query25	547	420	376	376
query26	1275	268	151	151
query27	2731	445	270	270
query28	4599	1939	1929	1929
query29	1583	607	453	453
query30	305	227	184	184
query31	1024	945	818	818
query32	180	91	111	91
query33	534	319	251	251
query34	904	851	496	496
query35	747	753	650	650
query36	808	787	731	731
query37	129	105	87	87
query38	1808	1747	1646	1646
query39	800	812	733	733
query39_1	741	731	738	731
query40	219	119	99	99
query41	71	67	68	67
query42	90	84	88	84
query43	348	365	308	308
query44	1310	683	687	683
query45	181	173	160	160
query46	850	968	565	565
query47	2951	2850	2912	2850
query48	300	309	221	221
query49	577	396	298	298
query50	707	274	209	209
query51	10207	10664	10397	10397
query52	76	77	69	69
query53	188	202	148	148
query54	243	194	172	172
query55	77	66	61	61
query56	249	216	218	216
query57	1681	1598	1566	1566
query58	316	287	258	258
query59	2074	2068	1968	1968
query60	290	240	225	225
query61	152	145	146	145
query62	381	330	306	306
query63	193	160	157	157
query64	2736	971	760	760
query65	3333	3276	3259	3259
query66	1792	428	305	305
query67	20398	20240	20122	20122
query68	2981	1030	605	605
query69	390	286	250	250
query70	834	767	730	730
query71	310	231	214	214
query72	2707	2642	2300	2300
query73	520	536	292	292
query74	4669	4517	4338	4338
query75	2342	2303	1901	1901
query76	2311	1015	599	599
query77	338	376	278	278
query78	9891	9740	9150	9150
query79	1009	848	513	513
query80	1245	426	351	351
query81	592	322	272	272
query82	1135	141	108	108
query83	314	217	187	187
query84	318	114	100	100
query85	879	440	371	371
query86	464	242	229	229
query87	2017	1930	1791	1791
query88	3739	2666	2652	2652
query89	344	282	242	242
query90	1936	172	162	162
query91	167	153	125	125
query92	99	77	87	77
query93	1052	1026	566	566
query94	838	321	249	249
query95	572	381	305	305
query96	696	485	229	229
query97	2422	2400	2300	2300
query98	159	152	164	152
query99	786	764	649	649
Total cold run time: 236755 ms
Total hot run time: 150850 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 24.07 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit e777b7bb9da9b9b54e6256a7bc98c2b7fb61c644, data reload: false

query1	0.00	0.00	0.00
query2	0.10	0.05	0.05
query3	0.27	0.09	0.09
query4	1.61	0.10	0.10
query5	0.24	0.24	0.24
query6	1.18	0.68	0.67
query7	0.04	0.01	0.00
query8	0.06	0.04	0.03
query9	0.40	0.36	0.34
query10	0.57	0.56	0.61
query11	0.20	0.14	0.13
query12	0.17	0.14	0.14
query13	0.49	0.49	0.48
query14	1.03	1.00	1.02
query15	0.63	0.60	0.61
query16	0.35	0.36	0.34
query17	1.10	1.17	1.09
query18	0.19	0.18	0.20
query19	2.10	1.93	1.97
query20	0.02	0.02	0.01
query21	15.52	0.18	0.14
query22	4.95	0.05	0.05
query23	16.26	0.32	0.13
query24	2.99	0.70	0.27
query25	0.15	0.06	0.05
query26	0.77	0.22	0.16
query27	0.06	0.05	0.04
query28	3.64	0.80	0.36
query29	12.53	4.18	3.27
query30	0.28	0.13	0.10
query31	2.78	0.57	0.32
query32	3.22	0.59	0.49
query33	3.18	3.28	3.19
query34	15.38	3.98	3.39
query35	3.34	3.35	3.36
query36	0.57	0.43	0.43
query37	0.09	0.07	0.06
query38	0.05	0.04	0.03
query39	0.03	0.03	0.03
query40	0.18	0.14	0.15
query41	0.10	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 96.91 s
Total hot run time: 24.07 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 28.57% (12/42) 🎉
Increment coverage report
Complete coverage report

@yujun777

Copy link
Copy Markdown
Contributor Author

run external

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 14.29% (6/42) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28365 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit e777b7bb9da9b9b54e6256a7bc98c2b7fb61c644, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17581	5140	5037	5037
q2	2085	296	262	262
q3	10283	1357	813	813
q4	4676	460	338	338
q5	7450	801	536	536
q6	183	189	155	155
q7	763	799	618	618
q8	9268	1339	1059	1059
q9	5564	4195	4186	4186
q10	6823	1280	1025	1025
q11	439	255	240	240
q12	640	399	290	290
q13	18072	3512	2938	2938
q14	279	270	245	245
q15	q16	710	723	695	695
q17	1212	756	576	576
q18	6890	6164	6105	6105
q19	1121	962	629	629
q20	388	339	231	231
q21	5096	2142	2318	2142
q22	348	295	245	245
Total cold run time: 99871 ms
Total hot run time: 28365 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5607	5600	5565	5565
q2	673	575	534	534
q3	5201	5350	4925	4925
q4	1999	2136	1557	1557
q5	5231	5155	5468	5155
q6	263	209	150	150
q7	2191	2061	1810	1810
q8	2998	2720	2683	2683
q9	8000	7876	7876	7876
q10	3702	3627	3282	3282
q11	614	445	573	445
q12	702	703	517	517
q13	3550	3782	3216	3216
q14	318	313	293	293
q15	q16	688	731	692	692
q17	8272	7468	6848	6848
q18	12946	12118	12926	12118
q19	918	793	788	788
q20	2164	2140	1905	1905
q21	5519	4550	4633	4550
q22	519	438	417	417
Total cold run time: 72075 ms
Total hot run time: 65326 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 150187 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit e777b7bb9da9b9b54e6256a7bc98c2b7fb61c644, data reload: false

query5	4307	592	466	466
query6	429	208	189	189
query7	4806	442	230	230
query8	321	170	154	154
query9	8768	3057	3042	3042
query10	480	303	258	258
query11	6054	3861	3583	3583
query12	146	89	88	88
query13	1257	418	317	317
query14	6148	3953	3643	3643
query14_1	3388	3374	3431	3374
query15	206	195	181	181
query16	939	431	406	406
query17	843	652	550	550
query18	2413	426	311	311
query19	203	167	139	139
query20	85	86	84	84
query21	216	124	110	110
query22	12939	13007	12769	12769
query23	13307	12787	12458	12458
query23_1	12495	12481	12488	12481
query24	7373	825	461	461
query24_1	457	464	470	464
query25	507	397	334	334
query26	1256	256	133	133
query27	2787	442	265	265
query28	4617	1941	1946	1941
query29	1542	574	428	428
query30	300	212	184	184
query31	996	910	798	798
query32	149	88	91	88
query33	520	296	235	235
query34	887	842	500	500
query35	728	741	635	635
query36	858	846	720	720
query37	131	98	76	76
query38	1758	1728	1692	1692
query39	784	810	741	741
query39_1	738	726	746	726
query40	222	111	94	94
query41	70	64	67	64
query42	88	84	82	82
query43	343	355	314	314
query44	1279	669	682	669
query45	175	177	166	166
query46	833	958	561	561
query47	2976	2709	2878	2709
query48	290	309	237	237
query49	597	399	291	291
query50	696	271	203	203
query51	10738	10373	10318	10318
query52	77	80	70	70
query53	184	207	153	153
query54	238	205	193	193
query55	68	71	63	63
query56	270	207	215	207
query57	1681	1611	1572	1572
query58	278	280	245	245
query59	2184	2129	1932	1932
query60	290	256	227	227
query61	151	146	149	146
query62	378	331	282	282
query63	196	153	171	153
query64	2750	950	766	766
query65	3320	3290	3273	3273
query66	1783	421	298	298
query67	20244	19963	20042	19963
query68	2976	1029	605	605
query69	381	288	241	241
query70	833	771	769	769
query71	290	228	199	199
query72	2693	2572	2300	2300
query73	518	520	302	302
query74	4588	4543	4375	4375
query75	2328	2310	1896	1896
query76	2326	1006	580	580
query77	348	399	267	267
query78	9595	9585	9116	9116
query79	877	846	526	526
query80	537	406	340	340
query81	531	322	275	275
query82	208	131	107	107
query83	199	194	179	179
query84	291	128	98	98
query85	761	411	376	376
query86	261	243	227	227
query87	2001	1977	1815	1815
query88	3565	2665	2645	2645
query89	311	282	241	241
query90	2100	169	165	165
query91	166	153	124	124
query92	99	93	88	88
query93	974	985	567	567
query94	451	322	263	263
query95	582	320	358	320
query96	660	490	229	229
query97	2441	2443	2275	2275
query98	162	158	154	154
query99	752	760	647	647
Total cold run time: 233110 ms
Total hot run time: 150187 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 28.57% (12/42) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 24.42 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit e777b7bb9da9b9b54e6256a7bc98c2b7fb61c644, data reload: false

query1	0.01	0.01	0.01
query2	0.09	0.05	0.05
query3	0.26	0.09	0.09
query4	1.61	0.10	0.09
query5	0.25	0.28	0.24
query6	1.17	0.67	0.68
query7	0.05	0.01	0.00
query8	0.05	0.04	0.03
query9	0.41	0.34	0.34
query10	0.57	0.57	0.57
query11	0.20	0.14	0.15
query12	0.19	0.15	0.15
query13	0.50	0.49	0.50
query14	1.02	1.02	1.02
query15	0.62	0.62	0.61
query16	0.31	0.35	0.36
query17	1.17	1.12	1.15
query18	0.19	0.19	0.20
query19	2.12	1.99	1.98
query20	0.02	0.02	0.01
query21	15.48	0.18	0.14
query22	4.87	0.06	0.05
query23	16.27	0.32	0.12
query24	2.68	0.56	0.44
query25	0.08	0.06	0.04
query26	1.39	0.21	0.16
query27	0.05	0.05	0.03
query28	3.85	0.71	0.36
query29	12.51	4.19	3.30
query30	0.29	0.12	0.10
query31	2.77	0.57	0.32
query32	3.22	0.59	0.50
query33	3.14	3.22	3.22
query34	15.50	3.97	3.42
query35	3.36	3.32	3.31
query36	0.56	0.47	0.41
query37	0.09	0.07	0.06
query38	0.04	0.04	0.03
query39	0.04	0.03	0.03
query40	0.16	0.15	0.15
query41	0.08	0.02	0.02
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 97.32 s
Total hot run time: 24.42 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 14.29% (6/42) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 14.29% (6/42) 🎉
Increment coverage report
Complete coverage report

1 similar comment
@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 14.29% (6/42) 🎉
Increment coverage report
Complete coverage report

@yujun777

Copy link
Copy Markdown
Contributor Author

run cloud_p0

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 14.29% (6/42) 🎉
Increment coverage report
Complete coverage report

@yujun777

Copy link
Copy Markdown
Contributor Author

run external

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 6.12% (6/98) 🎉
Increment coverage report
Complete coverage report

morrySnow
morrySnow previously approved these changes Oct 20, 2026
Distinguish synthesized type zero values from SQL column DEFAULT values.

Key changes:
- Rename DataType.defaultValue() to zeroValue()
- Document the expression contract and cover JSON null

Unit Test:
- tools/fast-compile-fe.sh
- tools/fast-fe-ut.sh IvmUtilTest
- mvn checkstyle:check -pl fe-core
@yujun777 yujun777 changed the title [fix](ivm) Give every data type a non-null default value for hidden slots [fix](ivm) Use type zero values for missing hidden slots Oct 20, 2026
@yujun777

Copy link
Copy Markdown
Contributor Author

run buildall

@yujun777

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all 46 changed paths at 38b4936. No new actionable findings. The existing decimal precision-equals-scale finding (thread 4311624787) is fixed: both decimal variants scale zero before validation, with DECIMAL(9,9) unit coverage. No existing P0/P1 finding remains to carry forward. No additional user focus was supplied.

The main review and three reviewers covered the complete type API, IVM integration/tests, and independent temporal/snapshot risks. All three returned NO_NEW_VALUABLE_FINDINGS against the same empty inline set. Review converged in 1 round, with no unresolved static candidate or uncovered changed path.

Critical checkpoint conclusions:

  1. Goal and evidence: type-owned non-null defaults fix the missing temporal sequence placeholder during scan replacement. For the regression's dimension-left/base-right join, a left delta reads preSnapshot(base); the adapter constructs the typed placeholder with the original ExprId, and the normalization project removes the source sequence before handlers select the MV's own BIGINT sequence. Unit tests and aggregate/plain regression cases cover this intended path; reviewed statically.
  2. Scope and reuse: the 42 type/coercion edits implement the new abstract method using existing literals/functions; IvmUtil centralizes consumption. No unrelated source change found.
  3. Concurrency and locking: no new threads, shared mutable state, lock acquisition, or lock-order changes. Expressions are created during planning.
  4. Lifecycle and static initialization: no new resource ownership, cached expression lifecycle, or static initialization dependency.
  5. Configuration: no configuration added or dynamic-update requirement introduced.
  6. Compatibility: concrete DataType subclasses implement or inherit the API; no persisted schema/storage format or mixed-version protocol change. Existing IVM compatibility policy applies.
  7. Thrift/protobuf: no definitions changed.
  8. Parallel paths: incremental scan remapping, pre/post snapshots, full-refresh stream replacement, unique-key sinks and append-only DUP sinks checked. Mandatory real row-LSN mapping remains intact.
  9. Conditions and failures: common-hidden-slot admission, row-LSN refusal and unsupported-type failures remain explicit; no newly silent business/identity default found.
  10. Test coverage: JUnit additions cover DATEV2/DATETIMEV2 and decimal boundaries plus representative zero values. Regression covers aggregate/plain MVs, dimension-only delta, sequenced base update and simultaneous new-key insertion. Both transparent rewrites are disabled; strict INCREMENTAL requests cannot hide a planning failure through COMPLETE fallback. Unchanged negative paths and remaining type variants were checked by static control-flow/constructor review.
  11. Expected outputs: all eight new result blocks match the SQL/DML and use deterministic order_qt output. Result-file generation provenance was not verified.
  12. Observability: existing contextual IvmException/task failure reporting covers these planning errors; no new operation needs metrics or logging.
  13. Transactions and persistence: no EditLog, offset-commit, failover, or snapshot-lifecycle behavior changes.
  14. Writes and crash behavior: existing refresh transaction boundaries remain; the MV retains its delta sequence and computed delete sign, and business/identity values remain sourced from scans.
  15. FE/BE values: existing typed literal/function translation and serialization reused; temporal scales and ranges checked, including UTC timestamp and nanosecond epoch defaults. No new transmitted field.
  16. Performance: constant-size expression creation per missing slot during planning; no new per-row work, scan, RPC, or unbounded computation found.
  17. Other mechanisms: exact collection/character/binary types, non-null JSON null, empty state functions, concrete type admission, outer-join repair and chained MVs checked. The existing Decimal256 session gate is unchanged and no new admitted hidden-decimal path was found. No additional substantiated issue.

Validation limits: static review only, as required. No builds or tests were run, and runtime behavior or .out generation is not claimed verified. No remaining static coverage gap.

Review converged after 1 round(s).

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28616 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 38b49360cd93999164cfd88c8a3915224c71ab4d, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17592	5198	5074	5074
q2	2145	328	257	257
q3	10210	1372	826	826
q4	4684	459	335	335
q5	7433	806	523	523
q6	178	187	153	153
q7	752	790	594	594
q8	9257	1285	1102	1102
q9	5688	4168	4154	4154
q10	6805	1272	1029	1029
q11	428	244	233	233
q12	637	397	282	282
q13	18101	4239	2993	2993
q14	278	272	243	243
q15	q16	740	711	650	650
q17	1212	753	573	573
q18	7018	6193	6123	6123
q19	1117	954	588	588
q20	375	340	220	220
q21	5586	2371	2462	2371
q22	369	331	293	293
Total cold run time: 100605 ms
Total hot run time: 28616 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5937	5910	6177	5910
q2	726	603	574	574
q3	5696	5818	5300	5300
q4	2018	2167	1603	1603
q5	5758	5814	5603	5603
q6	233	184	140	140
q7	2210	2070	1823	1823
q8	2983	2627	2596	2596
q9	8005	7894	7508	7508
q10	3636	3571	3149	3149
q11	575	404	377	377
q12	666	679	499	499
q13	3248	3563	2935	2935
q14	280	289	266	266
q15	q16	657	691	613	613
q17	7751	7002	6861	6861
q18	12976	12176	12836	12176
q19	900	775	793	775
q20	2127	2143	1923	1923
q21	5550	4579	4684	4579
q22	509	447	430	430
Total cold run time: 72441 ms
Total hot run time: 65640 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 150423 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 38b49360cd93999164cfd88c8a3915224c71ab4d, data reload: false

query5	4315	584	449	449
query6	452	225	196	196
query7	4800	440	219	219
query8	316	167	148	148
query9	8788	3105	3103	3103
query10	470	309	258	258
query11	6057	3858	3601	3601
query12	145	89	86	86
query13	1247	446	313	313
query14	6111	3942	3619	3619
query14_1	3433	3406	3419	3406
query15	205	196	195	195
query16	947	430	415	415
query17	862	677	514	514
query18	2410	413	299	299
query19	192	164	148	148
query20	81	81	83	81
query21	200	123	106	106
query22	12954	12997	12732	12732
query23	13723	12937	12412	12412
query23_1	12662	12544	12441	12441
query24	7331	812	459	459
query24_1	459	458	469	458
query25	509	387	333	333
query26	1249	254	136	136
query27	2761	434	269	269
query28	4614	1939	1935	1935
query29	1539	576	436	436
query30	301	217	183	183
query31	1004	922	794	794
query32	146	87	84	84
query33	507	290	236	236
query34	901	836	482	482
query35	730	760	639	639
query36	814	804	744	744
query37	120	128	78	78
query38	1791	1732	1658	1658
query39	771	800	738	738
query39_1	731	728	736	728
query40	217	112	92	92
query41	65	63	63	63
query42	84	82	80	80
query43	344	360	314	314
query44	1307	674	669	669
query45	175	178	162	162
query46	824	961	564	564
query47	2960	2697	2911	2697
query48	292	308	224	224
query49	576	402	287	287
query50	677	271	197	197
query51	10331	10389	10568	10389
query52	83	80	76	76
query53	180	206	152	152
query54	241	218	179	179
query55	71	67	62	62
query56	236	231	199	199
query57	1656	1628	1557	1557
query58	284	269	253	253
query59	2117	2233	1895	1895
query60	285	262	212	212
query61	149	149	154	149
query62	389	329	285	285
query63	192	150	160	150
query64	2735	1017	885	885
query65	3326	3259	3261	3259
query66	1811	431	307	307
query67	20182	20076	19968	19968
query68	3221	1002	606	606
query69	386	291	255	255
query70	839	788	767	767
query71	306	235	216	216
query72	2903	2706	2452	2452
query73	511	571	293	293
query74	4649	4474	4338	4338
query75	2325	2273	1921	1921
query76	2331	1015	578	578
query77	343	379	268	268
query78	9915	9723	9166	9166
query79	968	856	521	521
query80	949	444	336	336
query81	590	313	267	267
query82	574	129	107	107
query83	312	199	178	178
query84	309	123	102	102
query85	908	422	364	364
query86	354	239	222	222
query87	2023	1898	1789	1789
query88	3602	2632	2648	2632
query89	325	280	242	242
query90	1794	169	156	156
query91	168	151	124	124
query92	97	91	85	85
query93	984	987	576	576
query94	544	322	277	277
query95	572	385	303	303
query96	662	480	228	228
query97	2457	2458	2336	2336
query98	157	149	145	145
query99	771	765	651	651
Total cold run time: 235059 ms
Total hot run time: 150423 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 24.37 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 38b49360cd93999164cfd88c8a3915224c71ab4d, data reload: false

query1	0.00	0.00	0.01
query2	0.09	0.05	0.05
query3	0.26	0.09	0.08
query4	1.61	0.10	0.10
query5	0.24	0.24	0.25
query6	1.18	0.69	0.68
query7	0.04	0.01	0.00
query8	0.06	0.04	0.04
query9	0.40	0.35	0.35
query10	0.58	0.60	0.60
query11	0.20	0.14	0.14
query12	0.19	0.15	0.14
query13	0.48	0.49	0.50
query14	1.04	1.01	1.02
query15	0.63	0.60	0.60
query16	0.34	0.34	0.35
query17	1.11	1.16	1.13
query18	0.21	0.19	0.19
query19	2.10	1.96	1.96
query20	0.02	0.02	0.01
query21	15.43	0.22	0.13
query22	4.75	0.05	0.06
query23	16.32	0.33	0.12
query24	3.03	0.56	0.32
query25	0.12	0.07	0.05
query26	0.83	0.20	0.17
query27	0.03	0.05	0.05
query28	3.86	0.85	0.37
query29	12.52	4.15	3.31
query30	0.28	0.12	0.10
query31	2.76	0.55	0.33
query32	3.23	0.60	0.50
query33	3.22	3.24	3.21
query34	15.48	4.01	3.41
query35	3.40	3.32	3.34
query36	0.57	0.44	0.47
query37	0.09	0.06	0.07
query38	0.05	0.04	0.04
query39	0.04	0.02	0.02
query40	0.17	0.15	0.15
query41	0.08	0.03	0.02
query42	0.04	0.02	0.02
query43	0.04	0.04	0.03
Total cold run time: 97.12 s
Total hot run time: 24.37 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 14.29% (6/42) 🎉
Increment coverage report
Complete coverage report

@yujun777
yujun777 merged commit 4e0d891 into apache:master Oct 21, 2026
43 of 44 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Oct 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

hello-stephen pushed a commit that referenced this pull request Oct 21, 2026
Related PR: #69311, #69268, #63639

Problem Summary: #69311 renamed the row binlog (the change stream IVM
reads) to **changelog** and rejected the legacy keys `binlog.format` /
`binlog.need_historical_value` in every DDL. Two test files merged just
before it fell outside that rename sweep and now fail:

1.
`regression-test/suites/mtmv_p0/ivm/test_ivm_datetime_sequence.groovy`
(from #69268) — creates its IVM base tables with `"binlog.enable" =
"true", "binlog.format" = "ROW", "binlog.need_historical_value" =
"true"`, which CREATE TABLE now rejects.
2.
`RelationImpliedPredicateTest#testIvmOutputPredicatesSkipHiddenColumns`
(from #63639) — same legacy properties in the base-table DDL, and it
gates the creation on `enable_feature_binlog` instead of the new
`enable_feature_changelog`.

Fix: switch both to `"changelog.enable" = "true"` (plus
`"changelog.need_historical_value" = "true"` where the before-image is
needed), drop the rejected `binlog.format`, and use
`enable_feature_changelog` as the feature gate in the FE unit test.
Related IVM trace issue: #65418 .
OIiveirra added a commit to OIiveirra/doris that referenced this pull request Oct 21, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#69032

Problem Summary: Upstream apache#69268 adds the abstract DataType.zeroValue interface. GeometryType and GeographyType omitted it, causing both TeamCity COMPILE 1076409 and performance 1076365 to fail during FE compilation of the merged PR. Return Optional.empty for both types, retaining the lack of a default non-null spatial expression. Add a consumer-level unit test covering default/custom CRS and Geography algorithms: hidden-slot default generation fails explicitly instead of synthesizing a spatial value. No spatial defaults, internal storage or IVM capability are added.

### Release note

None

### Check List (For Author)

- Test: Unit Test / Manual test
    - JDK17 FE UT 92/92: DataTypeTest, IvmUtilTest, SpatialPredicateLegalityTest, SpatialAggregateLegalityTest and ConnectorSpatialWriteValidatorTest.
    - Standard build.sh --fe -j16 and Checkstyle passed on the merged official master; build hygiene passed.
    - Existing ordinary-key spatial-value admission controls remain passing. No service restart, external SQL, local BE UT or performance test was needed for this planner interface compatibility fix.
- Behavior changed: No (existing spatial semantics retained; unavailable zero values are explicit)
- Does this need documentation: No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants