yyanyy commented on code in PR #57865:
URL: https://github.com/apache/spark/pull/57865#discussion_r3815665417


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/CatalogV2Util.scala:
##########
@@ -519,6 +520,52 @@ private[sql] object CatalogV2Util {
     catalog.asTableCatalog.loadTable(ident, context, stateOptions)
   }
 
+  /**
+   * Loads a table for a write, forwarding the required privileges and only 
the write options that
+   * the catalog declares may affect table state. The complete option map 
remains on the write
+   * relation for write planning.
+   */
+  def loadTableForV2Write(
+      catalog: CatalogPlugin,
+      ident: Identifier,
+      writePrivileges: Set[TableWritePrivilege],
+      options: CaseInsensitiveStringMap): Table = {
+    rejectTimeTravelOptionsForWrite(catalog, ident, options)
+    loadTableForWrite(catalog, ident, writePrivileges, options)
+  }
+
+  /**
+   * Loads a table for a write without validating the complete write option 
map. This is used by
+   * callers that must inspect whether the loaded table falls back to V1 
before applying V2-only
+   * option validation.
+   */
+  def loadTableForWrite(

Review Comment:
   I was also debating if I would prefer v2 vs a more descriptive name, but 
decided to keep v2 since it's shorter and the method itself is simple enough. 
Will rethink this and the consolidation in the same follow up mentioned above



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to