cloud-fan commented on a change in pull request #25465: [SPARK-28747][SQL] 
merge the two data source v2 fallback configs
URL: https://github.com/apache/spark/pull/25465#discussion_r316472090
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceResolution.scala
 ##########
 @@ -182,21 +180,13 @@ case class DataSourceResolution(
 
   }
 
-  object V1WriteProvider {
-    private val v1WriteOverrideSet =
-      conf.useV1SourceWriterList.toLowerCase(Locale.ROOT).split(",").toSet
-
+  object V1Provider {
     def unapply(provider: String): Option[String] = {
-      if (v1WriteOverrideSet.contains(provider.toLowerCase(Locale.ROOT))) {
-        Some(provider)
-      } else {
-        lazy val providerClass = DataSource.lookupDataSource(provider, conf)
-        provider match {
-          case _ if classOf[TableProvider].isAssignableFrom(providerClass) =>
-            None
-          case _ =>
-            Some(provider)
-        }
+      DataSource.lookupDataSourceV2(provider, conf) match {
+        // TODO(SPARK-28396): Currently file source v2 can't work with tables.
+        case Some(_: FileDataSourceV2) => Some(provider)
 
 Review comment:
   see https://github.com/apache/spark/pull/25465/files#r316472026

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


With regards,
Apache Git Services

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

Reply via email to