pan3793 commented on code in PR #7732:
URL: https://github.com/apache/iceberg/pull/7732#discussion_r1846854428


##########
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:
   @szehon-ho Hmm.. sorry I don't get your point.
   
   Let me explain my idea briefly, the test case should cover both the read and 
write paths:
   1. create a table, write some data into the table, and record the snapshot 
as `s1`
   2. overwrite the table with dynamic overwrite mode (test setting **write** 
options through session conf) and check the current snapshot of the table
   3. read the table from the snapshot `s1` (test setting **read** options 
through session conf) and check the data



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to