cloud-fan commented on a change in pull request #29767:
URL: https://github.com/apache/spark/pull/29767#discussion_r490003646



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamWriter.scala
##########
@@ -300,54 +301,54 @@ final class DataStreamWriter[T] private[sql](ds: 
Dataset[T]) {
         "write files of Hive data source directly.")
     }
 
-    if (source == "memory") {
+    if (source == SOURCE_NAME_TABLE) {
+      assertNotPartitioned("table")
+
+      import 
df.sparkSession.sessionState.analyzer.{NonSessionCatalogAndIdentifier, 
SessionCatalogAndIdentifier}
+
+      import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._
+      val tableInstance = df.sparkSession.sessionState.sqlParser
+        .parseMultipartIdentifier(tableName) match {
+
+        case NonSessionCatalogAndIdentifier(catalog, ident) =>
+          catalog.asTableCatalog.loadTable(ident)
+
+        case SessionCatalogAndIdentifier(catalog, ident) =>

Review comment:
       shall we just use `CatalogAndIdentifier`?




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



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

Reply via email to