uros-b commented on code in PR #18299:
URL: https://github.com/apache/iceberg/pull/18299#discussion_r4144087586


##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/sql/TestAggregatePushDown.java:
##########
@@ -94,6 +94,17 @@ public void 
testDifferentDataTypesAggregatePushDownInNonPartitionedTable() {
     testDifferentDataTypesAggregatePushDown(false);
   }
 
+  @TestTemplate
+  public void testAggregatePushDownWithRowLineageMetadataColumn() {
+    sql("CREATE TABLE %s (id INT) USING iceberg TBLPROPERTIES 
('format-version'='3')", tableName);
+    sql("INSERT INTO %s VALUES (1), (2), (3)", tableName);
+
+    List<Object[]> actual = sql("SELECT max(_row_id) FROM %s", tableName);
+
+    assertThat(actual).hasSize(1);
+    assertThat(actual.get(0)[0]).isInstanceOf(Long.class);

Review Comment:
   Minor note - perhaps we can improve this test a bit, please see below:
   
   The new test asserts only hasSize(1) and isInstanceOf(Long.class), omitting 
the two standard assertions established by 
testAggregateNotPushDownForStringType and similar methods in this class: (1) an 
EXPLAIN check asserting max(_row_id) is NOT present in the pushed-down plan 
(confirming the fix mechanism, not just the outcome), and (2) a value assertion 
— with 3 rows in a fresh v3 table, _row_id values are 0, 1, 2, making MAX 
deterministically 2L, so isEqualTo(2L) is computable. A fallback that silently 
returned the wrong value would still pass the current assertions.



-- 
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]

Reply via email to