ankitsultana commented on code in PR #14494: URL: https://github.com/apache/pinot/pull/14494#discussion_r1849051190
########## pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java: ########## @@ -425,13 +426,14 @@ public SuccessResponse reloadSegment( /** * Helper method to find the existing table based on the given table name (with or without type suffix) and segment * name. - * TODO: Real-time table might also contain uploaded segments (not with LLC name), which is not handled here. */ private String getExistingTable(String tableName, String segmentName) { TableType tableType = TableNameBuilder.getTableTypeFromTableName(tableName); if (tableType == null) { // Derive table type from segment name if the given table name doesn't have type suffix - tableType = LLCSegmentName.isLLCSegment(segmentName) ? TableType.REALTIME : TableType.OFFLINE; Review Comment: Is it safe to assume that `UploadedRealtimeSegmentName.isUploadedRealtimeSegmentName(segmentName)` will not return true for an offline table? I saw that it simply checks for the count of double underscores and returns true if there are 4 of them. ``` /** * Checks if the segment name is of the format: {prefix}__{tableName}__{partitionId}__{creationTime}__{suffix} * @param segmentName * @return boolean true if the segment name is of the format: {prefix}__{tableName}__{partitionId}__{creationTime} * __{suffix} */ public static boolean isUploadedRealtimeSegmentName(String segmentName) { int numSeparators = 0; int index = 0; while ((index = segmentName.indexOf(SEPARATOR, index)) != -1) { numSeparators++; index += 2; // SEPARATOR.length() } return numSeparators == 4; } ``` -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org