APISonar


org.apache.hadoop.hive.ql.exec.vector.TimestampColumnVector.time

> org > apache > hadoop > hive > ql > exec > vector > TimestampColumnVector > time
org APIs apache APIs hadoop APIs hive APIs ql APIs exec APIs vector APIs TimestampColumnVector APIs time APIs

Example 1
protected void func(TimestampColumnVector outputColVector, TimestampColumnVector inputColVector,
      int i) {
    String adjustedTimestampString = SIMPLE_DATE_FORMAT_THREAD_LOCAL.get()
        .format(new java.sql.Timestamp(inputColVector.time[i]));
    Timestamp adjustedTimestamp = Timestamp.valueOf(adjustedTimestampString);
    outputColVector.time[i] = adjustedTimestamp.toEpochMilli();
    // Nanos don't change
    outputColVector.nanos[i] = inputColVector.nanos[i];
  }
Example 2
private void verifyTimestamp(String tsString, TimestampColumnVector resultV, int index) {
    Assert.assertEquals(Timestamp.valueOf(tsString).toEpochMilli(), resultV.time[index]);
    Assert.assertEquals(Timestamp.valueOf(tsString).getNanos(), resultV.nanos[index]);
  }
Example 3
protected void func(BytesColumnVector outV, TimestampColumnVector inV, int i) {
    byte[] temp = LocalDateTime.ofInstant(Instant.ofEpochMilli(inV.time[i]), ZoneOffset.UTC)
        .withNano(inV.nanos[i])
        .format(PRINT_FORMATTER).getBytes();
    assign(outV, i, temp, temp.length);
  }
Example 4
void sqlFormat(BytesColumnVector outV, TimestampColumnVector inV, int i,
      HiveSqlDateTimeFormatter sqlFormatter) {
    String formattedString = sqlFormatter.format(
        org.apache.hadoop.hive.common.type.Timestamp.ofEpochMilli(inV.time[i], inV.nanos[i]));
    if (formattedString == null) {
      outV.isNull[i] = true;
      outV.noNulls = false;
      return;
    }
    byte[] temp = formattedString.getBytes();
    assign(outV, i, temp, temp.length);
  }
Example 5
private TimestampColumnVector vector;

	public SqlTimestamp getTimestamp(int i, int precision) {
		int index = vector.isRepeating ? 0 : i;
		Timestamp timestamp = new Timestamp(vector.time[index]);
		timestamp.setNanos(vector.nanos[index]);
		return SqlTimestamp.fromTimestamp(timestamp);
	}