chinmay-bhat commented on code in PR #9380:
URL: https://github.com/apache/iceberg/pull/9380#discussion_r1446433055
##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/TestPartitionValues.java:
##########
@@ -102,35 +105,33 @@ public static Object[][] parameters() {
private static SparkSession spark = null;
- @BeforeClass
+ @BeforeAll
public static void startSpark() {
TestPartitionValues.spark =
SparkSession.builder().master("local[2]").getOrCreate();
}
- @AfterClass
+ @AfterAll
public static void stopSpark() {
SparkSession currentSpark = TestPartitionValues.spark;
TestPartitionValues.spark = null;
currentSpark.stop();
}
- @Rule public TemporaryFolder temp = new TemporaryFolder();
+ @TempDir private Path temp;
- private final String format;
- private final boolean vectorized;
+ @Parameter(index = 0)
+ private String format;
- public TestPartitionValues(String format, boolean vectorized) {
- this.format = format;
- this.vectorized = vectorized;
- }
+ @Parameter(index = 1)
+ private boolean vectorized;
- @Test
+ @TestTemplate
public void testNullPartitionValue() throws Exception {
String desc = "null_part";
- File parent = temp.newFolder(desc);
+ File parent = new File(temp.toFile(), desc);
Review Comment:
yup, it should have been `temp.resolve(desc)`.
When you read the below 3 lines together, at first glance it might seem like
line 1 is doing something completely different compared to line 2 and 3, even
though they're all creating `Files` hierarchically. To make it consistently
readable, I chose `new File(temp.toFile(), desc)`
```
File parent = temp.resolve(desc).toFile();
File location = new File(parent, "test");
File dataFolder = new File(location, "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: [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]