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

   ### What problem does this PR solve?
   
   Problem Summary:
   
   This pull request refactors the handling of default values for sequence 
columns, especially those using `CURRENT_TIMESTAMP`, and removes several unused 
methods and constants from the `ColumnDef` class. It also updates logic in 
related modules to use the improved default value checking and adds a 
regression test for sequence columns with `CURRENT_TIMESTAMP(6)` as the default 
value.
   
   #### Default value handling improvements
   * Introduced a regex-based method `isCurrentTimeStampDefaultValue` in 
`ColumnDef.DefaultValue` for robust checking of `CURRENT_TIMESTAMP` default 
values, including those with precision (e.g., `CURRENT_TIMESTAMP(6)`), and 
removed old constants and methods related to empty defaults and timestamp 
precision.
   * Updated usages in `BindSink.java` and `MergeIntoCommand.java` to use the 
new method for validating sequence column defaults, replacing previous string 
equality checks. 
[[1]](diffhunk://#diff-302a453ae05c168001c2f01eaffa3c30ed559eec1c225111a5e3c3b15c13841dL245-R245)
 
[[2]](diffhunk://#diff-c3d99ca1f50fc00e3b72abc64f45c2dba828b5d2d5cfddef8426b3d59fed7edaL271-R272)
 
[[3]](diffhunk://#diff-c3d99ca1f50fc00e3b72abc64f45c2dba828b5d2d5cfddef8426b3d59fed7edaL334-R333)
   
   #### Code cleanup and simplification
   * Removed unused constructors, static factory methods, and constants from 
`ColumnDef`, including those for delete sign, version, row store, skip bitmap 
columns, and empty default values. Also removed unused setter and getter 
methods. 
[[1]](diffhunk://#diff-cb2f975da4673a5159b55a8ba19fa904365c87ad75f7a542172c174093bd447eL264-L269)
 
[[2]](diffhunk://#diff-cb2f975da4673a5159b55a8ba19fa904365c87ad75f7a542172c174093bd447eL304-L350)
 
[[3]](diffhunk://#diff-cb2f975da4673a5159b55a8ba19fa904365c87ad75f7a542172c174093bd447eL603-L610)
   
   #### Testing enhancements
   * Added a regression test to verify sequence columns with `datetimev2(6)` 
defaulting to `current_timestamp(6)`, ensuring correct behavior for this 
scenario.
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [x] 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:
       - [x] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [x] 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