MaxGekk commented on a change in pull request #29984:
URL: https://github.com/apache/spark/pull/29984#discussion_r502243128
##########
File path: mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala
##########
@@ -105,13 +105,15 @@ object MLUtils extends Logging {
}
private[spark] def parseLibSVMFile(
- sparkSession: SparkSession, paths: Seq[String]): RDD[(Double,
Array[Int], Array[Double])] = {
+ sparkSession: SparkSession,
+ paths: Seq[String],
+ options: Map[String, String]): RDD[(Double, Array[Int], Array[Double])]
= {
val lines = sparkSession.baseRelationToDataFrame(
DataSource.apply(
sparkSession,
paths = paths,
className = classOf[TextFileFormat].getName,
- options = Map(DataSource.GLOB_PATHS_KEY -> "false")
+ options = options ++ Map(DataSource.GLOB_PATHS_KEY -> "false")
Review comment:
This is similar to CSV/JSON datasource:
https://github.com/apache/spark/blob/954cd9feaa1a3d4ad9a235811ae58e02a63e8386/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVDataSource.scala#L158
##########
File path:
mllib/src/test/scala/org/apache/spark/ml/source/libsvm/LibSVMRelationSuite.scala
##########
@@ -27,12 +27,13 @@ import org.apache.spark.ml.attribute.AttributeGroup
import org.apache.spark.ml.linalg.{DenseVector, SparseVector, Vector, Vectors}
import org.apache.spark.ml.linalg.SQLDataTypes.VectorType
import org.apache.spark.mllib.util.MLlibTestSparkContext
-import org.apache.spark.sql.{Row, SaveMode}
+import org.apache.spark.sql.{FakeFileSystemRequiringDSOption, Row, SaveMode}
+import org.apache.spark.sql.catalyst.plans.SQLHelper
import org.apache.spark.sql.types.{DoubleType, StructField, StructType}
import org.apache.spark.util.Utils
-class LibSVMRelationSuite extends SparkFunSuite with MLlibTestSparkContext {
+class LibSVMRelationSuite extends SparkFunSuite with MLlibTestSparkContext
with SQLHelper {
Review comment:
Added `SQLHelper` for `withSQLConf`
----------------------------------------------------------------
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]