rdblue commented on code in PR #6755:
URL: https://github.com/apache/iceberg/pull/6755#discussion_r1097907981
##########
spark/v3.3/spark/src/test/java/org/apache/iceberg/spark/source/TestDataSourceOptions.java:
##########
@@ -448,4 +448,37 @@ public void testExtraSnapshotMetadataWithSQL() throws
InterruptedException, IOEx
Assert.assertTrue(threadNames.contains(null));
Assert.assertTrue(threadNames.contains("test-extra-commit-message-writer-thread"));
}
+
+ @Test
+ public void testExtraSnapshotMetadataForSqlInPySpark() throws IOException {
+ String tableLocation = temp.newFolder("iceberg-table").toString();
+ HadoopTables tables = new HadoopTables(CONF);
+
+ Table table =
+ tables.create(SCHEMA, PartitionSpec.unpartitioned(),
Maps.newHashMap(), tableLocation);
+
+ List<SimpleRecord> expectedRecords =
+ Lists.newArrayList(new SimpleRecord(1, "a"), new SimpleRecord(2, "b"));
+ Dataset<Row> originalDf = spark.createDataFrame(expectedRecords,
SimpleRecord.class);
+ originalDf.select("id",
"data").write().format("iceberg").mode("append").save(tableLocation);
+
spark.read().format("iceberg").load(tableLocation).createOrReplaceTempView("target");
+ spark.conf().set("spark.snapshot-property.extra-key", "someValue");
Review Comment:
We typically use `spark.iceberg` for Iceberg specific things. What do you
think about using that here instead of just `spark`?
--
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]