rdblue commented on code in PR #4956:
URL: https://github.com/apache/iceberg/pull/4956#discussion_r889718080
##########
spark/v3.2/spark/src/test/java/org/apache/iceberg/spark/source/TestDataSourceOptions.java:
##########
@@ -404,4 +414,61 @@ public void testExtraSnapshotMetadata() throws IOException
{
Assert.assertTrue(table.currentSnapshot().summary().get("extra-key").equals("someValue"));
Assert.assertTrue(table.currentSnapshot().summary().get("another-key").equals("anotherValue"));
}
+
+ @Test
+ public void testExtraSnapshotMetadataWithSQL() throws IOException {
+ String tableLocation = temp.newFolder("iceberg-table").toString();
+ HadoopTables tables = new HadoopTables(CONF);
+ int threadsCount = 3;
+ ExecutorService executorService =
Executors.newFixedThreadPool(threadsCount, new ThreadFactory() {
Review Comment:
I don't think multi-threaded testing is needed. It's enough to know that
we're using a thread-local. This also is not guaranteed to run the way this
test assumes that it will. There is not a guarantee that the thread pool will
scale all the way up, and there's no guarantee that the tasks will each run in
a separate thread. I think it's likely that those will happen, but this could
still be a source of flakiness later on. Also, this doesn't necessarily test
that the thread-local is working properly because there's no guarantee of
concurrency across tasks.
While it's probably working the way you expect, there's no guarantee that it
must. So I'd prefer to keep the test simple.
--
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]