szehon-ho commented on code in PR #15014:
URL: https://github.com/apache/iceberg/pull/15014#discussion_r2700360696
##########
spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/source/SparkPositionDeltaWrite.java:
##########
@@ -347,6 +359,45 @@ private void commitOperation(SnapshotUpdate<?> operation,
String description) {
throw e;
}
}
+
+ private void setMergeSummaryProperties(SnapshotUpdate<?> operation,
MergeSummary mergeSummary) {
+ setIfPositive(
+ operation, "spark.merge-into.num-target-rows-copied",
mergeSummary.numTargetRowsCopied());
+ setIfPositive(
+ operation,
+ "spark.merge-into.num-target-rows-deleted",
+ mergeSummary.numTargetRowsDeleted());
+ setIfPositive(
+ operation,
+ "spark.merge-into.num-target-rows-updated",
+ mergeSummary.numTargetRowsUpdated());
+ setIfPositive(
+ operation,
+ "spark.merge-into.num-target-rows-inserted",
+ mergeSummary.numTargetRowsInserted());
+ setIfPositive(
+ operation,
+ "spark.merge-into.num-target-rows-matched-updated",
+ mergeSummary.numTargetRowsMatchedUpdated());
+ setIfPositive(
+ operation,
+ "spark.merge-into.num-target-rows-matched-deleted",
+ mergeSummary.numTargetRowsMatchedDeleted());
+ setIfPositive(
+ operation,
+ "spark.merge-into.num-target-rows-not-matched-by-source-updated",
+ mergeSummary.numTargetRowsNotMatchedBySourceUpdated());
+ setIfPositive(
+ operation,
+ "spark.merge-into.num-target-rows-not-matched-by-source-deleted",
+ mergeSummary.numTargetRowsNotMatchedBySourceDeleted());
+ }
+
+ private void setIfPositive(SnapshotUpdate<?> operation, String key, long
value) {
+ if (value >= 0) {
+ operation.set(key, String.valueOf(value));
+ }
+ }
Review Comment:
yea good call, i made a new base class and put the duplicate method there
--
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]