yujun777 opened a new pull request, #69268: URL: https://github.com/apache/doris/pull/69268
### What problem does this PR solve? Related issue: https://github.com/apache/doris/issues/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 fills a missing common hidden slot with the data type's default value. 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) ``` 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 `defaultValue()`, and every concrete type implements it with the type's non-null default value (`0`, `''`, `0000-01-01 00:00:00`, `0.0.0.0`, empty bitmap/hll, ...). `IvmUtil.getCommonHiddenSlotDefault` uses it instead of branching on type categories, so a hidden slot of any type is filled and a type without a default still fails loudly. ### 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 <!-- At least one of them must be included. --> - [x] Regression test - [x] 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 <!-- Add your reason? --> - Behavior changed: - [x] No. - Does this need documentation? - [x] No. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
