public static boolean isInferenceCandidate(Metadata metadata, Expression expression) {
    if (expression instanceof ComparisonExpression && isDeterministic(expression)
    // && !mayReturnNullOnNonNullInput(expression)
    ) {
      ComparisonExpression comparison = (ComparisonExpression) expression;
      if (comparison.getOperator() == ComparisonExpression.Operator.EQUAL) {
        // We should only consider equalities that have distinct left and right components
        return !comparison.getLeft().equals(comparison.getRight());
      }
    }
    return false;
  }
Determines whether an Expression may be successfully applied to the equality inference
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/EqualityInference.java