[ 
https://issues.apache.org/jira/browse/KYLIN-6076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18016493#comment-18016493
 ] 

Longfei Jiang commented on KYLIN-6076:
--------------------------------------

*Dev Design: Internal Table Attribute Validation Logic*

*Objective*
Add validation logic for the storage type and table properties (tbl_properties) 
of an InternalTable, ensuring that user-provided parameters are legal and 
comply with business rules.

*Core Design*

1. Storage Type Validation

Verify whether the user-specified storage type is within the supported range.

If the storage type is invalid, throw an exception and prompt the user to check 
and retry.

2. Table Properties Validation

Perform deep validation only for specific storage types (e.g., GLUTEN); skip 
validation for others.

Check whether the keys in tbl_properties belong to the predefined valid key 
set. If invalid keys exist, throw an exception.

For PRIMARY_KEY and ORDER_BY_KEY:

If PRIMARY_KEY is set, ORDER_BY_KEY must also be set.

Validate that PRIMARY_KEY is a prefix subset of ORDER_BY_KEY. If not satisfied, 
throw an exception.

3. Error Handling

Use a unified exception class (e.g., KylinException) to capture illegal 
parameters and return user-friendly error messages.

Error messages support internationalization to facilitate use in multilingual 
environments.

4. Extensibility

The legality check logic for storage types and table properties is managed via 
enums and constants, making it easy to extend with new storage types or 
attributes in the future.

*Note:*
The logic for verifying whether a column exists in a table is out of scope for 
this issue. That check should be performed later when the logic is actually 
processed. This validation here should remain lightweight and only based on the 
request information.

> Complete the verification of the additional tbl_properties field 
> corresponding to storage_type in the internal table
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: KYLIN-6076
>                 URL: https://issues.apache.org/jira/browse/KYLIN-6076
>             Project: Kylin
>          Issue Type: New Feature
>    Affects Versions: 5.0.0
>            Reporter: Longfei Jiang
>            Assignee: Longfei Jiang
>            Priority: Minor
>         Attachments: image-2025-08-26-17-18-33-593.png
>
>
> The extra attribute tbl_properties fields key and value corresponding to the 
> storage_type are not verified.
> This problem exists in the interface for converting ordinary tables to 
> internal tables and updating internal table properties.
>  !image-2025-08-26-17-18-33-593.png|thumbnail! 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to