Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spark 3.5: Migrate tests to JUnit5 in data directory #9341

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void stopSpark() {

@Override
protected void writeAndValidate(Schema schema) throws IOException {
File parent = new File(temp.toFile(), "avro");
File parent = temp.resolve("avro").toFile();
File location = new File(parent, "test");
File dataFolder = new File(location, "data");
dataFolder.mkdirs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected void writeAndValidate(Schema schema) throws IOException {
@TestTemplate
public void testWriteWithCustomDataLocation() throws IOException {
File location = createTableFolder();
File tablePropertyDataLocation = new File(temp.toFile(), "test-table-property-data-dir");
File tablePropertyDataLocation = temp.resolve("test-table-property-data-dir").toFile();
Table table = createTable(new Schema(SUPPORTED_PRIMITIVES.fields()), location);
table
.updateProperties()
Expand All @@ -156,7 +156,7 @@ public void testWriteWithCustomDataLocation() throws IOException {
}

private File createTableFolder() throws IOException {
File parent = new File(temp.toFile(), "parquet");
File parent = temp.resolve("parquet").toFile();
File location = new File(parent, "test");
assertThat(location.mkdirs()).as("Mkdir should succeed").isTrue();
return location;
Expand Down Expand Up @@ -289,7 +289,7 @@ public void testNullableWithWriteOption() throws IOException {
.as("Spark 3 rejects writing nulls to a required column")
.startsWith("2");

File location = new File(new File(temp.toFile(), "parquet"), "test");
File location = new File(temp.resolve("parquet").toFile(), "test");
String sourcePath = String.format("%s/nullable_poc/sourceFolder/", location.toString());
String targetPath = String.format("%s/nullable_poc/targetFolder/", location.toString());

Expand Down Expand Up @@ -343,7 +343,7 @@ public void testNullableWithSparkSqlOption() throws IOException {
.as("Spark 3 rejects writing nulls to a required column")
.startsWith("2");

File location = new File(new File(temp.toFile(), "parquet"), "test");
File location = new File(temp.resolve("parquet").toFile(), "test");
chinmay-bhat marked this conversation as resolved.
Show resolved Hide resolved
String sourcePath = String.format("%s/nullable_poc/sourceFolder/", location.toString());
String targetPath = String.format("%s/nullable_poc/targetFolder/", location.toString());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void testEmptyTableProjection() throws IOException {
}

private Table createTable(Schema schema) throws IOException {
File parent = new File(temp.toFile(), "parquet");
File parent = temp.resolve("parquet").toFile();
File location = new File(parent, "test");
HadoopTables tables = new HadoopTables(CONF);
return tables.create(schema, PartitionSpec.unpartitioned(), location.toString());
Expand Down