-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Description
Search before asking
- I had searched in the issues and found no similar issues.
Description
if (columnName.startsWith(CreateMaterializedViewStmt.MATERIALIZED_VIEW_NAME_PREFIX)
|| columnName.startsWith(CreateMaterializedViewStmt.MATERIALIZED_VIEW_AGGREGATE_NAME_PREFIX)) {
throw new AnalysisException(
"Incorrect column name " + columnName + ", column name can't start with 'mv_'/'mva_'");
}
we currently could not create column start with 'mv_'/'mva_'. it is true that i can:
- Avoid naming conflicts: Prevents user column names from conflicting with system-generated materialized view column names
- System consistency: Ensures proper functioning of internal materialized view mechanisms
but:
- Poor user experience: Users may legitimately need to create columns starting with mv_, making this restriction too strict
- Prefix too short: mv_ and mva_ are too short and easily conflict with users' normal naming conventions
Solution
Better Handling Methods
- Use Longer System Prefixes or Use Special Character Prefixes
- Add Escaping Mechanism or Add Configuration Control
example:
- Use Longer System Prefixes
public static final String MATERIALIZED_VIEW_NAME_PREFIX = "__doris_internal_mv_";
public static final String MATERIALIZED_VIEW_AGGREGATE_NAME_PREFIX = "__doris_internal_mva_";
Advantages:
- Greatly reduces conflict probability with user column names
- Keeps existing logic simple
- Configuration Control
// Add configuration items in Config
public static boolean enable_mv_column_name_prefix_check = true;
Advantages:
- Allow users to decide if they need to apply limitations
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Mikuroda4402
Metadata
Metadata
Assignees
Labels
No labels