This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 57e9134cbb6 branch-4.0: [chore](type) remove some useless code #57419 
(#57510)
57e9134cbb6 is described below

commit 57e9134cbb609f83d5738296991777f305d06c48
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Oct 31 09:24:04 2025 +0800

    branch-4.0: [chore](type) remove some useless code #57419 (#57510)
    
    Cherry-picked from #57419
    
    Co-authored-by: morrySnow <[email protected]>
---
 .../java/org/apache/doris/catalog/ScalarType.java  |  62 -----
 .../main/java/org/apache/doris/catalog/Type.java   | 282 +--------------------
 .../org/apache/doris/analysis/BinaryPredicate.java |  49 ----
 .../java/org/apache/doris/analysis/CastExpr.java   |  74 ------
 .../apache/doris/analysis/CompoundPredicate.java   |  35 ---
 .../main/java/org/apache/doris/analysis/Expr.java  |  22 --
 .../org/apache/doris/analysis/InPredicate.java     |  27 --
 .../org/apache/doris/analysis/IsNullPredicate.java |  16 --
 .../java/org/apache/doris/analysis/SlotRef.java    |  23 --
 .../org/apache/doris/analysis/TryCastExpr.java     |   5 -
 .../org/apache/doris/analysis/VariableExpr.java    |  22 --
 .../org/apache/doris/catalog/AliasFunction.java    | 130 ----------
 .../java/org/apache/doris/catalog/FunctionSet.java |   1 -
 .../glue/translator/RunTimeFilterTranslatorV2.java |   2 +-
 .../glue/translator/RuntimeFilterTranslator.java   |   2 +-
 .../java/org/apache/doris/catalog/TypeTest.java    |  24 +-
 16 files changed, 15 insertions(+), 761 deletions(-)

diff --git 
a/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java 
b/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java
index c9b3f441a3a..ad888a087dd 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/catalog/ScalarType.java
@@ -959,51 +959,6 @@ public class ScalarType extends Type {
         return true;
     }
 
-    /**
-     * Returns the smallest decimal type that can safely store this type. 
Returns
-     * INVALID if this type cannot be stored as a decimal.
-     */
-    public ScalarType getMinResolutionDecimal() {
-        switch (type) {
-            case NULL_TYPE:
-                return Type.NULL;
-            case DECIMALV2:
-                return this;
-            case TINYINT:
-                return createDecimalType(3);
-            case SMALLINT:
-                return createDecimalType(5);
-            case INT:
-                return createDecimalType(10);
-            case BIGINT:
-                return createDecimalType(19);
-            case FLOAT:
-                return createDecimalTypeInternal(MAX_DECIMAL128_PRECISION, 9, 
false);
-            case DOUBLE:
-                return createDecimalTypeInternal(MAX_DECIMAL128_PRECISION, 17, 
false);
-            default:
-                return ScalarType.INVALID;
-        }
-    }
-
-    /**
-     * Returns true if this decimal type is a supertype of the other decimal 
type.
-     * e.g. (10,3) is a supertype of (3,3) but (5,4) is not a supertype of 
(3,0).
-     * To be a super type of another decimal, the number of digits before and 
after
-     * the decimal point must be greater or equal.
-     */
-    public boolean isSupertypeOf(ScalarType o) {
-        Preconditions.checkState(isDecimalV2() || isDecimalV3());
-        Preconditions.checkState(o.isDecimalV2() || o.isDecimalV3());
-        if (isWildcardDecimal()) {
-            return true;
-        }
-        if (o.isWildcardDecimal()) {
-            return false;
-        }
-        return scale >= o.scale && precision - scale >= o.precision - o.scale;
-    }
-
     /**
      * Return type t such that values from both t1 and t2 can be assigned to t.
      * If strict, only return types when there will be no loss of precision.
@@ -1182,13 +1137,6 @@ public class ScalarType extends Type {
                 targetPrecision, targetScale);
     }
 
-    public static ScalarType getAssignmentCompatibleDecimalV3Type(ScalarType 
t1, ScalarType t2) {
-        int targetScale = Math.max(t1.decimalScale(), t2.decimalScale());
-        int targetPrecision = Math.max(t1.decimalPrecision() - 
t1.decimalScale(), t2.decimalPrecision()
-                - t2.decimalScale()) + targetScale;
-        return ScalarType.createDecimalV3Type(targetPrecision, targetScale);
-    }
-
     /**
      * Returns true t1 can be implicitly cast to t2, false otherwise.
      * If strict is true, only consider casts that result in no loss of 
precision.
@@ -1202,16 +1150,6 @@ public class ScalarType extends Type {
         return PrimitiveType.isImplicitCast(type.getPrimitiveType(), 
targetType.getPrimitiveType());
     }
 
-    /**
-     * Decimal default precision is 9 and scale is 0, this method return 
whether this is
-     * default decimal v3 or v2
-     */
-    public boolean isDefaultDecimal() {
-        return (isDecimalV3() || isDecimalV2())
-                && DEFAULT_PRECISION == this.precision
-                && DEFAULT_SCALE == this.scale;
-    }
-
     @Override
     public TColumnType toColumnTypeThrift() {
         TColumnType thrift = new TColumnType();
diff --git a/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java 
b/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
index 8f17f85e089..a932172e24d 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
@@ -1328,42 +1328,6 @@ public abstract class Type {
         }
     }
 
-    /**
-     * JDBC data type description
-     * For numeric data types, either 10 or 2. If it is 10, the values in 
COLUMN_SIZE
-     * and DECIMAL_DIGITS give the number of decimal digits allowed for the 
column.
-     * For example, a DECIMAL(12,5) column would return a NUM_PREC_RADIX of 10,
-     * a COLUMN_SIZE of 12, and a DECIMAL_DIGITS of 5; a FLOAT column could 
return
-     * a NUM_PREC_RADIX of 10, a COLUMN_SIZE of 15, and a DECIMAL_DIGITS of 
NULL.
-     * If it is 2, the values in COLUMN_SIZE and DECIMAL_DIGITS give the 
number of bits
-     * allowed in the column. For example, a FLOAT column could return a RADIX 
of 2,
-     * a COLUMN_SIZE of 53, and a DECIMAL_DIGITS of NULL. NULL is returned for 
data
-     * types where NUM_PREC_RADIX is not applicable.
-     */
-    public Integer getNumPrecRadix() {
-        if (!isScalarType()) {
-            return null;
-        }
-        ScalarType t = (ScalarType) this;
-        switch (t.getPrimitiveType()) {
-            case TINYINT:
-            case SMALLINT:
-            case INT:
-            case BIGINT:
-            case FLOAT:
-            case DOUBLE:
-            case DECIMALV2:
-            case DECIMAL32:
-            case DECIMAL64:
-            case DECIMAL128:
-            case DECIMAL256:
-                return 10;
-            default:
-                // everything else (including boolean and string) is null
-                return null;
-        }
-    }
-
     /**
      * Matrix that records "smallest" assignment-compatible type of two types
      * (INVALID_TYPE if no such type exists, ie, if the input types are 
fundamentally
@@ -2031,246 +1995,6 @@ public abstract class Type {
         }
     }
 
-    public Type getResultType() {
-        switch (this.getPrimitiveType()) {
-            case BOOLEAN:
-            case TINYINT:
-            case SMALLINT:
-            case INT:
-            case BIGINT:
-                return BIGINT;
-            case LARGEINT:
-                return LARGEINT;
-            case FLOAT:
-            case DOUBLE:
-                return DOUBLE;
-            case DATE:
-            case DATEV2:
-            case DATETIME:
-            case DATETIMEV2:
-            case TIMEV2:
-            case CHAR:
-            case VARCHAR:
-            case HLL:
-            case BITMAP:
-            case QUANTILE_STATE:
-                return VARCHAR;
-            case IPV4:
-                return IPV4;
-            case IPV6:
-                return IPV6;
-            case DECIMALV2:
-                return DECIMALV2;
-            case DECIMAL32:
-                return DECIMAL32;
-            case DECIMAL64:
-                return DECIMAL64;
-            case DECIMAL128:
-                return DECIMAL128;
-            case DECIMAL256:
-                return DECIMAL256;
-            case STRING:
-                return STRING;
-            case JSONB:
-                return JSONB;
-            case VARIANT:
-                return VARIANT;
-            default:
-                return INVALID;
-
-        }
-    }
-
-    public static Type getCmpType(Type t1, Type t2, boolean enableDecimal256) {
-        if (t1.getPrimitiveType() == PrimitiveType.NULL_TYPE) {
-            return t2;
-        }
-        if (t2.getPrimitiveType() == PrimitiveType.NULL_TYPE) {
-            return t1;
-        }
-
-        PrimitiveType t1ResultType = t1.getResultType().getPrimitiveType();
-        PrimitiveType t2ResultType = t2.getResultType().getPrimitiveType();
-        if (canCompareDate(t1.getPrimitiveType(), t2.getPrimitiveType())) {
-            return getDateComparisonResultType((ScalarType) t1, (ScalarType) 
t2);
-        }
-
-        // Following logical is compatible with MySQL.
-        if (t1ResultType == PrimitiveType.VARCHAR && t2ResultType == 
PrimitiveType.VARCHAR) {
-            return Type.VARCHAR;
-        }
-        if ((t1ResultType == PrimitiveType.STRING && t2ResultType == 
PrimitiveType.STRING)
-                || (t1ResultType == PrimitiveType.STRING && t2ResultType == 
PrimitiveType.VARCHAR)
-                || (t1ResultType == PrimitiveType.VARCHAR && t2ResultType == 
PrimitiveType.STRING)) {
-            return Type.STRING;
-        }
-        // TODO(wzy): support NUMERIC/CHAR cast to JSONB
-        if (t1ResultType == PrimitiveType.JSONB && t2ResultType == 
PrimitiveType.JSONB) {
-            return Type.JSONB;
-        }
-        if ((t1ResultType == PrimitiveType.JSONB && t2ResultType == 
PrimitiveType.VARCHAR)
-                || (t1ResultType == PrimitiveType.VARCHAR && t2ResultType == 
PrimitiveType.JSONB)) {
-            return Type.VARCHAR;
-        }
-        if ((t1ResultType == PrimitiveType.JSONB && t2ResultType == 
PrimitiveType.STRING)
-                || (t1ResultType == PrimitiveType.STRING && t2ResultType == 
PrimitiveType.JSONB)) {
-            return Type.STRING;
-        }
-
-        // VARIANT
-        if (t1ResultType == PrimitiveType.VARIANT && t2ResultType == 
PrimitiveType.VARIANT) {
-            return Type.VARIANT;
-        }
-        if ((t1ResultType == PrimitiveType.VARIANT && t2ResultType == 
PrimitiveType.VARCHAR)
-                || (t1ResultType == PrimitiveType.VARCHAR && t2ResultType == 
PrimitiveType.VARIANT)) {
-            return Type.VARCHAR;
-        }
-        if ((t1ResultType == PrimitiveType.VARIANT && t2ResultType == 
PrimitiveType.STRING)
-                || (t1ResultType == PrimitiveType.STRING && t2ResultType == 
PrimitiveType.VARIANT)) {
-            return Type.STRING;
-        }
-
-        // int family type and char family type should cast to char family type
-        if ((t1.getPrimitiveType().isFixedPointType() && 
t2.getPrimitiveType().isCharFamily())
-                || (t2.getPrimitiveType().isFixedPointType() && 
t1.getPrimitiveType().isCharFamily())) {
-            return Type.VARCHAR;
-        }
-
-        if (t1ResultType == PrimitiveType.BIGINT && t2ResultType == 
PrimitiveType.BIGINT) {
-            return getAssignmentCompatibleType(t1, t2, false, 
enableDecimal256);
-        }
-        if (t1.getPrimitiveType().isDecimalV3Type() && 
t2.getPrimitiveType().isDecimalV3Type()) {
-            int resultPrecision = Math.max(t1.getPrecision(), 
t2.getPrecision());
-            PrimitiveType resultDecimalType;
-            if (resultPrecision <= ScalarType.MAX_DECIMAL32_PRECISION) {
-                resultDecimalType = PrimitiveType.DECIMAL32;
-            } else if (resultPrecision <= ScalarType.MAX_DECIMAL64_PRECISION) {
-                resultDecimalType = PrimitiveType.DECIMAL64;
-            } else {
-                resultDecimalType = PrimitiveType.DECIMAL128;
-            }
-            if (resultPrecision <= ScalarType.MAX_DECIMAL128_PRECISION) {
-                return ScalarType.createDecimalType(resultDecimalType, 
resultPrecision, Math.max(
-                        ((ScalarType) t1).getScalarScale(), ((ScalarType) 
t2).getScalarScale()));
-            } else {
-                if (enableDecimal256) {
-                    return ScalarType.createDecimalType(resultDecimalType, 
resultPrecision, Math.max(
-                            ((ScalarType) t1).getScalarScale(), ((ScalarType) 
t2).getScalarScale()));
-                } else {
-                    return Type.DOUBLE;
-                }
-            }
-        }
-        if (t1ResultType.isDecimalV3Type() || t2ResultType.isDecimalV3Type()) {
-            return getAssignmentCompatibleType(t1, t2, false, 
enableDecimal256);
-        }
-        if ((t1ResultType == PrimitiveType.BIGINT
-                || t1ResultType == PrimitiveType.DECIMALV2)
-                && (t2ResultType == PrimitiveType.BIGINT
-                || t2ResultType == PrimitiveType.DECIMALV2)) {
-            return Type.DECIMALV2;
-        }
-        if ((t1ResultType == PrimitiveType.BIGINT
-                || t1ResultType == PrimitiveType.LARGEINT)
-                && (t2ResultType == PrimitiveType.BIGINT
-                || t2ResultType == PrimitiveType.LARGEINT)) {
-            return Type.LARGEINT;
-        }
-        if ((t1ResultType == PrimitiveType.IPV4
-                || t1ResultType == PrimitiveType.VARCHAR)
-                && (t2ResultType == PrimitiveType.IPV4
-                || t2ResultType == PrimitiveType.VARCHAR)) {
-            return Type.IPV4;
-        }
-        if ((t1ResultType == PrimitiveType.IPV6
-                || t1ResultType == PrimitiveType.VARCHAR)
-                && (t2ResultType == PrimitiveType.IPV6
-                || t2ResultType == PrimitiveType.VARCHAR)) {
-            return Type.IPV6;
-        }
-        return Type.DOUBLE;
-    }
-
-    private static boolean canCompareDate(PrimitiveType t1, PrimitiveType t2) {
-        if (t1.isDateType()) {
-            if (t2.isDateType() || t2.isStringType() || t2.isIntegerType()) {
-                return true;
-            }
-            return false;
-        } else if (t2.isDateType()) {
-            if (t1.isStringType() || t1.isIntegerType()) {
-                return true;
-            }
-            return false;
-        } else {
-            return false;
-        }
-    }
-
-    private static Type getDateComparisonResultType(ScalarType t1, ScalarType 
t2) {
-        if (t1.isDate() && t2.isDate()) {
-            return Type.DATE;
-        } else if ((t1.isDateV2() && t2.isDate()) || t1.isDate() && 
t2.isDateV2()) {
-            return Type.DATEV2;
-        } else if (t1.isDateV2() && t2.isDateV2()) {
-            return Type.DATEV2;
-        } else if (t1.isDatetime() && t2.isDatetime()) {
-            return Type.DATETIME;
-        } else if (t1.isDatetime() && t2.isDatetimeV2()) {
-            return t2;
-        } else if (t1.isDatetimeV2() && t2.isDatetime()) {
-            return t1;
-        } else if (t1.isDatetimeV2() && t2.isDatetimeV2()) {
-            return t1.decimalScale() > t2.decimalScale() ? t1 : t2;
-        } else if (t1.isDatetimeV2()) {
-            return t1;
-        } else if (t2.isDatetimeV2()) {
-            return t2;
-        } else if (t2.isDateV2() || t1.isDateV2()) {
-            return Type.DATETIMEV2;
-        } else {
-            return Type.DATETIME;
-        }
-    }
-
-    public Type getNumResultType() {
-        switch (getPrimitiveType()) {
-            case BOOLEAN:
-            case TINYINT:
-            case SMALLINT:
-            case INT:
-            case BIGINT:
-            case DATE:
-            case DATEV2:
-            case DATETIME:
-            case DATETIMEV2:
-                return Type.BIGINT;
-            case LARGEINT:
-                return Type.LARGEINT;
-            case FLOAT:
-            case DOUBLE:
-            case TIMEV2:
-            case CHAR:
-            case VARCHAR:
-            case STRING:
-            case HLL:
-                return Type.DOUBLE;
-            case DECIMALV2:
-                return Type.DECIMALV2;
-            case DECIMAL32:
-                return Type.DECIMAL32;
-            case DECIMAL64:
-                return Type.DECIMAL64;
-            case DECIMAL128:
-                return Type.DECIMAL128;
-            case DECIMAL256:
-                return Type.DECIMAL256;
-            default:
-                return Type.INVALID;
-
-        }
-    }
-
     public int getIndexSize() {
         if (this.getPrimitiveType() == PrimitiveType.CHAR) {
             return this.getLength();
@@ -2279,11 +2003,7 @@ public abstract class Type {
         }
     }
 
-    // Whether `type1` matches the exact type of `type2`.
-    public static boolean matchExactType(Type type1, Type type2) {
-        return matchExactType(type1, type2, false);
-    }
-
+    // only use for cast to generate no op
     public static boolean matchExactType(Type type1, Type type2, boolean 
ignorePrecision) {
         // we should make type decide to match other for itself to impl 
matchesType instead of switch case types
         if (type1.matchesType(type2)) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
index 0bac931595c..3b37b83f6a8 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
@@ -27,7 +27,6 @@ import org.apache.doris.catalog.ScalarFunction;
 import org.apache.doris.catalog.TableIf;
 import org.apache.doris.catalog.TableIf.TableType;
 import org.apache.doris.catalog.Type;
-import org.apache.doris.common.AnalysisException;
 import org.apache.doris.common.Pair;
 import org.apache.doris.common.Reference;
 import org.apache.doris.thrift.TExprNode;
@@ -412,54 +411,6 @@ public class BinaryPredicate extends Predicate {
         }
     }
 
-    @Override
-    public Expr getResultValue(boolean forPushDownPredicatesToView) throws 
AnalysisException {
-        recursiveResetChildrenResult(forPushDownPredicatesToView);
-        final Expr leftChildValue = getChild(0);
-        final Expr rightChildValue = getChild(1);
-        if (!(leftChildValue instanceof LiteralExpr)
-                || !(rightChildValue instanceof LiteralExpr)) {
-            return this;
-        }
-        return compareLiteral((LiteralExpr) leftChildValue, (LiteralExpr) 
rightChildValue);
-    }
-
-    private Expr compareLiteral(LiteralExpr first, LiteralExpr second) {
-        final boolean isFirstNull = (first instanceof NullLiteral);
-        final boolean isSecondNull = (second instanceof NullLiteral);
-        if (op == Operator.EQ_FOR_NULL) {
-            if (isFirstNull && isSecondNull) {
-                return new BoolLiteral(true);
-            } else if (isFirstNull || isSecondNull) {
-                return new BoolLiteral(false);
-            }
-        } else  {
-            if (isFirstNull || isSecondNull) {
-                return new NullLiteral();
-            }
-        }
-
-        final int compareResult = first.compareLiteral(second);
-        switch (op) {
-            case EQ:
-            case EQ_FOR_NULL:
-                return new BoolLiteral(compareResult == 0);
-            case GE:
-                return new BoolLiteral(compareResult >= 0);
-            case GT:
-                return new BoolLiteral(compareResult > 0);
-            case LE:
-                return new BoolLiteral(compareResult <= 0);
-            case LT:
-                return new BoolLiteral(compareResult < 0);
-            case NE:
-                return new BoolLiteral(compareResult != 0);
-            default:
-                Preconditions.checkState(false, "No defined binary operator.");
-        }
-        return this;
-    }
-
     @Override
     public void setSelectivity() {
         switch (op) {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java
index c1ca5b735cc..e25864a8795 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java
@@ -168,17 +168,6 @@ public class CastExpr extends Expr {
         analysisDone();
     }
 
-    /**
-     * Copy c'tor used in clone().
-     */
-    public CastExpr(TypeDef targetTypeDef, Expr e) {
-        Preconditions.checkNotNull(targetTypeDef);
-        Preconditions.checkNotNull(e);
-        this.targetTypeDef = targetTypeDef;
-        isImplicit = false;
-        children.add(e);
-    }
-
     protected CastExpr(CastExpr other) {
         super(other);
         targetTypeDef = other.targetTypeDef;
@@ -190,10 +179,6 @@ public class CastExpr extends Expr {
         return "castTo" + targetType.getPrimitiveType().toString();
     }
 
-    public TypeDef getTargetTypeDef() {
-        return targetTypeDef;
-    }
-
     public static void initBuiltins(FunctionSet functionSet) {
         for (Type fromType : Type.getTrivialTypes()) {
             if (fromType.isNull()) {
@@ -389,65 +374,6 @@ public class CastExpr extends Expr {
         return false;
     }
 
-    @Override
-    public Expr getResultValue(boolean forPushDownPredicatesToView) throws 
AnalysisException {
-        recursiveResetChildrenResult(forPushDownPredicatesToView);
-        final Expr value = children.get(0);
-        if (!(value instanceof LiteralExpr)) {
-            return this;
-        }
-        Expr targetExpr;
-        try {
-            targetExpr = castTo((LiteralExpr) value);
-            if (targetTypeDef != null) {
-                targetExpr.setType(targetTypeDef.getType());
-            } else {
-                targetExpr.setType(type);
-            }
-        } catch (AnalysisException ae) {
-            if (ConnectContext.get() != null) {
-                ConnectContext.get().getState().reset();
-            }
-            targetExpr = this;
-        } catch (NumberFormatException nfe) {
-            targetExpr = new NullLiteral();
-        }
-        return targetExpr;
-    }
-
-    private Expr castTo(LiteralExpr value) throws AnalysisException {
-        if (value instanceof NullLiteral) {
-            if (targetTypeDef != null) {
-                return NullLiteral.create(targetTypeDef.getType());
-            } else {
-                return NullLiteral.create(type);
-            }
-        } else if (type.isIntegerType()) {
-            return new IntLiteral(value.getLongValue(), type);
-        } else if (type.isLargeIntType()) {
-            return new LargeIntLiteral(value.getStringValue());
-        } else if (type.isDecimalV2() || type.isDecimalV3()) {
-            if (targetTypeDef != null) {
-                DecimalLiteral literal = new 
DecimalLiteral(value.getStringValue(),
-                        ((ScalarType) 
targetTypeDef.getType()).getScalarScale());
-                
literal.checkPrecisionAndScale(targetTypeDef.getType().getPrecision(),
-                        ((ScalarType) 
targetTypeDef.getType()).getScalarScale());
-                return literal;
-            } else {
-                return new DecimalLiteral(value.getStringValue());
-            }
-        } else if (type.isFloatingPointType()) {
-            return new FloatLiteral(value.getDoubleValue(), type);
-        } else if (type.isStringType()) {
-            return new StringLiteral(value.getStringValue());
-        } else if (type.isDateType()) {
-            return new 
StringLiteral(value.getStringValue()).convertToDate(type);
-        } else if (type.isBoolean()) {
-            return new BoolLiteral(value.getStringValue());
-        }
-        return this;
-    }
-
     @Override
     public boolean isNullable() {
         return children.get(0).isNullable()
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/CompoundPredicate.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/CompoundPredicate.java
index 9536a1dca13..43b99e4cf25 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/CompoundPredicate.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/CompoundPredicate.java
@@ -25,7 +25,6 @@ import org.apache.doris.catalog.ScalarFunction;
 import org.apache.doris.catalog.TableIf;
 import org.apache.doris.catalog.TableIf.TableType;
 import org.apache.doris.catalog.Type;
-import org.apache.doris.common.AnalysisException;
 import org.apache.doris.thrift.TExprNode;
 import org.apache.doris.thrift.TExprNodeType;
 import org.apache.doris.thrift.TExprOpcode;
@@ -165,40 +164,6 @@ public class CompoundPredicate extends Predicate {
         return new CompoundPredicate(newOp, negatedLeft, negatedRight);
     }
 
-    @Override
-    public Expr getResultValue(boolean forPushDownPredicatesToView) throws 
AnalysisException {
-        recursiveResetChildrenResult(forPushDownPredicatesToView);
-        boolean compoundResult = false;
-        if (op == Operator.NOT) {
-            final Expr childValue = getChild(0);
-            if (!(childValue instanceof BoolLiteral)) {
-                return this;
-            }
-            final BoolLiteral boolChild = (BoolLiteral) childValue;
-            compoundResult = !boolChild.getValue();
-        } else {
-            final Expr leftChildValue = getChild(0);
-            final Expr rightChildValue = getChild(1);
-            if (!(leftChildValue instanceof BoolLiteral)
-                    || !(rightChildValue instanceof BoolLiteral)) {
-                return this;
-            }
-            final BoolLiteral leftBoolValue = (BoolLiteral) leftChildValue;
-            final BoolLiteral rightBoolValue = (BoolLiteral) rightChildValue;
-            switch (op) {
-                case AND:
-                    compoundResult = leftBoolValue.getValue() && 
rightBoolValue.getValue();
-                    break;
-                case OR:
-                    compoundResult = leftBoolValue.getValue() || 
rightBoolValue.getValue();
-                    break;
-                default:
-                    Preconditions.checkState(false, "No defined binary 
operator.");
-            }
-        }
-        return new BoolLiteral(compoundResult);
-    }
-
     @Override
     public int hashCode() {
         return 31 * super.hashCode() + Objects.hashCode(op);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
index 35bc01dc8d2..9f6a2c706d1 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
@@ -1271,28 +1271,6 @@ public abstract class Expr extends TreeNode<Expr> 
implements Cloneable, ExprStat
         return true;
     }
 
-
-    protected void recursiveResetChildrenResult(boolean 
forPushDownPredicatesToView) throws AnalysisException {
-        for (int i = 0; i < children.size(); i++) {
-            final Expr child = children.get(i);
-            final Expr newChild = 
child.getResultValue(forPushDownPredicatesToView);
-            if (newChild != child) {
-                setChild(i, newChild);
-            }
-        }
-    }
-
-    /**
-     * For calculating expr.
-     * @return value returned can't be null, if this and it's children are't 
constant expr, return this.
-     * @throws AnalysisException
-     */
-    public Expr getResultValue(boolean forPushDownPredicatesToView) throws 
AnalysisException {
-        recursiveResetChildrenResult(forPushDownPredicatesToView);
-        final Expr newExpr = ExpressionFunctions.INSTANCE.evalExpr(this);
-        return newExpr != null ? newExpr : this;
-    }
-
     public String getStringValue() {
         return "";
     }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/InPredicate.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/InPredicate.java
index 74d857d9345..d3904459d96 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/InPredicate.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/InPredicate.java
@@ -28,7 +28,6 @@ import org.apache.doris.catalog.ScalarFunction;
 import org.apache.doris.catalog.TableIf;
 import org.apache.doris.catalog.TableIf.TableType;
 import org.apache.doris.catalog.Type;
-import org.apache.doris.common.AnalysisException;
 import org.apache.doris.thrift.TExprNode;
 import org.apache.doris.thrift.TExprNodeType;
 import org.apache.doris.thrift.TExprOpcode;
@@ -240,32 +239,6 @@ public class InPredicate extends Predicate {
         return toSql();
     }
 
-    @Override
-    public Expr getResultValue(boolean forPushDownPredicatesToView) throws 
AnalysisException {
-        recursiveResetChildrenResult(forPushDownPredicatesToView);
-        final Expr leftChildValue = getChild(0);
-        if (!(leftChildValue instanceof LiteralExpr) || !isLiteralChildren()) {
-            return this;
-        }
-
-        if (leftChildValue instanceof NullLiteral) {
-            return leftChildValue;
-        }
-
-        List<Expr> inListChildren = children.subList(1, children.size());
-        boolean containsLeftChild = inListChildren.contains(leftChildValue);
-
-        // See QueryPlanTest.java testConstantInPredicate() for examples.
-        // This logic should be same as logic in in_predicate.cpp: 
get_boolean_val()
-        if (containsLeftChild) {
-            return new BoolLiteral(!isNotIn);
-        }
-        if (inListChildren.contains(NULL_LITERAL)) {
-            return new NullLiteral();
-        }
-        return new BoolLiteral(isNotIn);
-    }
-
     @Override
     public boolean equals(Object obj) {
         if (super.equals(obj)) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/IsNullPredicate.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/IsNullPredicate.java
index df7f34509a1..145e8debc24 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/IsNullPredicate.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/IsNullPredicate.java
@@ -27,7 +27,6 @@ import org.apache.doris.catalog.ScalarFunction;
 import org.apache.doris.catalog.TableIf;
 import org.apache.doris.catalog.TableIf.TableType;
 import org.apache.doris.catalog.Type;
-import org.apache.doris.common.AnalysisException;
 import org.apache.doris.thrift.TExprNode;
 import org.apache.doris.thrift.TExprNodeType;
 
@@ -147,19 +146,4 @@ public class IsNullPredicate extends Predicate {
     public boolean isNullable() {
         return false;
     }
-
-    /**
-     * fix issue 6390
-     */
-    @Override
-    public Expr getResultValue(boolean forPushDownPredicatesToView) throws 
AnalysisException {
-        // Don't push down predicate to view for is null predicate because the 
value can contain null
-        // after outer join
-        recursiveResetChildrenResult(!forPushDownPredicatesToView);
-        final Expr childValue = getChild(0);
-        if (forPushDownPredicatesToView || !(childValue instanceof 
LiteralExpr)) {
-            return this;
-        }
-        return childValue instanceof NullLiteral ? new BoolLiteral(!isNotNull) 
: new BoolLiteral(isNotNull);
-    }
 }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java
index 14e38db8582..0109ac66db5 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java
@@ -26,7 +26,6 @@ import org.apache.doris.catalog.OdbcTable;
 import org.apache.doris.catalog.TableIf;
 import org.apache.doris.catalog.TableIf.TableType;
 import org.apache.doris.catalog.Type;
-import org.apache.doris.common.AnalysisException;
 import org.apache.doris.common.util.ToSqlContext;
 import org.apache.doris.planner.normalize.Normalizer;
 import org.apache.doris.qe.ConnectContext;
@@ -508,26 +507,4 @@ public class SlotRef extends Expr {
         }
         return builder.toString();
     }
-
-    @Override
-    public Expr getResultValue(boolean forPushDownPredicatesToView) throws 
AnalysisException {
-        if (!forPushDownPredicatesToView) {
-            return this;
-        }
-        if (!isConstant() || desc == null) {
-            return this;
-        }
-        List<Expr> exprs = desc.getSourceExprs();
-        if (CollectionUtils.isEmpty(exprs)) {
-            return this;
-        }
-        Expr expr = exprs.get(0);
-        if (expr instanceof SlotRef) {
-            return expr.getResultValue(forPushDownPredicatesToView);
-        }
-        if (expr.isConstant()) {
-            return expr;
-        }
-        return this;
-    }
 }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/TryCastExpr.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/TryCastExpr.java
index e9f99765b57..6556ffa3e0d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/TryCastExpr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/TryCastExpr.java
@@ -41,11 +41,6 @@ public class TryCastExpr extends CastExpr {
         opcode = TExprOpcode.TRY_CAST;
     }
 
-    public TryCastExpr(TypeDef targetTypeDef, Expr e) {
-        super(targetTypeDef, e);
-        opcode = TExprOpcode.TRY_CAST;
-    }
-
     protected TryCastExpr(TryCastExpr other) {
         super(other);
         opcode = TExprOpcode.TRY_CAST;
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/VariableExpr.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/VariableExpr.java
index 9d712ea75c4..165def88e79 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/VariableExpr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/VariableExpr.java
@@ -19,9 +19,6 @@ package org.apache.doris.analysis;
 
 import org.apache.doris.catalog.TableIf;
 import org.apache.doris.catalog.TableIf.TableType;
-import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.DdlException;
-import org.apache.doris.qe.VariableVarConverters;
 import org.apache.doris.thrift.TBoolLiteral;
 import org.apache.doris.thrift.TExprNode;
 import org.apache.doris.thrift.TExprNodeType;
@@ -29,8 +26,6 @@ import org.apache.doris.thrift.TFloatLiteral;
 import org.apache.doris.thrift.TIntLiteral;
 import org.apache.doris.thrift.TStringLiteral;
 
-import com.google.common.base.Strings;
-
 import java.math.BigDecimal;
 import java.util.Objects;
 
@@ -118,23 +113,6 @@ public class VariableExpr extends Expr {
         return this.literalExpr;
     }
 
-    @Override
-    public Expr getResultValue(boolean forPushDownPredicatesToView) throws 
AnalysisException {
-        if (!Strings.isNullOrEmpty(name) && 
VariableVarConverters.hasConverter(name)) {
-            // Return the string type here so that it can correctly match the 
subsequent function signature.
-            // And we also set `beConverted` to session variable name in 
StringLiteral, so that it can be cast back
-            // to Integer when returning value.
-            try {
-                StringLiteral s = new 
StringLiteral(VariableVarConverters.decode(name, intValue));
-                s.setBeConverted(name);
-                return s;
-            } catch (DdlException e) {
-                throw new AnalysisException(e.getMessage());
-            }
-        }
-        return super.getResultValue(false);
-    }
-
     @Override
     protected boolean isConstantImpl() {
         return true;
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/catalog/AliasFunction.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/AliasFunction.java
index 84a2f8971e7..25137ae183a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/AliasFunction.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/AliasFunction.java
@@ -17,20 +17,11 @@
 
 package org.apache.doris.catalog;
 
-import org.apache.doris.analysis.CastExpr;
 import org.apache.doris.analysis.Expr;
-import org.apache.doris.analysis.FunctionCallExpr;
 import org.apache.doris.analysis.FunctionName;
-import org.apache.doris.analysis.FunctionParams;
-import org.apache.doris.analysis.IntLiteral;
 import org.apache.doris.analysis.SlotRef;
-import org.apache.doris.analysis.StringLiteral;
-import org.apache.doris.analysis.TypeDef;
-import org.apache.doris.common.AnalysisException;
 import org.apache.doris.thrift.TFunctionBinaryType;
 
-import com.google.common.base.Strings;
-import com.google.common.collect.Lists;
 import com.google.gson.Gson;
 import com.google.gson.annotations.SerializedName;
 import org.apache.logging.log4j.LogManager;
@@ -39,10 +30,8 @@ import org.apache.logging.log4j.Logger;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.stream.Collectors;
 
 /**
@@ -77,133 +66,14 @@ public class AliasFunction extends Function {
         return aliasFunction;
     }
 
-    public static void initBuiltins(FunctionSet functionSet) {
-
-        /**
-         * Please ensure that the condition checks in {@link #analyze} are 
satisfied
-         */
-        functionSet.addBuiltin(createBuiltin(DIGITAL_MASKING, 
Lists.newArrayList(Type.BIGINT), Type.VARCHAR,
-                false, Lists.newArrayList("id"), getConcatFunctionExpr(), 
true, false));
-
-        functionSet.addBuiltin(createBuiltin(DIGITAL_MASKING, 
Lists.newArrayList(Type.BIGINT), Type.VARCHAR,
-                false, Lists.newArrayList("id"), getConcatFunctionExpr(), 
true, true));
-
-    }
-
-    public static Expr getConcatFunctionExpr() {
-        // "concat(left(id,3),'****',right(id,4));";
-        FunctionCallExpr left = new FunctionCallExpr("left",
-                new FunctionParams(Lists.newArrayList(new SlotRef(null, "id"), 
new IntLiteral(3))));
-        FunctionCallExpr right = new FunctionCallExpr("right",
-                new FunctionParams(Lists.newArrayList(new SlotRef(null, "id"), 
new IntLiteral(4))));
-        return new FunctionCallExpr("concat",
-                new FunctionParams(Lists.newArrayList(left, new 
StringLiteral("****"), right)));
-    }
-
-    private static AliasFunction createBuiltin(String name, ArrayList<Type> 
argTypes, Type retType,
-            boolean hasVarArgs, List<String> parameters, Expr originFunction,
-            boolean userVisible, boolean isVectorized) {
-        AliasFunction aliasFunction = new AliasFunction(new 
FunctionName(name), argTypes, retType, hasVarArgs);
-        aliasFunction.setBinaryType(TFunctionBinaryType.BUILTIN);
-        aliasFunction.setUserVisible(userVisible);
-        aliasFunction.originFunction = originFunction;
-        aliasFunction.parameters = parameters;
-        return aliasFunction;
-    }
-
     public Expr getOriginFunction() {
         return originFunction;
     }
 
-    public void setOriginFunction(Expr originFunction) {
-        this.originFunction = originFunction;
-    }
-
     public List<String> getParameters() {
         return parameters;
     }
 
-    public void setParameters(List<String> parameters) {
-        this.parameters = parameters;
-    }
-
-    public void analyze() throws AnalysisException {
-        if (parameters.size() != getArgs().length) {
-            throw new AnalysisException(
-                    "Alias function [" + functionName() + "] args number is 
not equal to parameters number");
-        }
-        List<Expr> exprs;
-        if (originFunction instanceof FunctionCallExpr) {
-            exprs = ((FunctionCallExpr) originFunction).getFnParams().exprs();
-        } else if (originFunction instanceof CastExpr) {
-            exprs = originFunction.getChildren();
-            TypeDef targetTypeDef = ((CastExpr) 
originFunction).getTargetTypeDef();
-            if (targetTypeDef.getType().isScalarType()) {
-                ScalarType scalarType = (ScalarType) targetTypeDef.getType();
-                PrimitiveType primitiveType = scalarType.getPrimitiveType();
-                switch (primitiveType) {
-                    case DECIMAL32:
-                    case DECIMAL64:
-                    case DECIMAL128:
-                    case DECIMAL256:
-                    case DECIMALV2:
-                        if 
(!Strings.isNullOrEmpty(scalarType.getScalarPrecisionStr())) {
-                            
typeDefParams.add(scalarType.getScalarPrecisionStr());
-                        }
-                        if 
(!Strings.isNullOrEmpty(scalarType.getScalarScaleStr())) {
-                            typeDefParams.add(scalarType.getScalarScaleStr());
-                        }
-                        break;
-                    case CHAR:
-                    case VARCHAR:
-                        if (!Strings.isNullOrEmpty(scalarType.getLenStr())) {
-                            typeDefParams.add(scalarType.getLenStr());
-                        }
-                        break;
-                    default:
-                        throw new AnalysisException("Alias type is invalid: " 
+ primitiveType);
-                }
-            }
-        } else {
-            throw new AnalysisException("Not supported expr type: " + 
originFunction);
-        }
-        Set<String> set = new HashSet<>();
-        for (String str : parameters) {
-            if (!set.add(str)) {
-                throw new AnalysisException(
-                        "Alias function [" + functionName() + "] has duplicate 
parameter [" + str + "].");
-            }
-            boolean existFlag = false;
-            // check exprs
-            for (Expr expr : exprs) {
-                existFlag |= checkParams(expr, str);
-            }
-            // check targetTypeDef
-            for (String typeDefParam : typeDefParams) {
-                existFlag |= typeDefParam.equals(str);
-            }
-            if (!existFlag) {
-                throw new AnalysisException("Alias function [" + 
functionName() + "]  do not contain parameter [" + str
-                        + "]. typeDefParams="
-                        + 
typeDefParams.stream().map(String::toString).collect(Collectors.joining(", ")));
-            }
-        }
-    }
-
-    private boolean checkParams(Expr expr, String param) {
-        for (Expr e : expr.getChildren()) {
-            if (checkParams(e, param)) {
-                return true;
-            }
-        }
-        if (expr instanceof SlotRef) {
-            if (param.equals(((SlotRef) expr).getColumnName())) {
-                return true;
-            }
-        }
-        return false;
-    }
-
     @Override
     public String toSql(boolean ifNotExists) {
         setSlotRefLabel(originFunction);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java
index 82f87506d48..d8b23551795 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java
@@ -94,7 +94,6 @@ public class FunctionSet<T> {
         LikePredicate.initBuiltins(this);
         MatchPredicate.initBuiltins(this);
         InPredicate.initBuiltins(this);
-        AliasFunction.initBuiltins(this);
 
         // init table function
         initTableFunction();
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RunTimeFilterTranslatorV2.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RunTimeFilterTranslatorV2.java
index eb8f76125de..d3a9c7b09ca 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RunTimeFilterTranslatorV2.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RunTimeFilterTranslatorV2.java
@@ -94,7 +94,7 @@ public class RunTimeFilterTranslatorV2 {
         for (RuntimeFilterV2 filter : filters) {
             Expr targetExpr = filter.getLegacyTargetExpr();
             if (!srcExpr.getType().equals(targetExpr.getType())) {
-                targetExpr = new CastExpr(srcExpr.getType(), targetExpr);
+                targetExpr = new CastExpr(srcExpr.getType(), targetExpr, null);
             }
             targets.add(new RuntimeFilterTarget(filter.getLegacyTargetNode(), 
targetExpr));
         }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java
index dbce2bb0a73..bc35c83685d 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java
@@ -132,7 +132,7 @@ public class RuntimeFilterTranslator {
 
                 // adjust data type
                 if (!src.getType().equals(targetExpr.getType()) && 
filter.getType() != TRuntimeFilterType.BITMAP) {
-                    targetExpr = new CastExpr(src.getType(), targetExpr);
+                    targetExpr = new CastExpr(src.getType(), targetExpr, null);
                 }
                 TupleId targetTupleId = 
targetSlotRef.getDesc().getParent().getId();
                 SlotId targetSlotId = targetSlotRef.getSlotId();
diff --git a/fe/fe-core/src/test/java/org/apache/doris/catalog/TypeTest.java 
b/fe/fe-core/src/test/java/org/apache/doris/catalog/TypeTest.java
index 08dd895b739..fe3e2b0bd0a 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/catalog/TypeTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/catalog/TypeTest.java
@@ -29,15 +29,15 @@ public class TypeTest {
     public void testArrayOfArrayExactMatch() {
         ArrayType a1 = new ArrayType(new ArrayType(Type.INT, true), true);
         ArrayType a2 = new ArrayType(new ArrayType(Type.INT, true), true);
-        Assert.assertTrue(Type.matchExactType(a1, a2));
+        Assert.assertTrue(Type.matchExactType(a1, a2, false));
 
         // inner type mismatch
         ArrayType a3 = new ArrayType(new ArrayType(Type.BIGINT, true), true);
-        Assert.assertFalse(Type.matchExactType(a1, a3));
+        Assert.assertFalse(Type.matchExactType(a1, a3, false));
 
         // containsNull differs -> matchesType fails
         ArrayType a4 = new ArrayType(new ArrayType(Type.INT, true), false);
-        Assert.assertFalse(Type.matchExactType(a1, a4));
+        Assert.assertFalse(Type.matchExactType(a1, a4, false));
 
         // array nested decimal test
         ArrayType a5 = new ArrayType(new 
ArrayType(ScalarType.createDecimalV3Type(8, 2), true), true);
@@ -55,7 +55,7 @@ public class TypeTest {
         ArrayType arrayOfD = new ArrayType(d10s2, true);
         MapType m1 = new MapType(Type.INT, arrayOfD, true, true);
         MapType m2 = new MapType(Type.INT, new 
ArrayType(ScalarType.createDecimalV3Type(10, 2), true), true, true);
-        Assert.assertTrue(Type.matchExactType(m1, m2));
+        Assert.assertTrue(Type.matchExactType(m1, m2, false));
 
         // value decimal precision differs, same scale
         MapType m3 = new MapType(Type.INT, new 
ArrayType(ScalarType.createDecimalV3Type(12, 2), true), true, true);
@@ -65,7 +65,7 @@ public class TypeTest {
 
         // key/value containsNull differs -> doesn't matter for matching
         MapType m4 = new MapType(Type.INT, arrayOfD, false, true);
-        Assert.assertTrue(Type.matchExactType(m1, m4));
+        Assert.assertTrue(Type.matchExactType(m1, m4, false));
     }
 
     // ===================== StructType =====================
@@ -81,21 +81,21 @@ public class TypeTest {
                 new StructField("y", new ArrayType(Type.INT, true), null, true)
         );
         // names are ignored by matchExactType recursion; matchesType requires 
containsNull equal
-        Assert.assertTrue(Type.matchExactType(s1, s2));
+        Assert.assertTrue(Type.matchExactType(s1, s2, false));
 
         // inner element type differs
         StructType s3 = new StructType(
                 new StructField("f1", Type.INT, null, true),
                 new StructField("f2", new ArrayType(Type.BIGINT, true), null, 
true)
         );
-        Assert.assertFalse(Type.matchExactType(s1, s3));
+        Assert.assertFalse(Type.matchExactType(s1, s3, false));
 
         // field nullability differs -> matchesType fails upfront
         StructType s4 = new StructType(
                 new StructField("f1", Type.INT, null, false),
                 new StructField("f2", new ArrayType(Type.INT, true), null, 
true)
         );
-        Assert.assertFalse(Type.matchExactType(s1, s4));
+        Assert.assertFalse(Type.matchExactType(s1, s4, false));
     }
 
     // ===================== VariantType =====================
@@ -111,21 +111,21 @@ public class TypeTest {
         fields2.add(new VariantField("x", Type.INT, ""));
         fields2.add(new VariantField("y", new 
ArrayType(ScalarType.createDecimalV3Type(10, 2), true), ""));
         VariantType v2 = new VariantType(fields2);
-        Assert.assertTrue(Type.matchExactType(v1, v2));
+        Assert.assertTrue(Type.matchExactType(v1, v2, false));
 
         // change type of second field
         ArrayList<VariantField> fields3 = new ArrayList<>();
         fields3.add(new VariantField("a", Type.INT, ""));
         fields3.add(new VariantField("b", new 
ArrayType(ScalarType.createDecimalV3Type(12, 2), true), ""));
         VariantType v3 = new VariantType(fields3);
-        Assert.assertFalse(Type.matchExactType(v1, v3));
+        Assert.assertFalse(Type.matchExactType(v1, v3, false));
 
         // same types but different order -> index-wise comparison fails
         ArrayList<VariantField> fields4 = new ArrayList<>();
         fields4.add(new VariantField("b", new 
ArrayType(ScalarType.createDecimalV3Type(10, 2), true), ""));
         fields4.add(new VariantField("a", Type.INT, ""));
         VariantType v4 = new VariantType(fields4);
-        Assert.assertFalse(Type.matchExactType(v1, v4));
+        Assert.assertFalse(Type.matchExactType(v1, v4, false));
     }
 
     // ===================== Mixed Nesting & Precision =====================
@@ -185,6 +185,6 @@ public class TypeTest {
         Assert.assertFalse(Type.matchExactType(dtv2s3, dtv2s6, false));
         Assert.assertFalse(Type.matchExactType(dtv2s3, dtv2s6, true));
         // Same scale -> match
-        Assert.assertTrue(Type.matchExactType(dtv2s6, 
ScalarType.createDatetimeV2Type(6)));
+        Assert.assertTrue(Type.matchExactType(dtv2s6, 
ScalarType.createDatetimeV2Type(6), false));
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to