singhpk234 commented on code in PR #16024:
URL: https://github.com/apache/iceberg/pull/16024#discussion_r3175098330


##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -284,15 +282,18 @@ private CloseableIterable<FileScanTask> 
fetchPlanningResult() {
                         ErrorHandlers.planErrorHandler(),
                         parserContext);
 
-                if (response.planStatus() == PlanStatus.SUBMITTED) {
-                  throw new NotCompleteException();
-                } else if (response.planStatus() != PlanStatus.COMPLETED) {
-                  throw new IllegalStateException(
-                      String.format(
-                          "Invalid planStatus: %s for planId: %s", 
response.planStatus(), id));
+                switch (response.planStatus()) {
+                  case COMPLETED:
+                    result.set(response);
+                    break;
+                  case SUBMITTED:
+                    throw new NotCompleteException();
+                  case FAILED:
+                  case CANCELLED:
+                  default:
+                    throw new IllegalStateException(
+                        failureMessage(response.planStatus(), id, 
response.errorMessage()));
                 }

Review Comment:
   It was unit tested for pieces, but make sense to add e2e test



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