rdblue commented on code in PR #9176: URL: https://github.com/apache/iceberg/pull/9176#discussion_r1468943381
########## spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/sql/TestAggregatePushDown.java: ########## @@ -249,6 +250,78 @@ public void testAggregateNotPushDownIfOneCantPushDown() { assertEquals("expected and actual should equal", expected, actual); } + @Test + public void testAggregationPushdownStructInteger() { + testAggregationPushdownStruct( + 2L, + 3L, + 2L, + "(id BIGINT, struct_with_int STRUCT<c1:BIGINT>)", + "struct_with_int.c1", + "(1, named_struct(\"c1\", NULL))", + "(2, named_struct(\"c1\", 2))", + "(3, named_struct(\"c1\", 3))"); + } + + @Test + public void testAggregationPushdownNestedStruct() { + testAggregationPushdownStruct( + 2L, + 3L, + 2L, + "(id BIGINT, struct_with_int STRUCT<c1:STRUCT<c2:STRUCT<c3:STRUCT<c4:BIGINT>>>>)", + "struct_with_int.c1.c2.c3.c4", + "(1, named_struct(\"c1\", named_struct(\"c2\", named_struct(\"c3\", named_struct(\"c4\", NULL)))))", + "(2, named_struct(\"c1\", named_struct(\"c2\", named_struct(\"c3\", named_struct(\"c4\", 2)))))", + "(3, named_struct(\"c1\", named_struct(\"c2\", named_struct(\"c3\", named_struct(\"c4\", 3)))))"); + } + + @Test + public void testAggregationPushdownStructTimestamp() { + long timestamp = System.currentTimeMillis(); + long futureTimestamp = timestamp + 5000; + Timestamp expectedMax = new Timestamp(futureTimestamp / 1000 * 1000); + Timestamp expectedMin = new Timestamp(1000 * (timestamp / 1000)); Review Comment: Why are the expressions different other than the timestamp variable? Also, do these need to be timestamps? Or can you convert them back to millis or micros in Spark? We want to avoid using `Timestamp` in tests because it has wacky behavior across time zones. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org