本文整理了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
暂无
代码示例来源: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();
}
内容来源于网络,如有侵权,请联系作者删除!