You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/09 07:34:51 UTC

[GitHub] [spark] MaxGekk opened a new pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

MaxGekk opened a new pull request #29984:
URL: https://github.com/apache/spark/pull/29984


   ### What changes were proposed in this pull request?
   Propagate LibSVM options to Hadoop configs in the LibSVM datasource.
   
   ### Why are the changes needed?
   There is a bug that when running:
   ```scala
   spark.read.format("libsvm").options(conf).load(path)
   ```
   The underlying file system will not receive the `conf` options.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes
   
   ### How was this patch tested?
   Added UT to `LibSVMRelationSuite`.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706023220






----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk commented on a change in pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
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




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706023220


   **[Test build #129578 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129578/testReport)** for PR 29984 at commit [`3fd854c`](https://github.com/apache/spark/commit/3fd854c92ad6bb0eff45d2f740f5394780bf9297).


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706048975






----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk commented on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706025240






----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk commented on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706025240


   @HyukjinKwon @dongjoon-hyun @srowen I have found one more datasource where options are not propagated to hadoop configs. I hope this is the last one. Please, review this PR. It is similar to https://github.com/apache/spark/pull/29976


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706041283


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34183/
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk commented on a change in pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #29984:
URL: https://github.com/apache/spark/pull/29984#discussion_r502243364



##########
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706052244


   **[Test build #129578 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129578/testReport)** for PR 29984 at commit [`3fd854c`](https://github.com/apache/spark/commit/3fd854c92ad6bb0eff45d2f740f5394780bf9297).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706048975






----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706048975






----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706052617






----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706048952


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/34183/
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun closed pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #29984:
URL: https://github.com/apache/spark/pull/29984


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706023220


   **[Test build #129578 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129578/testReport)** for PR 29984 at commit [`3fd854c`](https://github.com/apache/spark/commit/3fd854c92ad6bb0eff45d2f740f5394780bf9297).


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk commented on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706101300


   Here is a backport to 3.0: https://github.com/apache/spark/pull/29986


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun closed pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #29984:
URL: https://github.com/apache/spark/pull/29984


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk commented on a change in pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706048975






----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29984: [SPARK-33101][ML] Make LibSVM format propagate Hadoop config from DS options to underlying HDFS file system

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29984:
URL: https://github.com/apache/spark/pull/29984#issuecomment-706023220


   **[Test build #129578 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/129578/testReport)** for PR 29984 at commit [`3fd854c`](https://github.com/apache/spark/commit/3fd854c92ad6bb0eff45d2f740f5394780bf9297).


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org