You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/11/22 19:54:07 UTC

[GitHub] [pinot] jackjlli commented on a change in pull request #7810: Handle table not found in replacing segment APIs

jackjlli commented on a change in pull request #7810:
URL: https://github.com/apache/pinot/pull/7810#discussion_r754590771



##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java
##########
@@ -554,11 +554,14 @@ public Response startReplaceSegments(
         throw new ControllerApplicationException(LOGGER, "Table type should either be offline or realtime",
             Response.Status.BAD_REQUEST);
       }
-      String tableNameWithType = TableNameBuilder.forType(tableType).tableNameWithType(tableName);
+      String tableNameWithType =
+          ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, tableType, LOGGER).get(0);
       String segmentLineageEntryId = _pinotHelixResourceManager
           .startReplaceSegments(tableNameWithType, startReplaceSegmentsRequest.getSegmentsFrom(),
               startReplaceSegmentsRequest.getSegmentsTo(), forceCleanup);
       return Response.ok(JsonUtils.newObjectNode().put("segmentLineageEntryId", segmentLineageEntryId)).build();
+    } catch (WebApplicationException wae) {

Review comment:
       Good catch! Added.




-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org