jackye1995 commented on a change in pull request #3056:
URL: https://github.com/apache/iceberg/pull/3056#discussion_r805458009



##########
File path: 
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java
##########
@@ -244,10 +244,19 @@ public SparkTable alterTable(Identifier ident, 
TableChange... changes) throws No
 
   @Override
   public boolean dropTable(Identifier ident) {
+    return dropTableInternal(ident, false);
+  }
+
+  @Override
+  public boolean purgeTable(Identifier ident) {
+    return dropTableInternal(ident, true);
+  }
+
+  private boolean dropTableInternal(Identifier ident, boolean purge) {
     try {
       return isPathIdentifier(ident) ?
-          tables.dropTable(((PathIdentifier) ident).location()) :
-          icebergCatalog.dropTable(buildIdentifier(ident));
+          tables.dropTable(((PathIdentifier) ident).location(), purge) :

Review comment:
       > I'm not sure I agree that it maps perfectly. This is a way to register 
a table with a catalog, after which the catalog owns it like any other table.
   
   probably too strong to say "perfectly". I am saying this not because I think 
it that way, but because multiple data engineers have asked me if they could 
use CREATE EXTERNAL TABLE to execute that `registerTable` feature. So from 
anecdotal evidence I think people will think in that way. Maybe we should call 
it something like `reviveTable` or expose it as a Spark procedure instead of 
making it a part of the catalog interface.
   
   > I'm not sure that I would want a SHARED keyword 
   
   I am not trying to promote a new keyword, I think we need a new concept to 
explain the difference from the traditional definition of external/managed 
tables.
   
   > Also, I consider the data/file ownership a separate problem, so you may 
want to keep them separate in design docs or proposals
   
   I think it's hard to not mention them together because owning a table has 
implicit relationship with owning the file paths and files of the table. But we 
can discuss this further, I will update in a new devlist thread.




-- 
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