chenboat commented on a change in pull request #6567:
URL: https://github.com/apache/incubator-pinot/pull/6567#discussion_r595469435



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/api/upload/ZKOperator.java
##########
@@ -61,12 +61,15 @@ public void completeSegmentOperations(String rawTableName, 
SegmentMetadata segme
       URI finalSegmentLocationURI, File currentSegmentLocation, boolean 
enableParallelPushProtection,
       HttpHeaders headers, String zkDownloadURI, boolean 
moveSegmentToFinalLocation, String crypter)
       throws Exception {
-    String offlineTableName = 
TableNameBuilder.OFFLINE.tableNameWithType(rawTableName);
+    String tableNameWithType;
     String segmentName = segmentMetadata.getName();
 
-    // Brand new segment, not refresh, directly add the segment
-    ZNRecord segmentMetadataZnRecord =
-        
_pinotHelixResourceManager.getSegmentMetadataZnRecord(offlineTableName, 
segmentName);
+    if (_pinotHelixResourceManager.isRealtimeOnlyTable(rawTableName)) {
+      tableNameWithType = 
TableNameBuilder.REALTIME.tableNameWithType(rawTableName);
+    } else {
+      tableNameWithType= 
TableNameBuilder.OFFLINE.tableNameWithType(rawTableName);
+    }
+    ZNRecord segmentMetadataZnRecord = 
_pinotHelixResourceManager.getSegmentMetadataZnRecord(tableNameWithType, 
segmentName);
     if (segmentMetadataZnRecord == null) {
       LOGGER.info("Adding new segment {} from table {}", segmentName, 
rawTableName);

Review comment:
       done.




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

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