arina-ielchiieva 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_r296684303
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractGroupScanWithMetadata.java
 ##########
 @@ -666,27 +733,66 @@ protected void filterTableMetadata(FilterPredicate 
filterPredicate, Set<SchemaPa
     }
 
     /**
-     * Produces filtering of metadata at partition level.
+     * Produces filtering of metadata at segment level.
      *
      * @param optionManager     option manager
      * @param filterPredicate   filter expression
      * @param schemaPathsInExpr columns used in filter expression
      */
-    protected void filterPartitionMetadata(OptionManager optionManager,
-                                           FilterPredicate filterPredicate,
-                                           Set<SchemaPath> schemaPathsInExpr) {
+    protected void filterSegmentMetadata(OptionManager optionManager,
+                                         FilterPredicate filterPredicate,
+                                         Set<SchemaPath> schemaPathsInExpr) {
       if (!matchAllMetadata) {
-        if (!source.getPartitionsMetadata().isEmpty()) {
-          if (source.getPartitionsMetadata().size() <= optionManager.getOption(
-            
PlannerSettings.PARQUET_ROWGROUP_FILTER_PUSHDOWN_PLANNING_THRESHOLD)) {
+        if (!source.getSegmentsMetadata().isEmpty()) {
+          if (source.getSegmentsMetadata().size() <= optionManager.getOption(
+              
PlannerSettings.PARQUET_ROWGROUP_FILTER_PUSHDOWN_PLANNING_THRESHOLD)) {
             matchAllMetadata = true;
-            partitions = filterAndGetMetadata(schemaPathsInExpr, 
source.getPartitionsMetadata(), filterPredicate, optionManager);
+            segments = filterAndGetMetadata(schemaPathsInExpr,
+                source.getSegmentsMetadata().values(),
+                filterPredicate,
+                optionManager).stream()
+                    .collect(Collectors.toMap(SegmentMetadata::getPath, 
Function.identity()));
 
 Review comment:
   ```suggestion
                       .collect(Collectors.toMap(
                       SegmentMetadata::getPath,
                       Function.identity()));
   ```
   Plus what about duplicates handling? It would be safer to add `(o, n) -> n` 
but of course if you did not intend to fail on duplicate.

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


With regards,
Apache Git Services

Reply via email to