{"record":{"id":"ea497af40b07ac94","repo":"apache/iceberg","slug":"unknown-move-type","errorCode":null,"errorMessage":"Unknown move type: ","messagePattern":"Unknown move type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/SchemaUpdate.java","lineNumber":813,"sourceCode":"          break;\n\n        case BEFORE:\n          Types.NestedField before =\n              Iterables.find(reordered, field -> field.fieldId() == move.referenceFieldId());\n          int beforeIndex = reordered.indexOf(before);\n          // insert the new node at the index of the existing node\n          reordered.add(beforeIndex, toMove);\n          break;\n\n        case AFTER:\n          Types.NestedField after =\n              Iterables.find(reordered, field -> field.fieldId() == move.referenceFieldId());\n          int afterIndex = reordered.indexOf(after);\n          reordered.add(afterIndex + 1, toMove);\n          break;\n\n        default:\n          throw new UnsupportedOperationException(\"Unknown move type: \" + move.type());\n      }\n    }\n\n    return reordered;\n  }\n\n  /** Represents a requested column move in a struct. */\n  private static class Move {\n    private enum MoveType {\n      FIRST,\n      BEFORE,\n      AFTER\n    }\n\n    @Override\n    public String toString() {\n      String suffix = \"\";\n      if (type != MoveType.FIRST) {","sourceCodeStart":795,"sourceCodeEnd":831,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/SchemaUpdate.java#L795-L831","documentation":"When applying schema moves (Move.first, Move.before, Move.after) during SchemaUpdate.commit, an exhaustive switch over move.type() handles the known kinds. Any Move implementation outside the three supported kinds reaches the default branch and throws UnsupportedOperationException. This guards against future or custom move types the reordering logic does not implement.","triggerScenarios":"Applying a Move whose type() is not FIRST, BEFORE, or AFTER — normally only possible with a custom Move implementation or a version mismatch where a newer move kind is passed to an older SchemaUpdate.","commonSituations":"Mixed client/server versions during rolling upgrades; custom TableOperations or wrapped Move objects from another Iceberg-compatible implementation.","solutions":["Ensure the client library version producing the Move matches the version applying the update","Only construct moves via updateSchema().moveFirst/moveBefore/moveAfter","Upgrade iceberg-core so all Move types are supported"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (move.type() != Move.MoveType.FIRST && move.type() != Move.MoveType.BEFORE && move.type() != Move.MoveType.AFTER) { throw new IllegalArgumentException(\"Unsupported move type\"); }","typeGuard":null,"tryCatchPattern":"try { update.apply(); } catch (UnsupportedOperationException e) { if (e.getMessage().startsWith(\"Unknown move type\")) { /* version mismatch: upgrade client */ } else { throw e; } }","preventionTips":["Keep iceberg-core versions consistent across producer and consumer of schema updates","Only create moves via the public UpdateSchema.move* APIs","Avoid subclassing Move with custom types"],"tags":["schema","iceberg","unsupported-operation"],"backgroundTag":"unsupported-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}