anoopj commented on code in PR #50137:
URL: https://github.com/apache/spark/pull/50137#discussion_r1979992466
##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/TableCatalog.java:
##########
@@ -311,4 +311,49 @@ default boolean purgeTable(Identifier ident) throws
UnsupportedOperationExceptio
*/
void renameTable(Identifier oldIdent, Identifier newIdent)
throws NoSuchTableException, TableAlreadyExistsException;
+
+ /**
+ * Instantiate a builder to create a table in the catalog.
+ *
+ * @param ident a table identifier.
+ * @param columns the columns of the new table.
+ * @return the TableBuilder to create a table.
+ */
+ default TableBuilder buildTable(Identifier ident, Column[] columns) {
Review Comment:
Wenchen is spot on. We are planning to reuse the interface for replace also
(future PR).
##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/TableCatalog.java:
##########
@@ -311,4 +311,49 @@ default boolean purgeTable(Identifier ident) throws
UnsupportedOperationExceptio
*/
void renameTable(Identifier oldIdent, Identifier newIdent)
throws NoSuchTableException, TableAlreadyExistsException;
+
+ /**
+ * Instantiate a builder to create a table in the catalog.
+ *
+ * @param ident a table identifier.
+ * @param columns the columns of the new table.
+ * @return the TableBuilder to create a table.
+ */
+ default TableBuilder buildTable(Identifier ident, Column[] columns) {
+ return new TableBuilderImpl(this, ident, columns);
+ }
+
+ /**
+ * Builder used to create tables.
+ *
+ * <p>Call {@link #buildTable(Identifier, Column[])} to create a new builder.
+ */
+ interface TableBuilder {
Review Comment:
Addressed below.
--
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]