You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2018/07/11 20:13:47 UTC

[GitHub] ilooner commented on a change in pull request #1355: DRILL-6560: Enhanced the batch statistics logging enablement

ilooner commented on a change in pull request #1355: DRILL-6560: Enhanced the batch statistics logging enablement
URL: https://github.com/apache/drill/pull/1355#discussion_r201822765
 
 

 ##########
 File path: exec/java-exec/src/main/java/org/apache/drill/exec/util/record/RecordBatchStats.java
 ##########
 @@ -100,6 +108,104 @@ private String getQueryId(FragmentContext _context) {
       }
       return "NA";
     }
+
+    private boolean isBatchStatsEnabledForOperator(FragmentContext context, OperatorContext oContext) {
+      // The configuration can select what operators should log batch statistics
+      final String statsLoggingOperator = context.getOptions().getString(ExecConstants.STATS_LOGGING_BATCH_OPERATOR_OPTION).toUpperCase();
+      final String allOperatorsStr = "ALL";
+
+      // All operators are allowed to log batch statistics
+      if (allOperatorsStr.equals(statsLoggingOperator)) {
+        return true;
+      }
+
+      // No, only a select few are allowed; syntax: operator-id-1,operator-id-2,..
+      final String[] operators = statsLoggingOperator.split(",");
+      final String operatorId = oContext.getStats().getId().toUpperCase();
+
+      for (int idx = 0; idx < operators.length; idx++) {
+        // We use "contains" because the operator identifier is a composite string; e.g., 3:[PARQUET_ROW_GROUP_SCAN]
+        if (operatorId.contains(operators[idx])) {
 
 Review comment:
   We might also want to trim the operators string so that we can allow spaces `operators[idx].trim()`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services