dimas-b commented on code in PR #3456:
URL: https://github.com/apache/polaris/pull/3456#discussion_r2699784143
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRestCatalogEventServiceDelegator.java:
##########
@@ -783,7 +787,14 @@ public Response commitTransaction(
new AttributeMap()
.put(EventAttributes.CATALOG_NAME, catalogName)
.put(EventAttributes.COMMIT_TRANSACTION_REQUEST,
commitTransactionRequest)));
- for (UpdateTableRequest req : commitTransactionRequest.tableChanges()) {
+ List<LoadTableResponse> loadTableResponses =
+ attributeMap.getRequired(EventAttributes.LOAD_TABLE_RESPONSES);
+ for (int i = 0; i < commitTransactionRequest.tableChanges().size(); i++) {
+ UpdateTableRequest req = commitTransactionRequest.tableChanges().get(i);
+ LoadTableResponse loadTableResponse =
+ loadTableResponses != null && i < loadTableResponses.size()
+ ? loadTableResponses.get(i)
+ : null;
Review Comment:
Good point :+1:
Since we already have `AttributeMap` as a context object for the whole
multi-table transaction, I believe putting complete data relevant to events
into it at the place of change (`IcebergCatalogHandler`) might be preferable.
Essentially, why bother with the not-so-imformative `LOAD_TABLE_RESPONSES`
property, when we can have a list of "table change" objects inside
`AttributeMap`?
In that regard, `AttributeMap` may become more of an "Catalog Operation Data
Accumulator" with a richer API for dealing with one or more tables per
operation. WDYT?
--
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]