public Var changeDateByInt(Date d, Long i, boolean add) {
    Calendar c = Calendar.getInstance();
    c.setTimeInMillis(d.getTime());
    int days = i.intValue();
    if(!add) {
      days *= -1;
    }
    c.add(Calendar.DAY_OF_MONTH, days);
    return new Var(new Date(c.getTimeInMillis()));
  }
Add or subtract the specified number of days from DATE
hplsql/src/main/java/org/apache/hive/hplsql/Expression.java