Skip to content

Commit

Permalink
Fix copy & paste error in comment
Browse files Browse the repository at this point in the history
Also improve wording.
  • Loading branch information
findepi committed Jun 22, 2022
1 parent a305e5b commit df33eb5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ public static Optional<Object> getPreviousValue(Type type, Object value)
}

if (type instanceof TimestampType) {
// Iceberg supports only timestamp(6)
// Iceberg supports timestamp only with microsecond precision
checkArgument(((TimestampType) type).getPrecision() == 6, "Unexpected type: %s", type);
// TODO update the code here when type implements getRange
verify(type.getRange().isEmpty(), "Type %s unexpectedly returned a range", type);
return getAdjacentValue(Long.MIN_VALUE, Long.MAX_VALUE, (long) value, Direction.PREV);
}

if (type instanceof TimestampWithTimeZoneType) {
// Iceberg supports only timestamp(6)
// Iceberg supports timestamp with time zone only with microsecond precision
checkArgument(((TimestampWithTimeZoneType) type).getPrecision() == 6, "Unexpected type: %s", type);
verify(type.getRange().isEmpty(), "Type %s unexpectedly returned a range", type);
LongTimestampWithTimeZone timestampTzValue = (LongTimestampWithTimeZone) value;
Expand Down Expand Up @@ -119,15 +119,15 @@ public static Optional<Object> getNextValue(Type type, Object value)
}

if (type instanceof TimestampType) {
// Iceberg supports only timestamp(6)
// Iceberg supports timestamp only with microsecond precision
checkArgument(((TimestampType) type).getPrecision() == 6, "Unexpected type: %s", type);
// TODO update the code here when type implements getRange
verify(type.getRange().isEmpty(), "Type %s unexpectedly returned a range", type);
return getAdjacentValue(Long.MIN_VALUE, Long.MAX_VALUE, (long) value, Direction.NEXT);
}

if (type instanceof TimestampWithTimeZoneType) {
// Iceberg supports only timestamp(6)
// Iceberg supports timestamp with time zone only with microsecond precision
checkArgument(((TimestampWithTimeZoneType) type).getPrecision() == 6, "Unexpected type: %s", type);
verify(type.getRange().isEmpty(), "Type %s unexpectedly returned a range", type);
LongTimestampWithTimeZone timestampTzValue = (LongTimestampWithTimeZone) value;
Expand Down

0 comments on commit df33eb5

Please sign in to comment.