Github user amansinha100 commented on a diff in the pull request: https://github.com/apache/drill/pull/1141#discussion_r171611927 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentStats.java --- @@ -79,4 +71,21 @@ public void addOperatorStats(OperatorStats stats) { operators.add(stats); } + //DRILL-6197 + public OperatorStats addOrReplaceOperatorStats(OperatorStats stats) { + //Remove existing stat + OperatorStats replacedStat = null; + int index = 0; + for (OperatorStats opStat : operators) { --- End diff -- I am worried about the small overheads of doing this linear search adding up for each operator, especially for queries with complex query plans. The stats collection should ideally impose minimal overhead. Does the operator stats have to be a list or can just use a Set ?
---