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

   ### Background
   
   VARIANT storage templates declare the data types of selected paths. Variant 
V2 can represent decimals with precision up to 38.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: None
   PR Type: Bugfix
   
   Problem Summary:
   
   A table with a VARIANT template such as `VARIANT<'amount':DECIMAL(39,2)>` 
can be created even though Variant V2 cannot represent its path value. CREATE 
TABLE rejects the declaration on master.
   
   ### Details
   
   - **Frequency:** Always for eligible Decimal256 templates when Decimal256 is 
enabled for the SQL session.
   - **Root cause:** FE CREATE TABLE validation allowed declared Decimal256 
paths, while the V2 storage read path rejected conversion.
   - **Why existing tests missed it:** The existing VARIANT DDL unit tests did 
not cover Decimal256 declarations. The storage regression previously expected a 
read-time error after successfully creating a Decimal256 template.
   - **Fix:** Check the declared path types during DDL validation, including 
array element types, and report the affected column.
   - **Other paths and branches:** Decimal128 templates and standalone 
Decimal256 columns remain allowed. Existing metadata replay and SELECT code 
retain their current behavior. Branches 4.2 and 4.1 apply the check only in V2.
   
   - **Behavior change:** A Decimal256 storage template now produces an 
analysis error when a table is created.
   
   ### Testing
   
   On dev-x, the baseline ran 2 tests and failed the rejection assertion 
because CREATE TABLE accepted the Decimal256 declaration. The candidate passed 
both tests with zero failures, errors or skips. On dev-x, the ASAN cluster 
passed `variant_decimal256_storage_error` and `test_variant_values_index_ddl` 
with zero failed or skipped suites.
   
   ### Release note
   
   New tables using Variant V2 reject VARIANT templates that declare Decimal256 
paths.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes (see Details).
   - Does this need documentation: Yes. Document the maximum template decimal 
precision for Variant V2.
   - Pre-submission status: Ready
   
   ### AI Disclosure
   
   - Tool: Codex
   - Generated: Source, tests and description draft.
   - Human review: not stated
   


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