[HUDI-4056] Refine partition matching in when drop / truncate partition.#5533
Closed
jinxing64 wants to merge 1 commit intoapache:masterfrom
Closed
[HUDI-4056] Refine partition matching in when drop / truncate partition.#5533jinxing64 wants to merge 1 commit intoapache:masterfrom
jinxing64 wants to merge 1 commit intoapache:masterfrom
Conversation
Contributor
Author
|
wip |
849f505 to
551c71b
Compare
jinxing64
commented
May 9, 2022
| val tableName = generateTableName | ||
| val tablePath = s"${tmp.getCanonicalPath}/$tableName" | ||
|
|
||
| import spark.implicits._ |
Contributor
Author
There was a problem hiding this comment.
It makes no sense to config urlencode=false when partition value contains slash -- '/' , it brings much obstacles when parsing partition values from path, say when executing 'show partitions'. I replace "/" with "#", which triggers character escaping but doesn't break partition path parsing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the pull request
In current code, AlterHoodieTableDropPartitionCommand and TruncateHoodieTableCommand require all partition fields should be specified when droping / truncating partitions(s), otherwise complain with AnalyisException (HoodieSqlCommonUtils#normalizePartitionSpec).
But native Spark/Hive SQL have no such limitations – – partition matching is provided as a functionality helping user to manage partition(s) in an easy way. Say dropping partitions with a single SQL "alter table test drop partition (year='2020')", but rather to specify all the partitions from (year='2020', month='01', day='01') to (year='2020', month='12', day='31')
This PR propose to refine the partition matching logic when drop / truncate partition and remove the limitation mentioned above.
Brief change log
Verify this pull request
Committer checklist
Has a corresponding JIRA in PR title & commit
Commit message is descriptive of the change
CI is green
Necessary doc changes done or have another open PR
For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.