Github user JDrit commented on a diff in the pull request:
https://github.com/apache/spark/pull/7802#discussion_r36113628
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/ddl.scala ---
@@ -190,21 +194,19 @@ private[sql] class DDLParser(
}
}
-private[sql] object ResolvedDataSource {
-
- private val builtinSources = Map(
- "jdbc" -> "org.apache.spark.sql.jdbc.DefaultSource",
- "json" -> "org.apache.spark.sql.json.DefaultSource",
- "parquet" -> "org.apache.spark.sql.parquet.DefaultSource",
- "orc" -> "org.apache.spark.sql.hive.orc.DefaultSource"
- )
+private[sql] object ResolvedDataSource extends Logging {
/** Given a provider name, look up the data source class definition. */
def lookupDataSource(provider: String): Class[_] = {
val loader = Utils.getContextOrSparkClassLoader
-
- if (builtinSources.contains(provider)) {
- return loader.loadClass(builtinSources(provider))
+ val sl = ServiceLoader.load(classOf[DataSourceProvider], loader)
+
+ sl.iterator().filter(_.format() == provider).toList match {
+ case Nil => logInfo(s"provider: $provider is not registered in the
service loader")
--- End diff --
Changed this to logDebug
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]