Github user kkhatua commented on a diff in the pull request:
https://github.com/apache/drill/pull/1116#discussion_r167649582
--- 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 --
Added all the exceptions in comments
---