[KYUUBI #3298][FOLLOWUP] Fix CI failure

### _Why are the changes needed?_

This pr is a follow-up, aims to fix CI failure due to https://github.com/apache/incubator-kyuubi/pull/3299#discussion_r953265471

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #3319 from Yikf/master.

Closes #3298

d0cba33f [yikf] [KYUUBI #3298][FOLLOWUP] Fix CI failure

Authored-by: yikf <yikaifei1@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
yikf 2022-08-24 11:54:36 +08:00 committed by Cheng Pan
parent ff52fff560
commit c01be3ae3d
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D
2 changed files with 11 additions and 2 deletions

View File

@ -17,6 +17,13 @@
package org.apache.kyuubi.tpcds.benchmark
import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.DurationInt
import scala.language.implicitConversions
import scala.util.{Failure => SFailure, Success, Try}
import scala.util.control.NonFatal
import org.apache.spark.sql.{DataFrame, Dataset, SparkSession}
// scalastyle:off
@ -36,7 +43,7 @@ abstract class Benchmark(
implicit protected def toOption[A](a: A): Option[A] = Option(a)
val buildInfo: Map[String, String] =
Try(Utils.getContextOrKyuubiClassLoader.loadClass("org.apache.spark.BuildInfo")).map { cls =>
Try(getClass.getClassLoader.loadClass("org.apache.spark.BuildInfo")).map { cls =>
cls.getMethods
.filter(_.getReturnType == classOf[String])
.filterNot(_.getName == "toString")

View File

@ -17,6 +17,8 @@
package org.apache.kyuubi.tpcds.benchmark
import scala.io.{Codec, Source}
/**
* This implements the official TPCDS v2.4 queries with only cosmetic modifications.
*/
@ -131,7 +133,7 @@ trait TPCDS_2_4_Queries extends Benchmark {
"ss_max")
val tpcds2_4Queries: Seq[Query] = queryNames.map { queryName =>
val in = Utils.getContextOrKyuubiClassLoader.getResourceAsStream(s"tpcds_2_4/$queryName.sql")
val in = getClass.getClassLoader.getResourceAsStream(s"tpcds_2_4/$queryName.sql")
val queryContent: String = Source.fromInputStream(in)(Codec.UTF8).mkString
in.close()