Skip to content

[SPARK-30312][SQL][FOLLOWUP] Use inequality check instead to be robust #27175

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

Closed
wants to merge 1 commit into from

Conversation

viirya
Copy link
Member

@viirya viirya commented Jan 11, 2020

What changes were proposed in this pull request?

This is a followup to fix a brittle assert in a test case.

Why are the changes needed?

Original assert assumes that default permission is rwxr-xr-x, but in jenkins env it could be rwxrwxr-x.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Unit test.

@viirya
Copy link
Member Author

viirya commented Jan 11, 2020

cc @dongjoon-hyun

@@ -2052,7 +2052,7 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils {

val fileStatus2 = fs.getFileStatus(tablePath)
if (ignore) {
assert(fileStatus2.getPermission().toString() == "rwxr-xr-x")
assert(fileStatus2.getPermission().toString() != "rwxrwxrwx")
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a loose condition. I think it is rarely to have default file permission as rwxrwxrwx. Another option is not to check permission when ignore is true.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

Thank you for quick follow up.
+1, LGTM as a quick fix on Jenkins environment.

@dongjoon-hyun
Copy link
Member

The PR builder is not helpful for this because PR builder has only one umask which already passed in the previous test.

@dongjoon-hyun
Copy link
Member

I verified this patch manually with a different umask. Merged to master/2.4.

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-30312][SQL][FOLLOWUP] Preserve path permission and acl when truncate table [SPARK-30312][SQL][FOLLOWUP] Use inequality check instead to be robust Jan 11, 2020
dongjoon-hyun pushed a commit that referenced this pull request Jan 11, 2020
### What changes were proposed in this pull request?

This is a followup to fix a brittle assert in a test case.

### Why are the changes needed?

Original assert assumes that default permission is `rwxr-xr-x`, but in jenkins [env](https://amplab.cs.berkeley.edu/jenkins/view/Spark%20QA%20Test%20(Dashboard)/job/spark-master-test-maven-hadoop-2.7-hive-1.2/6/testReport/junit/org.apache.spark.sql.execution.command/InMemoryCatalogedDDLSuite/SPARK_30312__truncate_table___keep_acl_permission/) it could be `rwxrwxr-x`.

### Does this PR introduce any user-facing change?

No

### How was this patch tested?

Unit test.

Closes #27175 from viirya/hot-fix.

Authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
(cherry picked from commit b044071)
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
@SparkQA
Copy link

SparkQA commented Jan 11, 2020

Test build #116531 has finished for PR 27175 at commit 52067a3.

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

@viirya viirya deleted the hot-fix branch December 27, 2023 18:38
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.

3 participants