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

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

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

Date.toString介绍

暂无

代码示例

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

@Override
public String toString() {
 return date.toString();
}

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

public static TimestampTZ convert(Date date, ZoneId defaultTimeZone) {
 return parse(date.toString(), defaultTimeZone);
}

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

@Override
public Object evaluate(DeferredObject[] arguments) throws HiveException {
 Date d = getDateValue(arguments, 0, inputTypes, converters);
 if (d == null) {
  return null;
 }
 lastDay(d);
 output.set(date.toString());
 return output;
}

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

private static String normalizeDateCol(Object colValue) throws SemanticException {
 Date value;
 if (colValue instanceof DateWritableV2) {
  value = ((DateWritableV2) colValue).get(); // Time doesn't matter.
 } else if (colValue instanceof Date) {
  value = (Date) colValue;
 } else {
  throw new SemanticException("Unexpected date type " + colValue.getClass());
 }
 try {
  return MetaStoreUtils.PARTITION_DATE_FORMAT.get().format(
    MetaStoreUtils.PARTITION_DATE_FORMAT.get().parse(value.toString()));
 } catch (ParseException e) {
  throw new SemanticException(e);
 }
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return  "date " + dt.toString() + ", " + getColumnParamString(0, colNum);
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return  "date " + dt.toString() + ", " + getColumnParamString(0, colNum);
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return  "date " + dt.toString() + ", " + getColumnParamString(0, colNum);
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return getColumnParamString(0, colNum) + ", date " + dt.toString();
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return  "date " + dt.toString() + ", " + getColumnParamString(0, colNum);
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return getColumnParamString(0, colNum) + ", date " + dt.toString();
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return getColumnParamString(0, colNum) + ", date " + dt.toString();
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return getColumnParamString(0, colNum) + ", date " + dt.toString();
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return  "date " + dt.toString() + ", " + getColumnParamString(0, colNum);
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return  "date " + dt.toString() + ", " + getColumnParamString(0, colNum);
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return getColumnParamString(0, colNum) + ", date " + dt.toString();
}

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

@Override
public String vectorExpressionParameters() {
 Date dt = Date.ofEpochMilli(DateWritableV2.daysToMillis((int) value));
 return getColumnParamString(0, colNum) + ", date " + dt.toString();
}

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

public static String randomPrimitiveDateStringObject(Random r) {
 return RandomTypeUtil.getRandDate(r).toString();
}

代码示例来源: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

private static TColumnValue dateValue(Date value) {
 TStringValue tStringValue = new TStringValue();
 if (value != null) {
  tStringValue.setValue(value.toString());
 }
 return new TColumnValue(TColumnValue.stringVal(tStringValue));
}

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

@Override
public Object evaluate(DeferredObject[] arguments) throws HiveException {
 int dayOfWeekInt;
 if (isDayOfWeekConst) {
  dayOfWeekInt = dayOfWeekIntConst;
 } else {
  String dayOfWeek = getStringValue(arguments, 1, converters);
  dayOfWeekInt = getIntDayOfWeek(dayOfWeek);
 }
 if (dayOfWeekInt == -1) {
  return null;
 }
 Date d = getDateValue(arguments, 0, inputTypes, converters);
 if (d == null) {
  return null;
 }
 nextDay(d, dayOfWeekInt);
 output.set(date.toString());
 return output;
}

相关文章