Skip to content

Conversation

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Jun 16, 2022

What changes were proposed in this pull request?

This PR aims to introduce a test environment variable SPARK_TEST_HIVE_CLIENT_VERSIONS to control the test target HiveClient Versions in HiveClientVersions trait.

Why are the changes needed?

Currently, HiveClientVersions is used in three test suites.

$ git grep 'with HiveClientVersions'
sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientSuites.scala:class HiveClientSuites extends SparkFunSuite with HiveClientVersions {
sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientUserNameSuites.scala:class HiveClientUserNameSuites extends Suite with HiveClientVersions {
sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HivePartitionFilteringSuites.scala:class HivePartitionFilteringSuites extends Suite with HiveClientVersions {

Does this PR introduce any user-facing change?

No. This is a test only change.

How was this patch tested?

Pass the CIs and manually test like the following.

SPARK_TEST_HIVE_CLIENT_VERSIONS='' build/sbt "hive/testOnly *.HiveClientSuites" -Phive
SPARK_TEST_HIVE_CLIENT_VERSIONS=3.1 build/sbt "hive/testOnly *.HiveClientSuites" -Phive
SPARK_TEST_HIVE_CLIENT_VERSIONS=3.0,3.1 build/sbt "hive/testOnly *.HiveClientSuites" -Phive

@github-actions github-actions bot added the SQL label Jun 16, 2022
@dongjoon-hyun
Copy link
Member Author

Could you review this, @sunchao ?

protected val versions = if (SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)) {
private val testVersions = sys.env.get("SPARK_TEST_HIVE_CLIENT_VERSIONS")
protected val versions = if (testVersions.nonEmpty) {
testVersions.get.split(",").map(_.strip).filter(_.nonEmpty).toIndexedSeq
Copy link
Member Author

Choose a reason for hiding this comment

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

Oops. I forgot that String.strip was added in Java 11.

@dongjoon-hyun
Copy link
Member Author

Thank you, @HyukjinKwon !

@dongjoon-hyun
Copy link
Member Author

All tests passed. Merged to master.

@dongjoon-hyun dongjoon-hyun deleted the SPARK-39495 branch June 17, 2022 01:46
@sunchao
Copy link
Member

sunchao commented Jun 17, 2022

Late LGTM too

@dongjoon-hyun
Copy link
Member Author

Thank you, @sunchao .

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