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

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

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

Date.toEpochSecond介绍

暂无

代码示例

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

/**
 *
 * @return time in seconds corresponding to this DateWritableV2
 */
public long getTimeInSeconds() {
 return date.toEpochSecond();
}

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

public void testDate() throws HiveException {
 GenericUDFToUnixTimeStamp udf = new GenericUDFToUnixTimeStamp();
 ObjectInspector valueOI = PrimitiveObjectInspectorFactory.writableDateObjectInspector;
 ObjectInspector[] arguments = {valueOI};
 udf.initialize(arguments);
 Date date = Date.valueOf("1970-01-01");
 runAndVerify(udf,
   new DateWritableV2(date),
   new LongWritable(date.toEpochSecond()));
 // test null values
 runAndVerify(udf, null, null);
}

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

new Text(val),
new Text(format),
new LongWritable(Date.valueOf(val).toEpochSecond()));

代码示例来源:origin: org.apache.hive/hive-serde

/**
 *
 * @return time in seconds corresponding to this DateWritableV2
 */
public long getTimeInSeconds() {
 return date.toEpochSecond();
}

相关文章