qidaye opened a new pull request, #48988:
URL: https://github.com/apache/doris/pull/48988

   ### What problem does this PR solve?
   
   Issue Number: close #
   
   Related PR: #46648
   
   Problem Summary:
   
   We introduced `Index.columnUniqueIds` in 3.0.3, and make sure 
`Index.columnUniqueIds` is not empty in 3.0.4.
   But when we upgrade Doris from 3.0.2 and before to 3.0.4, the 
`Index.columnUniqueIds` will be `null`.
   
   This pull request includes several changes to the `fe-core` module in order 
to initialize and handle column unique IDs for indexes in various scenarios. 
The most important changes include adding methods to initialize column unique 
IDs, updating methods to handle null checks, and ensuring the initialization is 
called in relevant workflows.
   
   ### Initialization of Column Unique IDs:
   
   * 
[`fe/fe-core/src/main/java/org/apache/doris/catalog/MaterializedIndexMeta.java`](diffhunk://#diff-fc2290d8d8312eea04f60d3f8898e19a3a8afe201e66ff0accb5b240d671586fR404-R415):
 Added a new method `initIndexColumnUniqueId` to initialize column unique IDs 
for indexes.
   * 
[`fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java`](diffhunk://#diff-b4517d502bbf316408d50dcd459fbbfa085ad208a79634312ae545ae77dea49fR3045-R3051):
 Added a new method `initIndexColumnUniqueId` to initialize column unique IDs 
for older version indexes.
   
   ### Null Checks for Column Unique IDs:
   
   * 
[`fe/fe-core/src/main/java/org/apache/doris/catalog/Index.java`](diffhunk://#diff-5b4a65dbfe5a84a91d5c3b9e23afb4971978f0cbb49780686e9620e465f9ac75R195-R197):
 Added null checks for `columnUniqueIds` in `getColumnUniqueIds`, `toThrift`, 
and `toPb` methods to ensure proper handling. 
[[1]](diffhunk://#diff-5b4a65dbfe5a84a91d5c3b9e23afb4971978f0cbb49780686e9620e465f9ac75R195-R197)
 
[[2]](diffhunk://#diff-5b4a65dbfe5a84a91d5c3b9e23afb4971978f0cbb49780686e9620e465f9ac75R266-R283)
   
   ### Integration with Existing Workflows:
   
   * 
[`fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java`](diffhunk://#diff-f6ca4334277645de268d5ba725dc96ea03e452ca10d5125ae9bf7d4a4e50cfaaR1769-R1770):
 Updated `addPartition` and `truncateTable` methods to call 
`initIndexColumnUniqueId` to ensure column unique IDs are initialized during 
partition creation and table truncation. 
[[1]](diffhunk://#diff-f6ca4334277645de268d5ba725dc96ea03e452ca10d5125ae9bf7d4a4e50cfaaR1769-R1770)
 
[[2]](diffhunk://#diff-f6ca4334277645de268d5ba725dc96ea03e452ca10d5125ae9bf7d4a4e50cfaaR3616-R3617)
   
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] 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 <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [ ] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### 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]

Reply via email to