@Override
    public Double visitCall(RexCall call) {
      if (!deep) {
        return null;
      }

      Double cost = 0.d;
      for (RexNode operand : call.operands) {
        Double operandCost = operand.accept(this);
        if (operandCost == null) {
          return null;
        }
        cost += operandCost;
        Double size;
        if (operand.isA(SqlKind.LITERAL)) {
          size = HiveRelMdSize.INSTANCE.typeValueSize(operand.getType(),
              ((RexLiteral) operand).getValueAs(Comparable.class));
        } else {
          size = HiveRelMdSize.INSTANCE.averageTypeValueSize(operand.getType());
        }
        if (size == null) {
          return null;
        }
        cost += size;
      }

      return cost + functionCost(call);
    }
The cost of a call expression e is computed as:
cost(e) = functionCost + sum_1..n(byteSize(o_i) + cost(o_i))
with the call having operands i in 1..n.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterSortPredicates.java