[SPARK-32305][BUILD] Make mvn clean remove metastore_db and spark-warehouse
#29103
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 changes were proposed in this pull request?
Add additional configuration to
maven-clean-pluginto ensure cleanupmetastore_dbandspark-warehousedirectory when executemvn cleancommand.Why are the changes needed?
Now Spark support two version of build-in hive and there are some test generated meta data not in target dir like
metastore_db, they don't clean up automatically when we runmvn cleancommand.So if we run
mvn clean test -pl sql/hive -am -Phadoop-2.7 -Phive -Phive-1.2, themetastore_dbdir will created and meta data will remains after test complete.Then we need manual cleanup
metastore_dbdirectory to ensuremvn clean test -pl sql/hive -am -Phadoop-2.7 -Phivecommand use hive2.3 profile can succeed because the residual metastore data is not compatible.spark-warehousewill also cause test failure in some data residual scenarios because test case thinks that meta data should not exist.This pr is used to simplify manual cleanup
metastore_dbandspark-warehousedirectory operation.How was this patch tested?
Manual execute
mvn clean test -pl sql/hive -am -Phadoop-2.7 -Phive -Phive-1.2, then executemvn clean test -pl sql/hive -am -Phadoop-2.7 -Phive, both commands should succeed.