Cherry-picked from #48771 Co-authored-by: zhangm365 <mzhang2048@gmail.com>
This commit is contained in:
committed by
GitHub
parent
afb143c1e8
commit
be3e2f36d0
@ -253,8 +253,12 @@ public class NereidsPlanner extends Planner {
|
||||
// print memo before choose plan.
|
||||
// if chooseNthPlan failed, we could get memo to debug
|
||||
if (cascadesContext.getConnectContext().getSessionVariable().dumpNereidsMemo) {
|
||||
String memo = cascadesContext.getMemo().toString();
|
||||
LOG.info("{}\n{}", ConnectContext.get().getQueryIdentifier(), memo);
|
||||
Memo memo = cascadesContext.getMemo();
|
||||
if (memo != null) {
|
||||
LOG.info("{}\n{}", ConnectContext.get().getQueryIdentifier(), memo.toString());
|
||||
} else {
|
||||
LOG.info("{}\nMemo is null", ConnectContext.get().getQueryIdentifier());
|
||||
}
|
||||
}
|
||||
|
||||
int nth = cascadesContext.getConnectContext().getSessionVariable().getNthOptimizedPlan();
|
||||
@ -583,10 +587,15 @@ public class NereidsPlanner extends Planner {
|
||||
plan = optimizedPlan.shape("");
|
||||
break;
|
||||
case MEMO_PLAN:
|
||||
plan = cascadesContext.getMemo().toString()
|
||||
Memo memo = cascadesContext.getMemo();
|
||||
if (memo == null) {
|
||||
plan = "Memo is null";
|
||||
} else {
|
||||
plan = memo.toString()
|
||||
+ "\n\n========== OPTIMIZED PLAN ==========\n"
|
||||
+ optimizedPlan.treeString()
|
||||
+ mvSummary;
|
||||
}
|
||||
break;
|
||||
case ALL_PLAN:
|
||||
plan = "========== PARSED PLAN "
|
||||
|
||||
Reference in New Issue
Block a user