kbendick commented on code in PR #4632:
URL: https://github.com/apache/iceberg/pull/4632#discussion_r858325088


##########
core/src/main/java/org/apache/iceberg/MetadataUpdateParser.java:
##########
@@ -96,17 +109,42 @@ public static String toJson(MetadataUpdate metadataUpdate, 
boolean pretty) {
   public static void toJson(MetadataUpdate metadataUpdate, JsonGenerator 
generator) throws IOException {
     String updateAction = ACTIONS.get(metadataUpdate.getClass());
 
-    // Add shared `action` field used to differentiate between implementations 
of MetadataUpdate
     generator.writeStartObject();
     generator.writeStringField(ACTION, updateAction);
 
-    // Write subclass specific fields
     switch (updateAction) {
       case ASSIGN_UUID:
         throw new UnsupportedOperationException("Not Implemented: 
MetadataUpdate#toJson for AssignUUID");
       case UPGRADE_FORMAT_VERSION:
-        writeUpgradeFormatVersion((MetadataUpdate.UpgradeFormatVersion) 
metadataUpdate, generator);
+        writeAsUpgradeFormatVersion((MetadataUpdate.UpgradeFormatVersion) 
metadataUpdate, generator);
+        break;
+      case ADD_SCHEMA:
+        writeAsAddSchema((MetadataUpdate.AddSchema) metadataUpdate, generator);
+        break;
+      case SET_CURRENT_SCHEMA:
+        writeAsSetCurrentSchema((MetadataUpdate.SetCurrentSchema) 
metadataUpdate, generator);
         break;
+      case SET_DEFAULT_PARTITION_SPEC:
+        
writeAsSetDefaultPartitionSpec((MetadataUpdate.SetDefaultPartitionSpec) 
metadataUpdate, generator);
+        break;
+      case ADD_PARTITION_SPEC:
+        throw new UnsupportedOperationException("Not Implemented: 
MetadataUpdate#toJson for " + updateAction);
+      case ADD_SORT_ORDER:
+        throw new UnsupportedOperationException("Not Implemented: 
MetadataUpdate#toJson for " + updateAction);

Review Comment:
   Originally this used case fall through to get the process of listing all 
cases into the source code, but error prone complains when switch cases fall 
through.
   
   Same for the other 2 locations.



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