APISonar


org.apache.hadoop.hive.common.type.Date.Date

> org > apache > hadoop > hive > common > type > Date > Date
org APIs apache APIs hadoop APIs hive APIs common APIs type APIs Date APIs Date APIs

Example 1
public void set(Date d) {
    if (d == null) {
      date = new Date();
      return;
    }

    set(d.toEpochDay());
  }
Example 2
public Date add(Date dt, int interval) {
    if (dt == null) {
      return null;
    }

    Date dtResult = new Date();
    dtResult.setTimeInDays(dt.toEpochDay() + interval);
    return dtResult;
  }
Example 3
public Date parseDate(String strValue) {
    Date result = new Date();
    if (parseDate(strValue, result)) {
      return result;
    }
    return null;
  }
Example 4
public Date readDate() throws IOException, ParseException {
    int di = readInt();
    if (di == 0) {
      return null;
    }
    String dateString = String.valueOf(di + 19000000);
    if (dateString.length() < DATE_STRING_LENGTH) {
      dateString = StringUtils.leftPad(dateString, DATE_STRING_LENGTH, '0');
    }
    Date date = new Date();
    date.setYear(Integer.parseInt(dateString.substring(0, 4)));
    date.setMonth(Integer.parseInt(dateString.substring(4, 6)));
    date.setDayOfMonth(Integer.parseInt(dateString.substring(6, 8)));
    return date;
  }
Example 5
public Date subtract(Date left, HiveIntervalYearMonth right) {
    if (left == null || right == null) {
      return null;
    }

    Date dtResult = new Date();
    subtract(left, right, dtResult);

    return dtResult;
  }
Example 6
public VectorUDFUnixTimeStampDate(int colNum, int outputColumnNum) {
    /* not a real field */
    super(-1, colNum, outputColumnNum);
    date = new Date();
  }
Example 7
protected void evaluate(LongColumnVector outputColVector, BytesColumnVector inV, int i) {
    String dateString = new String(inV.vector[i], inV.start[i], inV.length[i], StandardCharsets.UTF_8);
    Date hDate = new Date();
    if (dateParser.parseDate(dateString, hDate)) {
      outputColVector.vector[i] = DateWritableV2.dateToDays(hDate);
      return;
    }
    setNull(outputColVector, i);
  }