-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-52265][SQL][TEST] Fix regex leading to empty PROCESS_TABLES.testingVersions in HiveExternalCatalogVersionsSuite #50989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3d0bd4b
[SPARK-52265][SQL][TEST] Fix regex leading to empty PROCESS_TABLES.te…
efaracci018 65438aa
Merge branch 'apache:master' into fix-testingVersions
efaracci018 0d088c8
Ensures fix is compatible with Spark 4.0 release
efaracci018 ecb9835
Change match logic to scala_version instead of filename
efaracci018 7fa00e1
Adjusting formatting to camelCase
efaracci018 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,7 +96,10 @@ class HiveExternalCatalogVersionsSuite extends SparkSubmitTestUtils { | |
mirrors.distinct :+ "https://archive.apache.org/dist" :+ PROCESS_TABLES.releaseMirror | ||
logInfo(s"Trying to download Spark $version from $sites") | ||
for (site <- sites) { | ||
val filename = s"spark-$version-bin-hadoop3-scala2.13.tgz" | ||
val filename = version match { | ||
case v if v.startsWith("3") => s"spark-$version-bin-hadoop3-scala2.13.tgz" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: use "3." for the version match |
||
case _ => s"spark-$version-bin-hadoop3.tgz" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider using "4." for the version match and fail the test for unknown/not expected version. |
||
} | ||
val url = s"$site/spark/spark-$version/$filename" | ||
logInfo(s"Downloading Spark $version from $url") | ||
try { | ||
|
@@ -262,13 +265,13 @@ object PROCESS_TABLES extends QueryTest with SQLTestUtils { | |
val testingVersions: Seq[String] = if (isPythonVersionAvailable && | ||
SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_17)) { | ||
import scala.io.Source | ||
val SparkVersionPattern = """<a href="spark-(\d.\d.\d)/">""".r | ||
try Utils.tryWithResource( | ||
Source.fromURL(s"$releaseMirror/spark")) { source => | ||
source.mkString | ||
.split("\n") | ||
.filter(_.contains("""<a href="spark-""")) | ||
.filterNot(_.contains("preview")) | ||
.map("""<a href="spark-(\d.\d.\d)/">""".r.findFirstMatchIn(_).get.group(1)) | ||
.filter(SparkVersionPattern.unanchored.matches(_)) | ||
.map(SparkVersionPattern.findFirstMatchIn(_).get.group(1)) | ||
.filter(_ < org.apache.spark.SPARK_VERSION) | ||
.filterNot(skipReleaseVersions.contains).toImmutableArraySeq | ||
} catch { | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider
and define
using version match logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I've put up a revision with this change.