[SPARK-52265][SQL][TEST] Fix regex leading to empty PROCESS_TABLES.testingVersions in HiveExternalCatalogVersionsSuite #50989
+3
−3
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?
Fix the version parsing logic in
HiveExternalCatalogVersionsSuite
to properly handle new artifact paths in https://dist.apache.org/repos/dist/release/spark/ so that "backward compatibility" test can be run.This change creates a constant
val SparkVersionPattern = """<a href="spark-(\d.\d.\d)/">""".r
for more precise version matching, and removes redundant.filterNot(_.contains("preview"))
which is no longer needed.Why are the changes needed?
The suite is failing to execute the "backward compatibility" test due to parsing errors with testing versions. The current implementation fails to parse versions when encountering new paths like
spark-connect-swift-0.1.0/
andspark-kubernetes-operator-0.1.0/
in https://dist.apache.org/repos/dist/release/spark/.This leads to
PROCESS_TABLES.testingVersions
being empty, and in turn a logError: "Exception encountered when invoking run on a nested suite - Fail to get the latest Spark versions to test". As a result, the condition is not met to run the test.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Executed local build and test for
HiveExternalCatalogVersionsSuite
:build/mvn -pl sql/hive-Dtest=none -DwildcardSuites=org.apache.spark.sql.hive.HiveExternalCatalogVersionsSuite test-compile scalatest:test
Verified that the reported error no longer appears, "backward compatibility" test runs successfully, and
PROCESS_TABLES.testingVersions
now correctly contains "3.5.5" when printed out, which was previously empty.Was this patch authored or co-authored using generative AI tooling?
No.