rdblue commented on a change in pull request #1981:
URL: https://github.com/apache/iceberg/pull/1981#discussion_r549823791
##########
File path:
api/src/test/java/org/apache/iceberg/transforms/TestDatesProjection.java
##########
@@ -142,6 +161,24 @@ public void testMonthStrictUpperBound() {
assertProjectionStrictValue(spec, in("date", anotherDate, date),
Expression.Operation.FALSE);
}
+ @Test
+ public void testNegativeMonthStrictUpperBound() {
+ Integer date = (Integer) Literal.of("1969-12-31").to(TYPE).value();
+ PartitionSpec spec =
PartitionSpec.builderFor(SCHEMA).month("date").build();
+
+ assertProjectionStrictValue(spec, lessThan("date", date),
Expression.Operation.FALSE);
+ assertProjectionStrictValue(spec, lessThanOrEqual("date", date),
Expression.Operation.FALSE);
+ assertProjectionStrict(spec, greaterThan("date", date),
Expression.Operation.GT, "1969-12");
+ assertProjectionStrict(spec, greaterThanOrEqual("date", date),
Expression.Operation.GT, "1969-12");
+ assertProjectionStrict(spec, notEqual("date", date),
Expression.Operation.NOT_IN, "[1969-12, 1970-01]");
+ assertProjectionStrictValue(spec, equal("date", date),
Expression.Operation.FALSE);
+
+ Integer anotherDate = (Integer) Literal.of("1970-01-01").to(TYPE).value();
+ assertProjectionStrict(spec, notIn("date", date, anotherDate),
+ Expression.Operation.NOT_IN, "[1969-12, 1970-01]");
Review comment:
I updated the other test to use a lower bound that is not 1970-01-01 and
also added tests specifically for epoch values. This still conflicted with the
epoch test, so I changed it to use 1969-11-01.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]