vvysotskyi commented on a change in pull request #1810: DRILL-7271: Refactor 
Metadata interfaces and classes to contain all needed information for the File 
based Metastore
URL: https://github.com/apache/drill/pull/1810#discussion_r296251507
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/BaseParquetMetadataProvider.java
 ##########
 @@ -342,17 +350,13 @@ public TableMetadata getTableMetadata() {
 
   @Override
   public FileMetadata getFileMetadata(Path location) {
-    return getFilesMetadata().stream()
-        .filter(Objects::nonNull)
-        .filter(fileMetadata -> location.equals(fileMetadata.getLocation()))
-        .findAny()
-        .orElse(null);
+    return getFilesMetadataMap().get(location);
   }
 
   @Override
   public List<FileMetadata> getFilesForPartition(PartitionMetadata partition) {
-    return getFilesMetadata().stream()
-        .filter(file -> partition.getLocations().contains(file.getLocation()))
+    return partition.getLocations().stream()
+        .map(location -> getFilesMetadataMap().get(location))
 
 Review comment:
   Thanks, 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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to