cloud-fan commented on code in PR #50040: URL: https://github.com/apache/spark/pull/50040#discussion_r1965098875
########## sql/core/src/main/scala/org/apache/spark/sql/classic/DataFrameWriterV2.scala: ########## @@ -146,25 +148,30 @@ final class DataFrameWriterV2[T] private[sql](table: String, ds: Dataset[T]) /** @inheritdoc */ override def create(): Unit = { - val tableSpec = UnresolvedTableSpec( - properties = properties.toMap, - provider = provider, - optionExpression = OptionList(Seq.empty), - location = None, - comment = None, - collation = None, - serde = None, - external = false) runCommand( CreateTableAsSelect( UnresolvedIdentifier(tableName), partitioning.getOrElse(Seq.empty) ++ clustering, logicalPlan, - tableSpec, + buildTableSpec(), options.toMap, false)) } + private def buildTableSpec(): UnresolvedTableSpec = { + val ignorePathOption = sparkSession.sessionState.conf.getConf( + SQLConf.LEGACY_DF_WRITER_V2_IGNORE_PATH_OPTION) + UnresolvedTableSpec( + properties = properties.toMap, + provider = provider, + optionExpression = OptionList(Seq.empty), + location = if (ignorePathOption) None else CaseInsensitiveMap(options.toMap).get("path"), Review Comment: This is the actual change. -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org