wgtmac commented on code in PR #1178:
URL: https://github.com/apache/iceberg-cpp/pull/1178#discussion_r4740431246


##########
src/iceberg/update/update_schema.cc:
##########
@@ -110,7 +111,8 @@ class ApplyChangesVisitor {
     auto moves_it = moves_.find(parent_id);
     if (moves_it != moves_.end() && !moves_it->second.empty()) {
       has_changes = true;
-      new_fields = MoveFields(std::move(new_fields), moves_it->second);
+      ICEBERG_ASSIGN_OR_RAISE(new_fields,
+                              MoveFields(std::move(new_fields), 
moves_it->second));

Review Comment:
   Moving `s.a` before `s.b` and then deleting both `s.b` and `s` now fails 
before the parent deletion takes effect. [Java skips the moves for a deleted 
struct](https://github.com/apache/iceberg/blob/d9d0b79d5d0f359ce8ba3c8c33d855ef5f8a8a99/core/src/main/java/org/apache/iceberg/SchemaUpdate.java#L642-L669).
 Can we guard this move block and add a regression test?
   
   ```suggestion
       if (!deletes_.contains(parent_id) &&
           moves_it != moves_.end() && !moves_it->second.empty()) {
         has_changes = true;
         ICEBERG_ASSIGN_OR_RAISE(new_fields,
                                 MoveFields(std::move(new_fields), 
moves_it->second));
   ```



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