Skip to content

[SPARK-30312][SQL][2.4] Preserve path permission and acl when truncate table #27173

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

Conversation

viirya
Copy link
Member

@viirya viirya commented Jan 11, 2020

What changes were proposed in this pull request?

This patch proposes to preserve existing permission/acls of paths when truncate table/partition.
Note that this is backport of #26956 to branch-2.4.

Why are the changes needed?

When Spark SQL truncates table, it deletes the paths of table/partitions, then re-create new ones. If permission/acls were set on the paths, the existing permission/acls will be deleted.

We should preserve the permission/acls if possible.

Does this PR introduce any user-facing change?

Yes. When truncate table/partition, Spark will keep permission/acls of paths.

How was this patch tested?

Unit test and manual test as shown in #26956.

@viirya
Copy link
Member Author

viirya commented Jan 11, 2020

cc @dongjoon-hyun

@dongjoon-hyun
Copy link
Member

Thank you so much, @viirya !

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-30312][SQL][BRANCH-2.4] Preserve path permission and acl when truncate table [SPARK-30312][SQL][2.4] Preserve path permission and acl when truncate table Jan 11, 2020
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.

+1, LGTM (Pending Jenkins)

@SparkQA
Copy link

SparkQA commented Jan 11, 2020

Test build #116517 has finished for PR 27173 at commit 454c71b.

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

@dongjoon-hyun
Copy link
Member

Merged to branch-2.4. Thank you, @viirya .

dongjoon-hyun pushed a commit that referenced this pull request Jan 11, 2020
…e table

### What changes were proposed in this pull request?

This patch proposes to preserve existing permission/acls of paths when truncate table/partition.
Note that this is backport of #26956 to branch-2.4.

### Why are the changes needed?

When Spark SQL truncates table, it deletes the paths of table/partitions, then re-create new ones. If permission/acls were set on the paths, the existing permission/acls will be deleted.

We should preserve the permission/acls if possible.

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

Yes. When truncate table/partition, Spark will keep permission/acls of paths.

### How was this patch tested?

Unit test and manual test as shown in #26956.

Closes #27173 from viirya/truncate-table-permission-2.4.

Authored-by: Liang-Chi Hsieh <liangchi@uber.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
@viirya viirya deleted the truncate-table-permission-2.4 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