rdblue commented on code in PR #6622:
URL: https://github.com/apache/iceberg/pull/6622#discussion_r1116142869
##########
spark/v3.3/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestMergeOnReadDelete.java:
##########
@@ -118,4 +122,32 @@ public void testCommitUnknownException() {
ImmutableList.of(row(1, "hr", "c1"), row(3, "hr", "c1")),
sql("SELECT * FROM %s ORDER BY id", "dummy_catalog.default.table"));
}
+
+ @Test
+ public void testAggregatePushDownInMergeOnReadDelete() {
+ createAndInitTable("id LONG, data INT");
+ sql(
+ "INSERT INTO TABLE %s VALUES (1, 1111), (1, 2222), (2, 3333), (2,
4444), (3, 5555), (3, 6666) ",
+ tableName);
+
+ sql("DELETE FROM %s WHERE data = 1111", tableName);
+ String select = "SELECT max(data), min(data), count(data) FROM %s";
+
+ List<Object[]> explain = sql("EXPLAIN " + select, tableName);
+ String explainString = explain.get(0)[0].toString();
+ boolean explainContainsPushDownAggregates = false;
+ if (explainString.contains("max(data)".toLowerCase(Locale.ROOT))
Review Comment:
There should be no need to call `toLowerCase` on string literals. Instead,
we generally just make sure they don't contain upper case characters. The
explain string is what needs to be lower case so that these lower case literals
can match.
--
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]