@Override public Block toBlock(Type desiredType) { checkArgument(TIMESTAMP.equals(desiredType), "type doesn't match: %s", desiredType); int numberOfRecords = numberOfRecords(); return new LongArrayBlock( numberOfRecords, Optional.ofNullable(nulls), timestamps == null ? new long[numberOfRecords] : timestamps); }
checkArgument(value instanceof Integer, "Expected value %d to be an instance of Integer, but is a %s", i, value.getClass().getSimpleName()); else if (BIGINT.equals(type) || DATE.equals(type) || TIMESTAMP.equals(type) || TIMESTAMP_WITH_TIME_ZONE.equals(type)) { checkArgument(value instanceof Integer || value instanceof Long, "Expected value %d to be an instance of Integer or Long, but is a %s", i, value.getClass().getSimpleName());
values.add(DATE_FORMATTER.print(TimeUnit.DAYS.toMillis(type.getLong(block, position)))); else if (TIMESTAMP.equals(type)) { values.add(new Timestamp(type.getLong(block, position)));
else if (TIMESTAMP.equals(type)) { return SqlTimestamp.JSON_FORMATTER.parse((String) value, LocalDateTime::from);
return ImmutableList.of(new OrcType(OrcTypeKind.DATE)); if (TIMESTAMP.equals(type)) { return ImmutableList.of(new OrcType(OrcTypeKind.TIMESTAMP));
return new Date(UTC.getMillisKeepLocal(DateTimeZone.getDefault(), TimeUnit.DAYS.toMillis(days))); if (TimestampType.TIMESTAMP.equals(type)) { long millisUtc = type.getLong(block, position); return new Timestamp(millisUtc);
private static boolean isValidPartitionType(Type type) { return type instanceof DecimalType || BOOLEAN.equals(type) || TINYINT.equals(type) || SMALLINT.equals(type) || INTEGER.equals(type) || BIGINT.equals(type) || REAL.equals(type) || DOUBLE.equals(type) || DATE.equals(type) || TIMESTAMP.equals(type) || isVarcharType(type) || isCharType(type); }
format == DWRF); if (TIMESTAMP.equals(type)) { return new LongOrcPredicate( expectedValues.stream()
return ISO8601_FORMATTER.print(parseTimeLiteral(timeZoneKey, (String) value)); if (TIMESTAMP.equals(type)) { return ISO8601_FORMATTER.print(parseTimestampWithoutTimeZone(timeZoneKey, (String) value));
return dateEncoding(type); if (TIMESTAMP.equals(type)) { return timestampEncoding(type);
return ISO8601_FORMATTER.print(parseTimeLiteral(timeZoneKey, (String) value)); if (TIMESTAMP.equals(type)) { return ISO8601_FORMATTER.print(parseTimestampWithoutTimeZone(timeZoneKey, (String) value));
longs[columnIndex] = datePartitionKey(columnValue, name); else if (TIMESTAMP.equals(type)) { longs[columnIndex] = timestampPartitionKey(columnValue, hiveStorageTimeZone, name);
row.setNull(destChannel); else if (TIMESTAMP.equals(type)) { row.addLong(destChannel, type.getLong(block, position) * 1000);
throw new PrestoException(NOT_SUPPORTED, "Unsupported column type: " + type.getDisplayName()); if (TIMESTAMP.equals(type)) { return "datetime";
cursor.getLong(columnIndex); else if (TIMESTAMP.equals(type)) { cursor.getLong(columnIndex);
type.writeLong(blockBuilder, days); else if (TIMESTAMP.equals(type)) { long millis = ((SqlTimestamp) value).getMillisUtc(); type.writeLong(blockBuilder, millis);
parseLongColumn(column); else if (TIMESTAMP.equals(type)) { parseLongColumn(column);
return new SqlDate(((Long) fieldFromCursor).intValue()); if (TimestampType.TIMESTAMP.equals(type)) { return new SqlTimestamp((long) fieldFromCursor, UTC_KEY);
return cursor.getLong(field); else if (TimestampType.TIMESTAMP.equals(type)) { return cursor.getLong(field);
assertInstanceOf(value, SqlVarbinary.class); else if (TIMESTAMP.equals(column.getType())) { assertInstanceOf(value, SqlTimestamp.class);