AlexanderKM commented on code in PR #16635:
URL: https://github.com/apache/pinot/pull/16635#discussion_r2298878493


##########
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:
   Hello, I updated this to use a "segment_metadata" subdir and move the files 
into there. I also added some unit tests around this. Let me know if this looks 
better @Jackie-Jiang 



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