public ExternalFunctionCallExpr(JsonRecord rec, ArrayList<Expr> exprList) {
    super(exprList);
    this.rec = rec;
    this.mode = (JsonString) rec.get(new JsonString("mode"));

    if (mode == null) {
      throw new IllegalArgumentException("mode should be specified: push or streaming");
    }

    initParams(rec);
  }
  public ExternalFunctionCallExpr(JsonRecord rec, Expr[] exprs)
      throws InstantiationException, IllegalAccessException {
    super(exprs);
    this.rec = rec;
    this.mode = (JsonString) rec.get(new JsonString("mode"));

    if (mode == null) {
      throw new IllegalArgumentException("mode should be specified: push or streaming");
    }

    initParams(rec);
  }
 @Override
 public boolean isMappable(int i) {
   return i == 0 && ((JsonBool) rec.get(new JsonString("perPartition"))).get() == true;
 }