@Override
  public Object evaluate(Record input) {
    double res = 0;
    for (int i = 0; i < input.size(); i++) {
      if (!input.isNull(i)) {
        switch (input.getDataType(i)) {
          case INT32:
            res += input.getInt(i);
            break;
          case INT64:
            res += input.getLong(i);
            break;
          case FLOAT:
            res += input.getFloat(i);
            break;
          case DOUBLE:
            res += input.getDouble(i);
            break;
        }
      }
    }
    switch (outputDataType) {
      case INT32:
        return (int) res;
      case INT64:
        return (long) res;
      case FLOAT:
        return (float) res;
      case DOUBLE:
        return res;
      default:
        throw new RuntimeException("Unexpected output type.");
    }
  }
Calculate the sum of all arguments. Only support inputs of INT32,INT64,DOUBLE,FLOAT type.
integration-test/src/main/java/org/apache/iotdb/db/query/udf/example/relational/AllSum.java