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_r316954628
##########
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:
I'm talking about `spark.read.parquet(path)`. It's nothing about the
metastore, and the behavior is well defined in Spark 2.x:
1. if no schema is specified, e.g. `spark.read.parquet(path)`, then the
schema will be inferred.
2. if schema is specified by users, e.g.
`spark.read.schema(...).parquet(path)`, then schema inference will be skipped
and Spark fails at runtime if the specified schema doesn't match the actual
file schema.
I think what you were talking about `CREATE TABLE ... USING parquet`. This
is a different case and currently file source v2 is already disabled for it.
----------------------------------------------------------------
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]