[Enhance] Modify the error message when mv column is transformed from base column in agg family table (#5084)

When user wants to create materialized view with a mv column which is transformed
from original column in agg family table, Doris will throw a new error message
"The mv column of agg or uniq table cannot be transformed from original column"
instead of "column not exists".
This commit is contained in:
EmmyMiao87
2020-12-17 00:33:27 +08:00
committed by GitHub
parent ef15c5151c
commit 9864a5d818

View File

@ -444,6 +444,10 @@ public class MaterializedViewHandler extends AlterHandler {
if (mvColumnItem.isKey()) {
++numOfKeys;
}
if (baseColumn == null) {
throw new DdlException("The mv column of agg or uniq table cannot be transformed "
+ "from original column[" + mvColumnItem.getBaseColumnName() + "]");
}
Preconditions.checkNotNull(baseColumn, "Column[" + mvColumnName + "] does not exist");
AggregateType baseAggregationType = baseColumn.getAggregationType();
AggregateType mvAggregationType = mvColumnItem.getAggregationType();