rubenada commented on code in PR #6720:
URL: https://github.com/apache/hive/pull/6720#discussion_r3893432694
##########
data/conf/hive-log4j2.properties:
##########
@@ -114,7 +114,7 @@ logger.CalcitePlanner.name =
org.apache.calcite.plan.RelOptPlanner
logger.CalcitePlanner.level = INFO
# Change logger level to DEBUG, to see all application of CBO rules and the
operators they produce
-logger.CBORuleLogger.name =
org.apache.hadoop.hive.ql.optimizer.calcite.RuleEventLogger
+logger.CBORuleLogger.name = org.apache.calcite.plan.RuleEventLogger
Review Comment:
@zabetak I verified, and the logs are displayed as expected. However,
there's a subtle issue with this change.
Calcite's `org.apache.calcite.plan.RuleEventLogger` reuses
RelOptPlanner.class logger:
```
public class RuleEventLogger implements RelOptListener {
private static final Logger LOG = CalciteTrace.getPlannerTracer();
```
which is defined as
```
public static Logger getPlannerTracer() {
return LoggerFactory.getLogger(RelOptPlanner.class.getName());
}
```
Which means, IIUC, that these would actually be unified
```
logger.CalcitePlanner.name = org.apache.calcite.plan.RelOptPlanner
...
logger.CBORuleLogger.name = org.apache.calcite.plan.RuleEventLogger
```
And we should actually just define them as a single block:
```
# Change logger level to DEBUG, to see all application of CBO rules and the
operators they produce
logger.CalcitePlanner.name = org.apache.calcite.plan.RelOptPlanner
logger.CalcitePlanner.level = DEBUG
logger.CalcitePlanner.filter.marker.type = MarkerFilter
# Change filter to ACCEPT, to see the produced plan after every rule
invocation using the EXPLAIN CBO format
logger.CalcitePlanner.filter.marker.marker = FULL_PLAN
logger.CalcitePlanner.filter.marker.onMatch = DENY
logger.CalcitePlanner.filter.marker.onMismatch = NEUTRAL
```
Which, in principle, should be no problem, I've verified and logs work as
expected. However, we would lose granularity. In the previous configuration we
had a logger for RelOptPlanner (used in RelOptRuleCall, RelOptPlanner, RelSet,
RelSubset,
IterativeRuleQueue, IterativeRuleDriver, EnumerableRules, JdbcRules,
ValuesReduceRule); and a separate, dedicated logger for Hive's
RuleEventLogger; which could be independently configured. Now with Calcite's
RuleEventLogger, everything would be under the same RelOptPlanner (logs from
all the previously mentioned classes, and also RuleEvent logs).
Would that be ok?
--
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]