This is an automated email from the ASF dual-hosted git repository.

luoc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git


The following commit(s) were added to refs/heads/master by this push:
     new 5dea409  DRILL-8089: Separate the setup time for some operators(#2413)
5dea409 is described below

commit 5dea409b54703f0b15717745f66d2ea00ca66d45
Author: feiteng.wtf <[email protected]>
AuthorDate: Tue Dec 21 15:47:51 2021 +0800

    DRILL-8089: Separate the setup time for some operators(#2413)
---
 .../drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java | 4 +++-
 .../physical/impl/partitionsender/PartitionSenderRootExec.java     | 7 ++++++-
 .../drill/exec/physical/impl/project/ProjectRecordBatch.java       | 7 ++++++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java
index 73f4461..2d34fff 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java
@@ -619,7 +619,7 @@ public class MergingRecordBatch extends 
AbstractRecordBatch<MergingReceiverPOP>
    * @throws SchemaChangeException
    */
   private MergingReceiverGeneratorBase createMerger() {
-
+    stats.startSetup();
     final CodeGenerator<MergingReceiverGeneratorBase> cg =
         CodeGenerator.get(MergingReceiverGeneratorBase.TEMPLATE_DEFINITION,
             context.getOptions());
@@ -651,6 +651,8 @@ public class MergingRecordBatch extends 
AbstractRecordBatch<MergingReceiverPOP>
       return merger;
     } catch (SchemaChangeException e) {
       throw schemaChangeException(e, logger);
+    } finally {
+      stats.stopSetup();
     }
   }
 
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/partitionsender/PartitionSenderRootExec.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/partitionsender/PartitionSenderRootExec.java
index d2eea15..fc5da15 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/partitionsender/PartitionSenderRootExec.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/partitionsender/PartitionSenderRootExec.java
@@ -185,7 +185,12 @@ public class PartitionSenderRootExec extends BaseRootExec {
             partitioner.flushOutgoingBatches(false, true);
             partitioner.clear();
           }
-          createPartitioner();
+          try {
+            stats.startSetup();
+            createPartitioner();
+          } finally {
+            stats.stopSetup();
+          }
 
           if (first) {
             // Send an empty batch for fast schema
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
index 948f283..60f8a1e 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
@@ -123,7 +123,12 @@ public class ProjectRecordBatch extends 
AbstractSingleRecordBatch<Project> {
           } else if (next != IterOutcome.OK && next != 
IterOutcome.OK_NEW_SCHEMA && next != EMIT) {
             return next;
           } else if (next == IterOutcome.OK_NEW_SCHEMA) {
-            setupNewSchema();
+            try {
+              stats.startSetup();
+              setupNewSchema();
+            } finally {
+              stats.stopSetup();
+            }
           }
           incomingRecordCount = incoming.getRecordCount();
           memoryManager.update();

Reply via email to