LuciferYang commented on a change in pull request #31294:
URL: https://github.com/apache/spark/pull/31294#discussion_r562573591
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogVersionsSuite.scala
##########
@@ -237,17 +237,20 @@ class HiveExternalCatalogVersionsSuite extends
SparkSubmitTestUtils {
}
object PROCESS_TABLES extends QueryTest with SQLTestUtils {
- val releaseMirror = "https://dist.apache.org/repos/dist/release"
+ val releaseMirror = sys.env.getOrElse("SPARK_RELEASE_MIRROR",
+ "https://dist.apache.org/repos/dist/release")
// Tests the latest version of every release line.
val testingVersions: Seq[String] = {
import scala.io.Source
val versions: Seq[String] = try {
- Source.fromURL(s"${releaseMirror}/spark").mkString
- .split("\n")
- .filter(_.contains("""<li><a href="spark-"""))
- .filterNot(_.contains("preview"))
- .map("""<a
href="spark-(\d.\d.\d)/">""".r.findFirstMatchIn(_).get.group(1))
- .filter(_ < org.apache.spark.SPARK_VERSION)
+ Utils.tryWithResource(Source.fromURL(s"$releaseMirror/spark")) {
htmlContent =>
Review comment:
`Source.fromURL(s"${releaseMirror}/spark").mkString` not close
connection from `ource.fromURL(s"${releaseMirror}/spark")`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]