[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:
@ -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());
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user