[feature](nereids)print query id with memo and physical tree (#25501)

print query id with memo and physical tree when dump_nereids_memo switched on. This is used for regression test.
This commit is contained in:
minghong
2023-10-17 18:06:11 +08:00
committed by GitHub
parent 9d6b2dceb2
commit 8eff1486bd

View File

@ -55,6 +55,7 @@ import org.apache.doris.planner.Planner;
import org.apache.doris.planner.RuntimeFilter;
import org.apache.doris.planner.ScanNode;
import org.apache.doris.qe.CommonResultSet;
import org.apache.doris.qe.ConnectContext;
import org.apache.doris.qe.ResultSet;
import org.apache.doris.qe.ResultSetMetaData;
@ -227,7 +228,7 @@ public class NereidsPlanner extends Planner {
// if chooseNthPlan failed, we could get memo to debug
if (cascadesContext.getConnectContext().getSessionVariable().dumpNereidsMemo) {
String memo = cascadesContext.getMemo().toString();
LOG.info(memo);
LOG.info(ConnectContext.get().getQueryIdentifier() + "\n" + memo);
}
int nth = cascadesContext.getConnectContext().getSessionVariable().getNthOptimizedPlan();
@ -236,7 +237,7 @@ public class NereidsPlanner extends Planner {
physicalPlan = postProcess(physicalPlan);
if (cascadesContext.getConnectContext().getSessionVariable().dumpNereidsMemo) {
String tree = physicalPlan.treeString();
LOG.info(tree);
LOG.info(ConnectContext.get().getQueryIdentifier() + "\n" + tree);
}
if (explainLevel == ExplainLevel.OPTIMIZED_PLAN
|| explainLevel == ExplainLevel.ALL_PLAN