CodingCat commented on code in PR #7649:
URL: https://github.com/apache/iceberg/pull/7649#discussion_r1204947138
##########
docs/spark-configuration.md:
##########
@@ -194,3 +194,20 @@ df.write
| check-ordering | true | Checks if input schema and table schema
are same |
| isolation-level | null | Desired isolation level for Dataframe overwrite
operations. `null` => no checks (for idempotent writes), `serializable` =>
check for concurrent inserts or deletes in destination partitions, `snapshot`
=> checks for concurrent deletes in destination partitions. |
| validate-from-snapshot-id | null | If isolation level is set, id of base
snapshot from which to check concurrent write conflicts into a table. Should be
the snapshot before any reads from the table. Can be obtained via [Table
API](../../api#table-metadata) or [Snapshots
table](../spark-queries#snapshots). If null, the table's oldest known snapshot
is used. |
+
+
+specifically, if you run SQL statements, you could use
`org.apache.iceberg.spark.CommitMetadata` to add entries with custom-keys and
corresponding values in the snapshot summary
+
+```java
+
+import org.apache.iceberg.spark.CommitMetadata;
+Map<String, String> properties = Maps.newHashMap();
+properties.put("writer-thread",
String.valueOf(Thread.currentThread().getName()));
+CommitMetadata.withCommitProperties(properties,
+ () -> {
+ spark.sql("DELETE FROM " + tableName + " where id = 1");
+ return 0;
+ },
+ RuntimeException.class);
+
+```
Review Comment:
updated
--
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]