wenzhenghu opened a new issue, #53172: URL: https://github.com/apache/doris/issues/53172
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) 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 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 1. Use Longer System Prefixes or Use Special Character Prefixes 2. Add Escaping Mechanism or Add Configuration Control example: 1. 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 2. 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? - [x] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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]
