本文整理了Java中org.apache.hadoop.hive.common.type.Date.setTimeInMillis()
方法的一些代码示例,展示了Date.setTimeInMillis()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Date.setTimeInMillis()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.common.type.Date
类名称:Date
方法名:setTimeInMillis
暂无
代码示例来源:origin: apache/hive
@Deprecated
public Object set(Object o, java.sql.Date value) {
if (value == null) {
return null;
}
((Date) o).setTimeInMillis(value.getTime());
return o;
}
代码示例来源:origin: apache/hive
public boolean parseDate(String strValue, Date result) {
Date parsedVal;
try {
parsedVal = Date.valueOf(strValue);
} catch (IllegalArgumentException e) {
parsedVal = null;
}
if (parsedVal == null) {
return false;
}
result.setTimeInMillis(parsedVal.toEpochMilli());
return true;
}
}
代码示例来源:origin: apache/hive
public boolean add(Date dt, HiveIntervalYearMonth interval, Date result) {
if (dt == null || interval == null) {
return false;
}
long resultMillis = addMonthsToMillis(dt.toEpochMilli(), interval.getTotalMonths());
result.setTimeInMillis(resultMillis);
return true;
}
代码示例来源:origin: apache/hive
public boolean add(HiveIntervalYearMonth interval, Date dt, Date result) {
if (dt == null || interval == null) {
return false;
}
long resultMillis = addMonthsToMillis(dt.toEpochMilli(), interval.getTotalMonths());
result.setTimeInMillis(resultMillis);
return true;
}
代码示例来源:origin: apache/hive
@Override
public String vectorExpressionParameters() {
String value;
if (object instanceof Long) {
Date tempDate = new Date();
tempDate.setTimeInMillis(DateWritableV2.daysToMillis((int) longValue));
value = tempDate.toString();
} else if (object instanceof Timestamp) {
value = org.apache.hadoop.hive.common.type.Timestamp.ofEpochMilli(
timestampValue.getTime(), timestampValue.getNanos()).toString();
} else if (object instanceof byte []) {
value = new String(this.stringValue, StandardCharsets.UTF_8);
} else {
value = "unknown";
}
return "val " + value + ", " + getColumnParamString(0, colNum);
}
代码示例来源:origin: apache/hive
baseDate.setTimeInMillis(DateWritableV2.daysToMillis((int) longValue));
break;
baseDate.setTimeInMillis(timestampValue.getTime());
break;
代码示例来源:origin: apache/nifi
Date d = (Date) o;
org.apache.hadoop.hive.common.type.Date date = new org.apache.hadoop.hive.common.type.Date();
date.setTimeInMillis(d.getTime());
return new DateWritableV2(date);
代码示例来源:origin: apache/nifi
if(d != null) {
org.apache.hadoop.hive.common.type.Date hiveDate = new org.apache.hadoop.hive.common.type.Date();
hiveDate.setTimeInMillis(d.getTime());
val = hiveDate;
} else {
代码示例来源:origin: org.apache.hive/hive-serde
@Deprecated
public Object set(Object o, java.sql.Date value) {
if (value == null) {
return null;
}
((Date) o).setTimeInMillis(value.getTime());
return o;
}
代码示例来源:origin: org.apache.hive/hive-common
public boolean parseDate(String strValue, Date result) {
Date parsedVal;
try {
parsedVal = Date.valueOf(strValue);
} catch (IllegalArgumentException e) {
parsedVal = null;
}
if (parsedVal == null) {
return false;
}
result.setTimeInMillis(parsedVal.toEpochMilli());
return true;
}
}
内容来源于网络,如有侵权,请联系作者删除!