nastra commented on code in PR #16881:
URL: https://github.com/apache/iceberg/pull/16881#discussion_r3457883650


##########
core/src/main/java/org/apache/iceberg/ScanTaskParser.java:
##########
@@ -113,19 +113,12 @@ private static FileScanTask fromJson(JsonNode jsonNode, 
boolean caseSensitive) {
       taskType = TaskType.fromTypeName(taskTypeStr);
     }
 
-    switch (taskType) {
-      case FILE_SCAN_TASK:
-        return FileScanTaskParser.fromJson(jsonNode, caseSensitive);
-      case DATA_TASK:
-        return DataTaskParser.fromJson(jsonNode);
-      case FILES_TABLE_TASK:
-        return FilesTableTaskParser.fromJson(jsonNode);
-      case ALL_MANIFESTS_TABLE_TASK:
-        return AllManifestsTableTaskParser.fromJson(jsonNode);
-      case MANIFEST_ENTRIES_TABLE_TASK:
-        return ManifestEntriesTableTaskParser.fromJson(jsonNode);
-      default:
-        throw new UnsupportedOperationException("Unsupported task type: " + 
taskType.typeName());
-    }
+    return switch (taskType) {
+      case FILE_SCAN_TASK -> FileScanTaskParser.fromJson(jsonNode, 
caseSensitive);
+      case DATA_TASK -> DataTaskParser.fromJson(jsonNode);
+      case FILES_TABLE_TASK -> FilesTableTaskParser.fromJson(jsonNode);
+      case ALL_MANIFESTS_TABLE_TASK -> 
AllManifestsTableTaskParser.fromJson(jsonNode);
+      case MANIFEST_ENTRIES_TABLE_TASK -> 
ManifestEntriesTableTaskParser.fromJson(jsonNode);

Review Comment:
   hm nvm, in this case I think this would have already been handled inside 
`TaskType.fromTypeName()`



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