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_r314391382
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala
 ##########
 @@ -835,14 +832,12 @@ final class DataFrameWriter[T] private[sql](ds: 
Dataset[T]) {
 
   private def modeForDSV2 = mode.getOrElse(SaveMode.Append)
 
-  private def canUseV2Source(session: SparkSession, providerClass: Class[_]): 
Boolean = {
-    val useV1Sources =
-      
session.sessionState.conf.useV1SourceWriterList.toLowerCase(Locale.ROOT).split(",")
-    val shouldUseV1Source = providerClass.newInstance() match {
-      case d: DataSourceRegister if useV1Sources.contains(d.shortName()) => 
true
-      case _ => 
useV1Sources.contains(providerClass.getCanonicalName.toLowerCase(Locale.ROOT))
+  private def lookupV2Provider() = {
+    DataSource.lookupDataSourceV2(source, df.sparkSession.sessionState.conf) 
match {
+      // File source v2 write path is currently broken.
+      case Some(_: FileDataSourceV2) => None
 
 Review comment:
   This is better than before, which use configs to disable file source v2 
write: 
https://github.com/apache/spark/pull/25465/files#diff-9a6b543db706f1a90f790783d6930a13L1605
   
   configs can be changed, and we shouldn't allow users to use the broken file 
source v2 write.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to