szehon-ho commented on code in PR #59683:
URL: https://github.com/apache/spark/pull/59683#discussion_r4353769069


##########
docs/sql-v2-data-sources.md:
##########
@@ -116,10 +117,16 @@ categories of metadata operations through Spark SQL.
 |--------|-------------|
 | `listTables(namespace)` | List tables in a namespace |
 | `loadTable(ident)` | Load a table by identifier |
-| `createTable(ident, columns, partitions, properties)` | Create a new table |
+| `createTable(ident, tableInfo)` | Create a new table from a 
[`TableInfo`](api/java/org/apache/spark/sql/connector/catalog/TableInfo.html) 
carrying columns, partitioning, properties, and constraints |
 | `alterTable(ident, changes...)` | Alter a table's schema, properties, or 
constraints |
 | `dropTable(ident)` | Drop a table |
 
+`createTable(ident, tableInfo)` is the form Spark calls (since 4.1.0). The 
older overloads
+`createTable(ident, columns, partitions, properties)` and `createTable(ident, 
schema, partitions, properties)`
+are deprecated (since 4.1.0 and 3.4.0 respectively); their default 
implementations delegate down the
+chain, so a catalog that overrides only the `TableInfo` form serves every 
`CREATE TABLE`,
+`REPLACE TABLE`, and CTAS path.

Review Comment:
   Could we qualify this claim for non-staging catalogs? For 
StagingTableCatalog, Spark calls stageCreate, stageReplace, or 
stageCreateOrReplace instead of createTable for the atomic CTAS and replacement 
paths. Their defaults delegate through the staging overloads and ultimately 
throw unless implemented, so overriding only createTable(Identifier, TableInfo) 
does not cover every path. It would help to mention the separate TableInfo 
staging methods 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.

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