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-32481][TESTS][FOLLOWUP] Use different directory name for MacOS #29550

Closed
wants to merge 1 commit into from

Conversation

Udbhav30
Copy link
Contributor

What changes were proposed in this pull request?

This is a followup of #29387 to correct the test-case.

Why are the changes needed?

trashRoot is always present in macOS, so it's better to use exact trashPath to check if data is moved to trash.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Test modified

@Udbhav30
Copy link
Contributor Author

@LuciferYang I think this should be ok

@@ -3116,16 +3116,17 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils {
.getTableMetadata(TableIdentifier("tab1")).storage.locationUri.get)

val fs = tablePath.getFileSystem(hadoopConf)
val trashRoot = fs.getTrashRoot(tablePath)
assert(!fs.exists(trashRoot))
val trashCurrent = new Path(fs.getTrashRoot(tablePath), "Current")
Copy link
Member

@HyukjinKwon HyukjinKwon Aug 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make a fake file system (that extends FileSystem) and use a temporary directory?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for @HyukjinKwon 's suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hii @HyukjinKwon, but Trash.moveToAppropriateTrash will always move the data to trashCurrent. can you guide me on what you mean by using a temporary directory instead.

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-32481][FOLLOWUP] Correct testcase [SPARK-32481][TESTS][FOLLOWUP] Use different directory name for MacOS Aug 26, 2020
@dongjoon-hyun
Copy link
Member

ok to test

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Aug 26, 2020

The original commit is reverted due to the compilation error with Hadoop 2.7 profile. Since this PR get conflicted already, let's include this when we have a next main PR.

@SparkQA
Copy link

SparkQA commented Aug 26, 2020

Test build #127931 has finished for PR 29550 at commit 7c9fc86.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@ora-mayadong
Copy link

ora-mayadong commented Mar 25, 2022

@Udbhav30 hi, Udbhav30,Could you tell me which spark version you make that modification.Because we also want recovery product data when inserting overwrite wrong data or partition , i want to do the migration that we migrate you modification to Spark 2.4.2

@Udbhav30
Copy link
Contributor Author

@Udbhav30 hi, Udbhav30,Could you tell me which spark version you make that modification.Because we also want recovery product data when inserting overwrite wrong data or partition , i want to do the migration that we migrate you modification to Spark 2.4.2

This feature was merged in spark 3.1.0 but later it was reverted back. So spark doesn't have this feature right now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants