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

   ### What problem does this PR solve?
   
   **Problem Summary:**
   `DateLiteral` in its `init()` method calls `DateUtils.getTimeZone()` to 
obtain the current timezone from the Nereids utility package. This couples the 
legacy `analysis` package to the newer `nereids` package unnecessarily.
   
   ### Changes
   
   1. **Creates `DateLiteralUtils` helper class** with a static 
`createDateLiteral(String, Type)` factory method that replicates the exact 
parsing behavior of the removed constructor
   2. **Removes the `DateLiteral(String, Type)` constructor** and its `init()` 
method from DateLiteral.java
   3. **Moves timezone helpers** (`haveTimeZoneOffset`, `haveTimeZoneName`, 
`getTimeZoneSplitPos`, `HAS_OFFSET_PART`) to DateLiteralUtils
   4. **Updates all production callers** (LiteralExpr, 
ExprToStringValueVisitor, PartitionExprUtil, ColumnDef, SchemaChangeProcDir, 
RollupProcDir, BuildIndexProcDir, PartitionsProcDir, PropertyAnalyzer, 
StatisticsUtil)
   5. **Updates all test callers** to use the new factory method
   6. **Removes the `DateUtils` import** from DateLiteral.java
   
   The `DateUtils` dependency now lives only in `DateLiteralUtils`, not in 
`DateLiteral`.
   
   ### Design Notes
   
   - `DateLiteralUtils` uses `DateLiteral.formatterList` (package-private) for 
compact format parsing
   - `checkRange()`/`checkDate()` made package-private so DateLiteralUtils can 
perform the same validation as the original `init()`
   - `DateLiteral(String)` single-arg constructor delegates to 
`DateLiteralUtils.createDateLiteral(s, null)`
   - When auto-detecting type with microseconds and 
`enable_date_conversion=false`, DATETIME v1 is upgraded to DATETIMEV2 (matching 
the explicit-type path behavior)
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test: Unit Test (DateLiteralTest - 16 tests pass)
   - Behavior changed: No
   - Does this need documentation: No


-- 
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