[feature](planner) allow HLL and QUANTILE_STATE types on duplicate and unique table (#28546)

This commit is contained in:
bobhan1
2023-12-19 09:54:24 +08:00
committed by GitHub
parent 66fbb22ad7
commit 6503aaf7db
23 changed files with 973 additions and 179 deletions

View File

@ -521,14 +521,6 @@ public class CreateTableStmt extends DdlStmt {
throw new AnalysisException("Time type is not supported for olap table");
}
if (columnDef.getType().isObjectStored()) {
if (!columnDef.getType().isBitmapType()) {
if (keysDesc.getKeysType() != KeysType.AGG_KEYS) {
throw new AnalysisException("column:" + columnDef.getName() + " must be used in AGG_KEYS.");
}
}
}
if (!columnSet.add(columnDef.getName())) {
ErrorReport.reportAnalysisException(ErrorCode.ERR_DUP_FIELDNAME, columnDef.getName());
}

View File

@ -115,11 +115,8 @@ public enum AggregateType {
compatibilityMap.put(MAX, EnumSet.copyOf(primitiveTypeList));
primitiveTypeList.clear();
// all types except object stored column type, such as bitmap hll
// quantile_state.
// all types except agg_state.
EnumSet<PrimitiveType> excObjectStored = EnumSet.allOf(PrimitiveType.class);
excObjectStored.remove(PrimitiveType.HLL);
excObjectStored.remove(PrimitiveType.QUANTILE_STATE);
excObjectStored.remove(PrimitiveType.AGG_STATE);
compatibilityMap.put(REPLACE, EnumSet.copyOf(excObjectStored));

View File

@ -191,13 +191,7 @@ public class ColumnDefinition {
throw new AnalysisException("Type exceeds the maximum nesting depth of 9");
}
}
if (type.isHllType() || type.isQuantileStateType()) {
if (aggType == null) {
throw new AnalysisException("column: " + name + " must be used in AGG_KEYS.");
}
isNullable = false;
}
if (type.isBitmapType()) {
if (type.isHllType() || type.isQuantileStateType() || type.isBitmapType()) {
if (aggType != null) {
isNullable = false;
}
@ -349,14 +343,6 @@ public class ColumnDefinition {
if (type.isTimeLikeType()) {
throw new AnalysisException("Time type is not supported for olap table");
}
if (type.isObjectType()) {
if (!type.isBitmapType()) {
if (keysType != KeysType.AGG_KEYS) {
throw new AnalysisException("column:" + name + " must be used in AGG_KEYS.");
}
}
}
}
/**