xinbinhuang commented on a change in pull request #3548:
URL: https://github.com/apache/iceberg/pull/3548#discussion_r749870629



##########
File path: 
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java
##########
@@ -222,11 +222,11 @@ public SparkTable alterTable(Identifier ident, 
TableChange... changes) throws No
     try {
       Table table = load(ident);
       commitChanges(table, setLocation, setSnapshotId, pickSnapshotId, 
propertyChanges, schemaChanges);
+      table.refresh();
+      return new SparkTable(table, false);

Review comment:
       I set  `refreshEagerly` here to `false` because I think it makes sense 
to returns a table with the state right after the update. Otherwise, if I 
understand correctly, the table might be updated from other places 
unintentionally. And this will cause bugs on code that relies on the table 
state right after the update.
   
   Besides, it seems that we always set this to false throughout the codebase 
atm.
   
   - `cacheEabled` is `true` by default: 
https://github.com/apache/iceberg/blob/36e261bb40a0502185621165e0fa3441d4273d11/spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java#L122
   - 
https://github.com/apache/iceberg/blob/36e261bb40a0502185621165e0fa3441d4273d11/spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java#L140
   - 
https://github.com/apache/iceberg/blob/36e261bb40a0502185621165e0fa3441d4273d11/spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/Spark3Util.java#L616




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