[fix](array-type) forbid to create materialized view for array column (#12543)

Co-authored-by: hucheng01 <hucheng01@baidu.com>
This commit is contained in:
carlvinhust2012
2022-09-15 11:08:23 +08:00
committed by GitHub
parent e413a2b8e9
commit 33f5a86e69
2 changed files with 83 additions and 0 deletions

View File

@ -505,6 +505,12 @@ public class MaterializedViewHandler extends AlterHandler {
if (KeysType.UNIQUE_KEYS == olapTable.getKeysType() && olapTable.hasSequenceCol()) {
newMVColumns.add(new Column(olapTable.getSequenceCol()));
}
// if the column is array type, we forbid to create materialized view
for (Column column : newMVColumns) {
if (column.getDataType() == PrimitiveType.ARRAY) {
throw new DdlException("The array column[" + column + "] not support to create materialized view");
}
}
if (olapTable.getEnableLightSchemaChange()) {
int nextColUniqueId = Column.COLUMN_UNIQUE_ID_INIT_VALUE + 1;