Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15024#discussion_r86070169
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala
 ---
    @@ -541,3 +434,123 @@ case class DataSource(
         }
       }
     }
    +
    +object DataSource {
    +
    +  /** A map to maintain backward compatibility in case we move data 
sources around. */
    +  private val backwardCompatibilityMap: Map[String, String] = {
    +    val jdbc = classOf[JdbcRelationProvider].getCanonicalName
    +    val json = classOf[JsonFileFormat].getCanonicalName
    +    val parquet = classOf[ParquetFileFormat].getCanonicalName
    +    val csv = classOf[CSVFileFormat].getCanonicalName
    +    val libsvm = "org.apache.spark.ml.source.libsvm.LibSVMFileFormat"
    +    val orc = "org.apache.spark.sql.hive.orc.OrcFileFormat"
    +
    +    Map(
    +      "org.apache.spark.sql.jdbc" -> jdbc,
    +      "org.apache.spark.sql.jdbc.DefaultSource" -> jdbc,
    +      "org.apache.spark.sql.execution.datasources.jdbc.DefaultSource" -> 
jdbc,
    +      "org.apache.spark.sql.execution.datasources.jdbc" -> jdbc,
    +      "org.apache.spark.sql.json" -> json,
    +      "org.apache.spark.sql.json.DefaultSource" -> json,
    +      "org.apache.spark.sql.execution.datasources.json" -> json,
    +      "org.apache.spark.sql.execution.datasources.json.DefaultSource" -> 
json,
    +      "org.apache.spark.sql.parquet" -> parquet,
    +      "org.apache.spark.sql.parquet.DefaultSource" -> parquet,
    +      "org.apache.spark.sql.execution.datasources.parquet" -> parquet,
    +      "org.apache.spark.sql.execution.datasources.parquet.DefaultSource" 
-> parquet,
    +      "org.apache.spark.sql.hive.orc.DefaultSource" -> orc,
    +      "org.apache.spark.sql.hive.orc" -> orc,
    +      "org.apache.spark.ml.source.libsvm.DefaultSource" -> libsvm,
    +      "org.apache.spark.ml.source.libsvm" -> libsvm,
    +      "com.databricks.spark.csv" -> csv
    +    )
    +  }
    +
    +  /**
    +   * Class that were removed in Spark 2.0. Used to detect incompatibility 
libraries for Spark 2.0.
    +   */
    +  private val spark2RemovedClasses = Set(
    +    "org.apache.spark.sql.DataFrame",
    +    "org.apache.spark.sql.sources.HadoopFsRelationProvider",
    +    "org.apache.spark.Logging")
    +
    +  /** Given a provider name, look up the data source class definition. */
    +  def lookupDataSource(provider0: String): Class[_] = {
    --- End diff --
    
    why not just provider?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to