本文整理了Java中org.apache.hadoop.hive.metastore.api.Date.getDaysSinceEpoch()
方法的一些代码示例,展示了Date.getDaysSinceEpoch()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Date.getDaysSinceEpoch()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.api.Date
类名称:Date
方法名:getDaysSinceEpoch
暂无
代码示例来源:origin: apache/hive
private long diff(Date d1, Date d2) {
return d1.getDaysSinceEpoch() - d2.getDaysSinceEpoch();
}
代码示例来源:origin: apache/hive
public Object getFieldValue(_Fields field) {
switch (field) {
case DAYS_SINCE_EPOCH:
return getDaysSinceEpoch();
}
throw new IllegalStateException();
}
代码示例来源:origin: prestodb/presto
public static Optional<LocalDate> fromMetastoreDate(Date date)
{
if (date == null) {
return Optional.empty();
}
return Optional.of(LocalDate.ofEpochDay(date.getDaysSinceEpoch()));
}
代码示例来源:origin: apache/hive
private static String convertToString(org.apache.hadoop.hive.metastore.api.Date val) {
if (val == null) {
return "";
}
DateWritableV2 writableValue = new DateWritableV2((int) val.getDaysSinceEpoch());
return writableValue.toString();
}
代码示例来源:origin: apache/drill
private static String convertToString(org.apache.hadoop.hive.metastore.api.Date val) {
if (val == null) {
return "";
}
DateWritable writableValue = new DateWritable((int) val.getDaysSinceEpoch());
return writableValue.toString();
}
代码示例来源:origin: apache/hive
private Date getLowVal() {
long min = Long.MAX_VALUE;
for (Date d : lowVals) min = Math.min(min, d.getDaysSinceEpoch());
return new Date(min);
}
代码示例来源:origin: apache/hive
private Date getHighVal() {
long max = Long.MIN_VALUE;
for (Date d : highVals) max = Math.max(max, d.getDaysSinceEpoch());
return new Date(max);
}
}
代码示例来源:origin: apache/hive
double maxInd = adjustedIndexMap.get(list.get(list.size() - 1).getKey());
long lowValue = 0;
long min = list.get(0).getValue().getLowValue().getDaysSinceEpoch();
long max = list.get(list.size() - 1).getValue().getLowValue().getDaysSinceEpoch();
if (minInd == maxInd) {
lowValue = min;
maxInd = adjustedIndexMap.get(list.get(list.size() - 1).getKey());
long highValue = 0;
min = list.get(0).getValue().getHighValue().getDaysSinceEpoch();
max = list.get(list.size() - 1).getValue().getHighValue().getDaysSinceEpoch();
if (minInd == maxInd) {
highValue = min;
代码示例来源:origin: apache/hive
DateColumnStatsData dstats = statData.getDateStats();
if (dstats.isSetHighValue()) {
oneRow.add(DateSubType.DAYS.cast(dstats.getHighValue().getDaysSinceEpoch()));
} else {
oneRow.add(null);
continue;
long curVal = dstats.getHighValue().getDaysSinceEpoch();
maxVal = maxVal == null ? curVal : Math.max(maxVal, curVal);
DateColumnStatsData dstats = statData.getDateStats();
if (dstats.isSetLowValue()) {
oneRow.add(DateSubType.DAYS.cast(dstats.getLowValue().getDaysSinceEpoch()));
} else {
oneRow.add(null);
continue;
long curVal = dstats.getLowValue().getDaysSinceEpoch();
minVal = minVal == null ? curVal : Math.min(minVal, curVal);
代码示例来源:origin: apache/hive
cs.setNumNulls(csd.getDateStats().getNumNulls());
Long lowVal = (csd.getDateStats().getLowValue() != null) ? csd.getDateStats().getLowValue()
.getDaysSinceEpoch() : null;
Long highVal = (csd.getDateStats().getHighValue() != null) ? csd.getDateStats().getHighValue()
.getDaysSinceEpoch() : null;
cs.setRange(lowVal, highVal);
} else {
代码示例来源:origin: apache/drill
cs.setNumNulls(csd.getDateStats().getNumNulls());
Long lowVal = (csd.getDateStats().getLowValue() != null) ? csd.getDateStats().getLowValue()
.getDaysSinceEpoch() : null;
Long highVal = (csd.getDateStats().getHighValue() != null) ? csd.getDateStats().getHighValue()
.getDaysSinceEpoch() : null;
cs.setRange(lowVal, highVal);
} else {
代码示例来源:origin: apache/hive
dateStats.isSetNumDVs() ? dateStats.getNumDVs() : null,
dateStats.isSetBitVectors() ? dateStats.getBitVectors() : null,
dateStats.isSetLowValue() ? dateStats.getLowValue().getDaysSinceEpoch() : null,
dateStats.isSetHighValue() ? dateStats.getHighValue().getDaysSinceEpoch() : null);
代码示例来源:origin: apache/hive
dateStats.isSetNumDVs() ? dateStats.getNumDVs() : null,
dateStats.isSetBitVectors() ? dateStats.getBitVectors() : null,
dateStats.isSetLowValue() ? dateStats.getLowValue().getDaysSinceEpoch() : null,
dateStats.isSetHighValue() ? dateStats.getHighValue().getDaysSinceEpoch() : null);
代码示例来源:origin: org.spark-project.hive/hive-metastore
public Object getFieldValue(_Fields field) {
switch (field) {
case DAYS_SINCE_EPOCH:
return Long.valueOf(getDaysSinceEpoch());
}
throw new IllegalStateException();
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
public Object getFieldValue(_Fields field) {
switch (field) {
case DAYS_SINCE_EPOCH:
return Long.valueOf(getDaysSinceEpoch());
}
throw new IllegalStateException();
}
代码示例来源:origin: prestosql/presto
public static Optional<LocalDate> fromMetastoreDate(Date date)
{
if (date == null) {
return Optional.empty();
}
return Optional.of(LocalDate.ofEpochDay(date.getDaysSinceEpoch()));
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
private static String convertToString(org.apache.hadoop.hive.metastore.api.Date val) {
if (val == null) {
return "";
}
DateWritable writableValue = new DateWritable((int) val.getDaysSinceEpoch());
return writableValue.toString();
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
dateStats.isSetNumNulls() ? dateStats.getNumNulls() : null,
dateStats.isSetNumDVs() ? dateStats.getNumDVs() : null,
dateStats.isSetLowValue() ? dateStats.getLowValue().getDaysSinceEpoch() : null,
dateStats.isSetHighValue() ? dateStats.getHighValue().getDaysSinceEpoch() : null);
代码示例来源:origin: org.spark-project.hive/hive-metastore
dateStats.isSetNumNulls() ? dateStats.getNumNulls() : null,
dateStats.isSetNumDVs() ? dateStats.getNumDVs() : null,
dateStats.isSetLowValue() ? dateStats.getLowValue().getDaysSinceEpoch() : null,
dateStats.isSetHighValue() ? dateStats.getHighValue().getDaysSinceEpoch() : null);
代码示例来源:origin: com.facebook.presto.hive/hive-apache
dateStats.isSetNumNulls() ? dateStats.getNumNulls() : null,
dateStats.isSetNumDVs() ? dateStats.getNumDVs() : null,
dateStats.isSetLowValue() ? dateStats.getLowValue().getDaysSinceEpoch() : null,
dateStats.isSetHighValue() ? dateStats.getHighValue().getDaysSinceEpoch() : null);
内容来源于网络,如有侵权,请联系作者删除!