pan3793 commented on code in PR #7318:
URL: https://github.com/apache/kyuubi/pull/7318#discussion_r2745789063
##########
dev/kyuubi-tpcds/src/main/scala/org/apache/kyuubi/tpcds/benchmark/TPCDS.scala:
##########
@@ -17,12 +17,44 @@
package org.apache.kyuubi.tpcds.benchmark
+import scala.io.{Codec, Source}
+
import org.apache.spark.sql.SparkSession
+import org.apache.kyuubi.tpcds.benchmark.ExecutionMode._
+
/**
* TPC-DS benchmark's dataset.
*/
class TPCDS(@transient sparkSession: SparkSession)
extends Benchmark(sparkSession)
with TPCDS_2_4_Queries
- with Serializable {}
+ with Serializable {
+
+ override val tpcds2_4Queries: Seq[Query] = queryNames.map { queryName =>
+ val in =
getClass.getClassLoader.getResourceAsStream(s"tpcds_2_4/$queryName.sql")
+ var queryContent: String = ""
+ try {
+ queryContent = Source.fromInputStream(in)(Codec.UTF8).mkString
Review Comment:
```suggestion
val queryContent = try {
Source.fromInputStream(in)(Codec.UTF8).mkString
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]