danielcweeks commented on code in PR #14940:
URL: https://github.com/apache/iceberg/pull/14940#discussion_r2674018466


##########
bigquery/src/main/java/org/apache/iceberg/gcp/bigquery/BigQueryTableOperations.java:
##########
@@ -149,9 +155,15 @@ private void addConnectionIfProvided(Table tableBuilder, 
Map<String, String> met
   }
 
   /** Update table properties with concurrent update detection using etag. */
-  private void updateTable(
-      String oldMetadataLocation, String newMetadataLocation, TableMetadata 
metadata) {
-    Table table = client.load(tableReference);
+  private void updateTable(String newMetadataLocation, TableMetadata metadata) 
{
+    Table table = this.refreshedTable;
+    if (table == null) {
+      LOG.warn("Table not set from doRefresh() for {}, loading from BigQuery", 
tableName());
+      table = client.load(tableReference);
+    }
+
+    this.refreshedTable = null;

Review Comment:
   I would agree with @kevinjqliu's comment here. I think it's safe to assume 
that the member reference is not null (or we can add a check, but I don't see 
the scenario where we would reload). We also don't need the local variable in 
this case.



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