org.apache.hadoop.hive.common.type.Date.getYear()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(193)

本文整理了Java中org.apache.hadoop.hive.common.type.Date.getYear()方法的一些代码示例,展示了Date.getYear()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Date.getYear()方法的具体详情如下:
包路径:org.apache.hadoop.hive.common.type.Date
类名称:Date
方法名:getYear

Date.getYear介绍

暂无

代码示例

代码示例来源:origin: apache/hive

@Override
Date transform(final Date value) {
 int actualMonthValue = maskedMonthValue + 1;
 int year  = maskedYearValue  == UNMASKED_VAL ? value.getYear()  : maskedYearValue;
 int month = maskedMonthValue == UNMASKED_VAL ? value.getMonth() : actualMonthValue;
 int day   = maskedDayValue   == UNMASKED_VAL ? value.getDay()  : maskedDayValue;
 return Date.of(year, month, day);
}

代码示例来源:origin: apache/hive

/**
 * Write DATE.
 * The representation of date in Teradata binary format is:
 * The Date D is a int with 4 bytes using little endian.
 * The representation is (YYYYMMDD - 19000000).toInt -> D
 * eg. 1911.11.11 -> 19111111 -> 111111 -> 07 b2 01 00 in little endian.
 * the null date will use 0 to pad.
 *
 * @param date the date
 * @throws IOException the io exception
 */
public void writeDate(DateWritableV2 date) throws IOException {
 if (date == null) {
  EndianUtils.writeSwappedInteger(this, 0);
  return;
 }
 int toWrite = date.get().getYear() * 10000 + date.get().getMonth() * 100 + date.get().getDay() - 19000000;
 EndianUtils.writeSwappedInteger(this, toWrite);
}

代码示例来源:origin: apache/hive

result = new DateTime(d.getYear(), d.getMonth(), d.getDay(), 0, 0, DateTimeZone.UTC);
 break;
case TIMESTAMP:

代码示例来源:origin: org.apache.hive.hcatalog/hive-hcatalog-pig-adapter

result = new DateTime(d.getYear(), d.getMonth(), d.getDay(), 0, 0, DateTimeZone.UTC);
 break;
case TIMESTAMP:

相关文章