zhjwpku commented on code in PR #1157:
URL: https://github.com/apache/iceberg-cpp/pull/1157#discussion_r4697803542
##########
src/iceberg/test/aggregate_test.cc:
##########
@@ -327,6 +328,44 @@ TEST(AggregateTest, AggregatesFromDataFileWithTransform) {
EXPECT_TRUE(evaluator->AllAggregatorsValid());
}
+TEST(AggregateTest, MaxDayUsesTimestampUpperBound) {
+ Schema schema({SchemaField::MakeRequired(1, "ts", timestamp())});
+ auto max_day = BindAggregate(schema,
Expressions::Max(Expressions::Day("ts")));
+ ICEBERG_UNWRAP_OR_FAIL(auto upper,
+ Literal::Timestamp(2 * internal::kMicrosPerDay +
1).Serialize());
+ DataFile file{.record_count = 1, .upper_bounds = {{1, upper}}};
+ EXPECT_TRUE(max_day->HasValue(file));
Review Comment:
Nothing in `DataFile` says whether a bound is exact, so the aggregate cannot
detect this case. This is the same contract as Java's `MaxAggregate`, which
returns the bound as is and leaves it to the caller to decide whether bounds
can
be trusted. This PR does not change that; the test only checks that the
bound is
decoded with the source column type.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]