yuchenhuo commented on a change in pull request #26957: [WIP][SPARK-30314] Add
identifier and catalog information to DataSourceV2Relation
URL: https://github.com/apache/spark/pull/26957#discussion_r365037021
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala
##########
@@ -258,20 +258,20 @@ final class DataFrameWriter[T] private[sql](ds:
Dataset[T]) {
val dsOptions = new CaseInsensitiveStringMap(options.asJava)
import
org.apache.spark.sql.execution.datasources.v2.DataSourceV2Implicits._
+ import df.sparkSession.sessionState.analyzer.catalogManager
mode match {
case SaveMode.Append | SaveMode.Overwrite =>
- val table = provider match {
+ val (table, catalogOpt, ident) = provider match {
case supportsExtract: SupportsCatalogOptions =>
val ident = supportsExtract.extractIdentifier(dsOptions)
- val sessionState = df.sparkSession.sessionState
val catalog = CatalogV2Util.getTableProviderCatalog(
- supportsExtract, sessionState.catalogManager, dsOptions)
+ supportsExtract, catalogManager, dsOptions)
- catalog.loadTable(ident)
+ (catalog.loadTable(ident), Some(catalog), Seq(ident))
case tableProvider: TableProvider =>
val t = tableProvider.getTable(dsOptions)
if (t.supports(BATCH_WRITE)) {
- t
+ (t, None, Seq.empty)
Review comment:
Any suggestion around what the identifier should be here?
----------------------------------------------------------------
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]