Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-49066][SQL][TESTS] Refactor
OrcEncryptionSuite
and make `spa…
…rk.hadoop.hadoop.security.key.provider.path` effective only within `OrcEncryptionSuite` ### What changes were proposed in this pull request? This pr moves the global scope test configuration `spark.hadoop.hadoop.security.key.provider.path`, which is configured in the parent `pom.xml` and `SparkBuild.scala`, to `OrcEncryptionSuite` to ensure that it is effective only within `OrcEncryptionSuite`. To achieve this, the pr also refactors `OrcEncryptionSuite`: 1. Overrides `beforeAll` to back up the contents of `CryptoUtils#keyProviderCache`. 2. Overrides `afterAll` to restore the contents of `CryptoUtils#keyProviderCache`. This ensures that `CryptoUtils#keyProviderCache` is isolated during the test process of `OrcEncryptionSuite`. ### Why are the changes needed? The test configuration `spark.hadoop.hadoop.security.key.provider.path` in the parent `pom.xml` and `SparkBuild.scala` is effective globally, which leads to the possibility that other Orc writing test cases, besides `OrcEncryptionSuite`, might also be affected by this configuration and use `test.org.apache.spark.sql.execution.datasources.orc.FakeKeyProvider.Factory`。 ### Does this PR introduce _any_ user-facing change? No, just for test. ### How was this patch tested? Pass GitHub Actions ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#47543 from LuciferYang/SPARK-49066. Authored-by: yangjie01 <yangjie01@baidu.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
- Loading branch information