Skip to content

Commit e346ac9

Browse files
committed
[chore](function) remove useless function set
1 parent fdef535 commit e346ac9

39 files changed

+25
-8316
lines changed

fe/fe-common/src/main/java/org/apache/doris/catalog/ArrayType.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import com.google.common.collect.Lists;
2828
import com.google.gson.annotations.SerializedName;
2929

30-
import java.util.Map;
3130
import java.util.Objects;
3231

3332
/**
@@ -95,31 +94,6 @@ public boolean matchesType(Type t) {
9594
return itemType.matchesType(((ArrayType) t).itemType);
9695
}
9796

98-
@Override
99-
public boolean hasTemplateType() {
100-
return itemType.hasTemplateType();
101-
}
102-
103-
@Override
104-
public Type specializeTemplateType(Type specificType, Map<String, Type> specializedTypeMap,
105-
boolean useSpecializedType, boolean enableDecimal256) throws TypeException {
106-
ArrayType specificArrayType = null;
107-
if (specificType instanceof ArrayType) {
108-
specificArrayType = (ArrayType) specificType;
109-
} else if (!useSpecializedType) {
110-
throw new TypeException(specificType + " is not ArrayType");
111-
}
112-
113-
Type newItemType = itemType;
114-
if (itemType.hasTemplateType()) {
115-
newItemType = itemType.specializeTemplateType(
116-
specificArrayType != null ? specificArrayType.itemType : specificType,
117-
specializedTypeMap, useSpecializedType, enableDecimal256);
118-
}
119-
120-
return new ArrayType(newItemType);
121-
}
122-
12397
public static ArrayType create() {
12498
return new ArrayType();
12599
}
@@ -153,16 +127,6 @@ public boolean equals(Object other) {
153127
return otherArrayType.itemType.equals(itemType) && otherArrayType.containsNull == containsNull;
154128
}
155129

156-
public static boolean canCastTo(ArrayType type, ArrayType targetType) {
157-
if (!targetType.containsNull && type.containsNull) {
158-
return false;
159-
}
160-
if (targetType.getItemType().isStringType() && type.getItemType().isStringType()) {
161-
return true;
162-
}
163-
return Type.canCastTo(type.getItemType(), targetType.getItemType());
164-
}
165-
166130
public static Type getAssignmentCompatibleType(
167131
ArrayType t1, ArrayType t2, boolean strict, boolean enableDecimal256) {
168132
Type itemCompatibleType = Type.getAssignmentCompatibleType(t1.getItemType(), t2.getItemType(), strict,

fe/fe-common/src/main/java/org/apache/doris/catalog/MapType.java

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import com.google.common.collect.Lists;
2828
import com.google.gson.annotations.SerializedName;
2929

30-
import java.util.Map;
3130
import java.util.Objects;
3231

3332
/**
@@ -137,43 +136,6 @@ public boolean matchesType(Type t) {
137136
&& (valueType.matchesType(((MapType) t).valueType));
138137
}
139138

140-
@Override
141-
public boolean hasTemplateType() {
142-
return keyType.hasTemplateType() || valueType.hasTemplateType();
143-
}
144-
145-
@Override
146-
public Type specializeTemplateType(Type specificType, Map<String, Type> specializedTypeMap,
147-
boolean useSpecializedType, boolean enableDecimal256) throws TypeException {
148-
MapType specificMapType = null;
149-
if (specificType instanceof MapType) {
150-
specificMapType = (MapType) specificType;
151-
} else if (!useSpecializedType) {
152-
throw new TypeException(specificType + " is not MapType");
153-
}
154-
155-
Type newKeyType = keyType;
156-
if (keyType.hasTemplateType()) {
157-
newKeyType = keyType.specializeTemplateType(
158-
specificMapType != null ? specificMapType.keyType : specificType,
159-
specializedTypeMap, useSpecializedType, enableDecimal256);
160-
}
161-
Type newValueType = valueType;
162-
if (valueType.hasTemplateType()) {
163-
newValueType = valueType.specializeTemplateType(
164-
specificMapType != null ? specificMapType.valueType : specificType,
165-
specializedTypeMap, useSpecializedType, enableDecimal256);
166-
}
167-
168-
Type newMapType = new MapType(newKeyType, newValueType);
169-
if (Type.canCastTo(specificType, newMapType)
170-
|| (useSpecializedType && !(specificType instanceof MapType))) {
171-
return newMapType;
172-
} else {
173-
throw new TypeException(specificType + " can not cast to specialize type " + newMapType);
174-
}
175-
}
176-
177139
@Override
178140
public String toString() {
179141
return String.format("map<%s,%s>",
@@ -193,13 +155,6 @@ protected String prettyPrint(int lpad) {
193155
return String.format("%sMAP<%s,%s>", leftPadding, keyType.toSql(), structStr);
194156
}
195157

196-
public static boolean canCastTo(MapType type, MapType targetType) {
197-
return (targetType.getKeyType().isStringType() && type.getKeyType().isStringType()
198-
|| Type.canCastTo(type.getKeyType(), targetType.getKeyType()))
199-
&& (Type.canCastTo(type.getValueType(), targetType.getValueType())
200-
|| targetType.getValueType().isStringType() && type.getValueType().isStringType());
201-
}
202-
203158
public static Type getAssignmentCompatibleType(MapType t1, MapType t2, boolean strict, boolean enableDecimal256) {
204159
Type keyCompatibleType = Type.getAssignmentCompatibleType(t1.getKeyType(), t2.getKeyType(), strict,
205160
enableDecimal256);

0 commit comments

Comments
 (0)