Aggarwal-Raghav commented on code in PR #5872:
URL: https://github.com/apache/hive/pull/5872#discussion_r2155160993
##########
ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java:
##########
@@ -1003,6 +1003,9 @@ public JSONObject outputPlan(Object work, PrintStream out,
Operator<? extends OperatorDesc> operator =
(Operator<? extends OperatorDesc>) work;
final int visitCnt = operatorVisits.merge(operator, 1, Integer::sum);
+ if (conf == null && this.work != null && this.work.getFetchTask() !=
null) {
+ conf = this.work.getFetchTask().getConf();
+ }
Review Comment:
Thanks for the review and suggestions @zabetak and will try to come up with
a UT as well.
**My understanding:**
1. I also though of passing the non-null config from `HiveProtoLoggingHook`
class but it would require some method parameter/argument changes across
classes and might need additional check if prologging is disabled. So didn't
gave a try 🙁.
2. The reason behind using `this.work.getFetchTask().getConf()` is that I
wanted to use the conf which was present in ExplainTask without propogating it
from other classes.
3. As you said that there are 9 references of conf but while debugging only
_ExplainTask#outputPlan()_ having
`conf.getIntVar(ConfVars.HIVE_EXPLAIN_NODE_VISIT_LIMIT)` is getting triggered.
So I think handling, the localized place should be enough.
5. Using `ConfVars.HIVE_EXPLAIN_NODE_VISIT_LIMIT.defaultIntVal`, as you
suggested, can work as using the default value shouldn't have any impact on
OtherInfoType.CONF. Will test and confirm.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]