[ 
https://issues.apache.org/jira/browse/DRILL-6140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16358712#comment-16358712
 ] 

ASF GitHub Bot commented on DRILL-6140:
---------------------------------------

Github user amansinha100 commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1116#discussion_r167288758
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java
 ---
    @@ -45,12 +45,25 @@
       private final String operatorName;
       private final int size;
     
    -  public OperatorWrapper(int major, 
List<ImmutablePair<ImmutablePair<OperatorProfile, Integer>, String>> 
opsAndHostsList) {
    +  public OperatorWrapper(int major, 
List<ImmutablePair<ImmutablePair<OperatorProfile, Integer>, String>> 
opsAndHostsList, Map<String, String> phyOperMap) {
         Preconditions.checkArgument(opsAndHostsList.size() > 0);
         this.major = major;
         firstProfile = opsAndHostsList.get(0).getLeft().getLeft();
         operatorType = 
CoreOperatorType.valueOf(firstProfile.getOperatorType());
    -    operatorName = operatorType == null ? UNKNOWN_OPERATOR : 
operatorType.toString();
    +    //Update Name from Physical Map
    +    String path = new 
OperatorPathBuilder().setMajor(major).setOperator(firstProfile).build();
    +    //Use Plan Extracted Operator Names if available
    +    String extractedOpName = phyOperMap.get(path);
    +    String inferredOpName = operatorType == null ? UNKNOWN_OPERATOR : 
operatorType.toString();
    +    //Revert to inferred names for exceptional cases
    --- End diff --
    
    Can you clarify 'exception cases' .. there are 2 examples below but it is 
not immediately clear which operators would fall into this pattern.  I assume 
the main mismatch is that the physical plan has EXCHANGE operators whereas the 
profile has SENDER and RECEIVER.  


> Operators listed in Profiles Page doesn't always correspond with operator 
> specified in Physical Plan
> ----------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-6140
>                 URL: https://issues.apache.org/jira/browse/DRILL-6140
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Web Server
>    Affects Versions: 1.12.0
>            Reporter: Kunal Khatua
>            Assignee: Kunal Khatua
>            Priority: Major
>             Fix For: 1.13.0
>
>         Attachments: 25978a1a-24cf-fb4a-17af-59e7115b4fa1.sys.drill
>
>
> A query's physical plan correctly shows
> {code}
>  00-00 Screen : rowType = RecordType(BIGINT EXPR$0): rowcount = 1.0, 
> cumulative cost = { ...
>    00-01 Project(EXPR$0=[$0]) : rowType = RecordType(BIGINT EXPR$0): rowcount 
> = 1.0, cumulative cost = { ...
>      00-02 StreamAgg(group=[{}], EXPR$0=[$SUM0($0)]) : rowType = 
> RecordType(BIGINT EXPR$0): rowcount = 1.0, cumulative cost = { ...
>        00-03 UnionExchange : rowType = RecordType(BIGINT EXPR$0): rowcount = 
> 1.0, cumulative cost = { ...
>          01-01 StreamAgg(group=[{}], EXPR$0=[COUNT()]) : rowType = 
> RecordType(BIGINT EXPR$0): rowcount = 1.0, cumulative cost = { ...
>            01-02 Project($f0=[0]) : rowType = RecordType(INTEGER $f0): 
> rowcount = 1.79279253E7, cumulative cost = ...
>              01-03 Flatten(flattenField=[$1]) : rowType = RecordType(ANY 
> rfsSpecCode, ...
>                01-04 Project(rfsSpecCode=[$1], PUResultsArray=[$2]) : rowType 
> = ...
>                  01-05 SelectionVectorRemover : rowType = RecordType(ANY 
> schemaName, ...
>                    01-06 Filter(condition=[=($0, 'OnyxBlue')]) : rowType = ...
>                      01-07 Project(schemaName=[$0], ITEM=[ITEM($1, 
> 'rfsSpecCode')], ...
>                        01-08 Scan(groupscan=[ParquetGroupScan 
> [entries=[ReadEntryWithPath [
> {code}
> However, the profile page shows the operators as...
> ||Operator ID || Type || Metrics||
> |00-xx-00 | SCREEN | ... |
> |00-xx-01 | PROJECT | ... |
> |00-xx-02 | STREAMING_AGGREGATE | ... |
> |00-xx-03 | UNORDERED_RECEIVER | ... |
> |01-xx-00 | SINGLE_SENDER | ... |
> |01-xx-01 | STREAMING_AGGREGATE | ... |
> |01-xx-02 | PROJECT | ... |
> |01-xx-03 | SINGLE_SENDER | ... |
> |01-xx-04 | PROJECT | ... |
> |01-xx-05 | SELECTION_VECTOR_REMOVER | ... |
> |01-xx-06 | FILTER | ... |
> |01-xx-07 | PROJECT | ... |
> |01-xx-08 | PARQUET_ROW_GROUP_SCAN | ... |
> As you can see ... {{FLATTEN}}  operator appears as a {{SINGLE_SENDER}} 
> making the profile hard to interpret.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to