[fix](array-type) adjust enable_array_type config (#12071)

Problem:
1. `enable_array_type` is masterOnly;
2. dynamic open config only affect FE MASTER
`admin set frontend config("enable_array_type"="true");`
3. query in FE FOLLOWER will fail, because of `enable_array_type` is false in FE FOLLOWER
`select * from table_with_array `

Solution:
Only check `enable_array_type` while creating new tables with array column.

Co-authored-by: cambyzju <zhuxiaoli01@baidu.com>
This commit is contained in:
camby
2022-08-29 11:10:52 +08:00
committed by GitHub
parent 44c4a45f72
commit fe9767941d
2 changed files with 4 additions and 5 deletions

View File

@ -389,6 +389,9 @@ public class CreateTableStmt extends DdlStmt {
columnDef.analyze(engineName.equals("olap"));
if (columnDef.getType().isArrayType()) {
if (!Config.enable_array_type) {
throw new AnalysisException("Please open enable_array_type config before use Array.");
}
if (columnDef.getAggregateType() != null && columnDef.getAggregateType() != AggregateType.NONE) {
throw new AnalysisException("Array column can't support aggregation "
+ columnDef.getAggregateType());

View File

@ -17,7 +17,6 @@
package org.apache.doris.catalog;
import org.apache.doris.common.Config;
import org.apache.doris.thrift.TColumnType;
import org.apache.doris.thrift.TTypeDesc;
import org.apache.doris.thrift.TTypeNode;
@ -155,9 +154,6 @@ public class ArrayType extends Type {
@Override
public boolean isSupported() {
if (!Config.enable_array_type) {
return false;
}
return !itemType.isNull();
}
@ -180,7 +176,7 @@ public class ArrayType extends Type {
@Override
public boolean supportsTablePartitioning() {
return isSupported() && !isComplexType();
return false;
}
@Override