[refactor](type) AggStateType should not extends ScalarType (#34463)

1. let AggStateType extends Type
2. remove useless interface isFixedLengthType and supportsTablePartitioning
3. let MapType implement interface isSupported
4. let VariantType extends ScalarType
This commit is contained in:
morrySnow
2024-05-09 10:51:41 +08:00
committed by yiguolei
parent 853dbdcb00
commit 9a94681b29
10 changed files with 78 additions and 116 deletions

View File

@ -1922,11 +1922,11 @@ public abstract class Expr extends TreeNode<Expr> implements ParseNode, Cloneabl
f.setNullableMode(NullableMode.ALWAYS_NOT_NULLABLE);
} else {
Function original = f;
f = ((AggregateFunction) f).clone();
f = f.clone();
f.setArgs(argList);
if (isUnion) {
f.setName(new FunctionName(name + AGG_UNION_SUFFIX));
f.setReturnType((ScalarType) argList.get(0));
f.setReturnType(argList.get(0));
f.setNullableMode(NullableMode.ALWAYS_NOT_NULLABLE);
}
if (isMerge) {

View File

@ -78,7 +78,7 @@ public class AggStateType extends DataType {
@Override
public Type toCatalogDataType() {
List<Type> types = subTypes.stream().map(t -> t.toCatalogDataType()).collect(Collectors.toList());
List<Type> types = subTypes.stream().map(DataType::toCatalogDataType).collect(Collectors.toList());
return Expr.createAggStateType(functionName, types, subTypeNullables);
}