pan3793 commented on code in PR #7732:
URL: https://github.com/apache/iceberg/pull/7732#discussion_r1847679472
##########
spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/source/TestIcebergSourceTablesBase.java:
##########
@@ -1953,6 +1953,65 @@ public void testTableWithInt96Timestamp() throws
IOException {
}
}
+ @Test
+ public void testSessionConfigSupport() {
+ PartitionSpec spec =
PartitionSpec.builderFor(SCHEMA).identity("id").build();
+ TableIdentifier tableIdentifier = TableIdentifier.of("db",
"session_config_table");
+ Table table = createTable(tableIdentifier, SCHEMA, spec);
+
+ List<SimpleRecord> records =
+ Lists.newArrayList(
+ new SimpleRecord(1, "a"), new SimpleRecord(2, "b"), new
SimpleRecord(3, "c"));
+
+ Dataset<Row> df = spark.createDataFrame(records, SimpleRecord.class);
+
+ df.select("id", "data")
+ .write()
+ .format("iceberg")
+ .mode(SaveMode.Append)
+ .save(loadLocation(tableIdentifier));
+
+ long snapshotId = table.currentSnapshot().snapshotId();
+
+ withSQLConf(
+ // set write option through session configuration
+ ImmutableMap.of("spark.datasource.iceberg.overwrite-mode", "dynamic"),
Review Comment:
Thanks for the detailed description. I am educated because I didn't know
that Iceberg can add custom snapshot properties through options. I update the
test case to follow the suggestions.
--
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]