sohardforaname commented on code in PR #13659:
URL: https://github.com/apache/doris/pull/13659#discussion_r1021604810
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/Job.java:
##########
@@ -89,47 +91,33 @@ public List<Rule> getValidRules(GroupExpression
groupExpression,
public abstract void execute() throws AnalysisException;
- protected Optional<CopyInResult> invokeRewriteRuleWithTrace(Rule rule,
Plan before, Group targetGroup) {
+ protected Optional<CopyInResult> invokeRewriteRuleWithTrace(Rule rule,
Plan before, Group targetGroup,
+ EventProducer transformTracer) {
context.onInvokeRule(rule.getRuleType());
-
- String traceBefore = enableTrace ? getPlanTraceLog() : null;
+ COUNTER_TRACER.log(new CounterEvent(Memo.getStateId(),
+ CounterType.EXPRESSION_TRANSFORM, targetGroup,
targetGroup.getLogicalExpression(), before));
List<Plan> afters = rule.transform(before,
context.getCascadesContext());
Preconditions.checkArgument(afters.size() == 1);
Plan after = afters.get(0);
-
- if (after != before) {
- CopyInResult result = context.getCascadesContext()
- .getMemo()
- .copyIn(after, targetGroup, true);
-
- if (result.generateNewExpression && enableTrace) {
- String traceAfter = getPlanTraceLog();
- printTraceLog(rule, traceBefore, traceAfter);
- }
-
- return Optional.of(result);
+ if (after == before) {
+ return Optional.empty();
Review Comment:
it's just reverse if-statement, it may be read more easily.
--
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]