HanumathRao commented on a change in pull request #1677: DRILL-7068: Support 
memory adjustment framework for resource manageme…
URL: https://github.com/apache/drill/pull/1677#discussion_r263651116
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/PhysicalPlanCreator.java
 ##########
 @@ -54,7 +56,11 @@ public QueryContext getContext() {
 
   public PhysicalOperator addMetadata(Prel originalPrel, PhysicalOperator op){
     op.setOperatorId(opIdMap.get(originalPrel).getAsSingleInt());
-    
op.setCost(originalPrel.estimateRowCount(originalPrel.getCluster().getMetadataQuery()));
+    PrelCostEstimates costEstimates = 
originalPrel.getCostEstimates(originalPrel.getCluster().getPlanner(), 
originalPrel.getCluster().getMetadataQuery());
+    if (!op.isBufferedOperator(context)) {
+      costEstimates = new 
PrelCostEstimates(context.getOptions().getLong(ExecConstants.OUTPUT_BATCH_SIZE),
 costEstimates.getOutputRowCount());
+    }
+    op.setCost(costEstimates);
 
 Review comment:
   Sure. It makes sense to put the all the code related at one place.

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