aokolnychyi commented on a change in pull request #1409:
URL: https://github.com/apache/iceberg/pull/1409#discussion_r483045822
##########
File path: api/src/main/java/org/apache/iceberg/catalog/Catalog.java
##########
@@ -303,4 +304,105 @@ default boolean dropTable(TableIdentifier identifier) {
* @throws NoSuchTableException if the table does not exist
*/
Table loadTable(TableIdentifier identifier);
+
+ /**
+ * Instantiate a builder to create a table.
+ *
+ * @param identifier a table identifier
+ * @param schema a schema
+ * @return the builder to create a table
+ */
+ default Builder newTable(TableIdentifier identifier, Schema schema) {
Review comment:
Done.
##########
File path: api/src/main/java/org/apache/iceberg/catalog/Catalog.java
##########
@@ -303,4 +304,105 @@ default boolean dropTable(TableIdentifier identifier) {
* @throws NoSuchTableException if the table does not exist
*/
Table loadTable(TableIdentifier identifier);
+
+ /**
+ * Instantiate a builder to create a table.
+ *
+ * @param identifier a table identifier
+ * @param schema a schema
+ * @return the builder to create a table
+ */
+ default Builder newTable(TableIdentifier identifier, Schema schema) {
+ return new Builder(this, identifier, schema);
+ }
+
+ /**
+ * A builder used to create valid {@link Table tables}.
+ * <p>
+ * Call {@link #newTable(TableIdentifier, Schema)} to create a new builder.
+ */
+ class Builder {
+ private final Catalog catalog;
+ private final TableIdentifier identifier;
+ private final Schema schema;
+ private final Map<String, String> properties = new HashMap<>();
Review comment:
Done.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]