thomasrebele commented on PR #6556: URL: https://github.com/apache/hive/pull/6556#issuecomment-5526663849
Thank you for the comments! * `hive.log.explain.output`: it seems that [HIVE-18469](https://issues.apache.org/jira/browse/HIVE-18469) split the property so that the UI uses the property HIVE_SERVER2_WEBUI_EXPLAIN_OUTPUT instead. That's also mentioned in the [docs](https://hive.apache.org/docs/latest/user/configuration-properties/#hivelogexplainoutput). This PR adds more information, and keeps the existing format, so I don't think that it affects the consumers. * exceptions in toJsonString(): good point, I'll wrap it in a try-catch block * `explainConfig == null isn't the same as "not an explain"`: Thank you for pointing out EXPLAIN ANALYZE [CBO], @deniskuzZ. Invalidating the metadata query or changing THREAD_PROVIDERS might indeed have unintended consequences. Not sure how severe they are, as the logging happens after the CBO has completed. Nevertheless I refactored the code to always call `setCboJoinCost(true);` if the block has been entered because of HIVE_LOG_EXPLAIN_OUTPUT. I've also added some tests. * `setFormatted(true) selects JSON`: currently configuring `SET hive.log.explain.output=true; SET hive.server2.logging.operation.level=VERBOSE;` outputs already Json formatted information: `EXPLAIN output for queryid ... : {"cboInfo":"Plan optimized by CBO.","STAGE DEPENDENCIES":{...},"STAGE PLANS":{...}}`. For backwards compatibility I would keep that behavior. The PR adds another attribute, i.e., `EXPLAIN output for queryid ... : {"CBOPlan":{...},"cboInfo":"Plan optimized by CBO.","STAGE DEPENDENCIES":{...},"STAGE PLANS":{...}}`. This point is somewhat related to the above exception (HIVE-30013), but as this also happens for the master branch, I suggest fixing the exception in another PR. -- 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]
