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_r296767257
 
 

 ##########
 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:
   Thanks, formatted the code and added `BinaryOperator`.

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