You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/12/06 01:38:35 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #1879: Core: Support TableBuilder in CachingCatalog

rdblue commented on a change in pull request #1879:
URL: https://github.com/apache/iceberg/pull/1879#discussion_r536930541



##########
File path: core/src/main/java/org/apache/iceberg/CachingCatalog.java
##########
@@ -99,36 +99,35 @@ public Table loadTable(TableIdentifier ident) {
   @Override
   public Table createTable(TableIdentifier ident, Schema schema, PartitionSpec spec, String location,
                            Map<String, String> properties) {
-    AtomicBoolean created = new AtomicBoolean(false);
-    Table table = tableCache.get(canonicalizeIdentifier(ident), identifier -> {
-      created.set(true);
-      return catalog.createTable(identifier, schema, spec, location, properties);
-    });
-
-    if (!created.get()) {
-      throw new AlreadyExistsException("Table already exists: %s", ident);
-    }
-
-    return table;
+    return buildTable(ident, schema)
+        .withPartitionSpec(spec)
+        .withLocation(location)
+        .withProperties(properties)
+        .create();

Review comment:
       We should consider moving these to be default implementations in the interface.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org