Skip to content

Commit

Permalink
Include checked arguments in checks messages
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Mar 16, 2023
1 parent c98bb40 commit 5b7f10f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private static Optional<TupleDomain<IcebergColumnHandle>> unwrapCastInComparison
private static Optional<Domain> unwrapTimestampTzToDateCast(IcebergColumnHandle column, FunctionName functionName, long date)
{
Type type = column.getType();
checkArgument(type.equals(TIMESTAMP_TZ_MICROS), "Column of unexpected type %s: %s ", type, column);
checkArgument(type.equals(TIMESTAMP_TZ_MICROS), "Column of unexpected type %s: %s", type, column);

// Verify no overflow. Date values must be in integer range.
verify(date <= Integer.MAX_VALUE, "Date value out of range: %s", date);
Expand Down Expand Up @@ -242,7 +242,8 @@ private static Optional<TupleDomain<IcebergColumnHandle>> unwrapDateTruncInCompa
private static Optional<Domain> unwrapDateTruncInComparison(String unit, FunctionName functionName, Constant constant)
{
Type type = constant.getType();
checkArgument(constant.getValue() != null && type.equals(TIMESTAMP_TZ_MICROS), "Unexpected constant: %s", constant);
checkArgument(constant.getValue() != null, "Unexpected constant: %s", constant);
checkArgument(type.equals(TIMESTAMP_TZ_MICROS), "Unexpected type: %s", type);

// Normalized to UTC because for comparisons the zone is irrelevant
ZonedDateTime dateTime = Instant.ofEpochMilli(((LongTimestampWithTimeZone) constant.getValue()).getEpochMillis())
Expand Down

0 comments on commit 5b7f10f

Please sign in to comment.