public void execSql(String name, HplsqlParser.Expr_func_paramsContext ctx) {
    try {
      if (execUserSql(ctx, name)) {
        return;
      }
    } catch (TException e) {
      throw new HplValidationException(ctx, e);
    }
    StringBuilder sql = new StringBuilder();
    sql.append(name);
    sql.append("(");
    if (ctx != null) {
      int cnt = ctx.func_param().size();
      for (int i = 0; i < cnt; i++) {
        sql.append(evalPop(ctx.func_param(i).expr()));
        if (i + 1 < cnt) {
          sql.append(", ");
        }
      }
    }
    sql.append(")");
    Var var = new Var(Type.SQL_STRING, sql);
    exec.stackPush(var);
  }
User-defined function in a SQL query
hplsql/src/main/java/org/apache/hive/hplsql/Exec.java