Jackie-Jiang commented on code in PR #16635:
URL: https://github.com/apache/pinot/pull/16635#discussion_r2292373360


##########
pinot-core/src/main/java/org/apache/pinot/core/metadata/DefaultMetadataExtractor.java:
##########
@@ -35,7 +36,12 @@ public SegmentMetadata extractMetadata(File 
tarredSegmentFile, File unzippedSegm
       throws Exception {
     // NOTE: While there is TarGzCompressionUtils.untarOneFile(), we use 
untar() here to unpack all files in the segment
     //       in order to ensure the segment is not corrupted.
-    File indexDir = TarCompressionUtils.untar(tarredSegmentFile, 
unzippedSegmentDir).get(0);
-    return new SegmentMetadataImpl(indexDir);
+    List<File> untarredFiles = TarCompressionUtils.untar(tarredSegmentFile, 
unzippedSegmentDir);
+    File indexDir = untarredFiles.get(0);
+    if (indexDir.isDirectory()) {
+      return new SegmentMetadataImpl(indexDir);
+    } else {
+      return new SegmentMetadataImpl(untarredFiles);

Review Comment:
   An easier way to handle this is to create a directory and move the files 
into the directory. This way we don't need to change other classes



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