JackieTien97 commented on code in PR #14189:
URL: https://github.com/apache/iotdb/pull/14189#discussion_r1857695309
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableDistributedPlanGenerator.java:
##########
@@ -156,6 +159,12 @@ public List<PlanNode> visitOutput(OutputNode node,
PlanContext context) {
return Collections.singletonList(node);
}
+ @Override
+ public List<PlanNode> visitExplainAnalyze(ExplainAnalyzeNode node,
PlanContext context) {
+ symbolAllocator.newSymbol(ColumnHeaderConstant.EXPLAIN_ANALYZE,
StringType.getInstance());
Review Comment:
call `symbolAllocator.newSymbol` in logical planner
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/Analysis.java:
##########
@@ -751,7 +752,7 @@ public TsBlock
constructResultForMemorySource(MPPQueryContext context) {
@Override
public boolean isQuery() {
- return false;
+ return getStatement().isQuery();
Review Comment:
record whether it is query in analysis while analyzing, delete isQuery
method in Statement
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/AddExchangeNodes.java:
##########
@@ -120,6 +121,23 @@ public PlanNode visitTableDeviceQueryCount(
return processTableDeviceSourceNode(node, context);
}
+ @Override
+ public PlanNode visitExplainAnalyze(
Review Comment:
add NOT_ASSIGNED region for ExplainAnalyzeNode
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/ExplainAnalyzeNode.java:
##########
@@ -59,6 +60,16 @@ public List<String> getOutputColumnNames() {
return Collections.singletonList(ColumnHeaderConstant.EXPLAIN_ANALYZE);
}
+ @Override
+ public List<Symbol> getOutputSymbols() {
+ return
Collections.singletonList(Symbol.of(ColumnHeaderConstant.EXPLAIN_ANALYZE));
+ }
Review Comment:
add a new ExplainAnalyzeNode for table model
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/AddExchangeNodes.java:
##########
@@ -58,14 +59,14 @@ public PlanNode visitPlan(PlanNode node,
TableDistributedPlanGenerator.PlanConte
PlanNode newNode = node.clone();
if (node.getChildren().size() == 1) {
newNode.addChild(node.getChildren().get(0).accept(this, context));
- context.nodeDistributionMap.put(
- node.getPlanNodeId(),
- new NodeDistribution(
- SAME_WITH_ALL_CHILDREN,
- context
- .nodeDistributionMap
- .get(node.getChildren().get(0).getPlanNodeId())
- .getRegion()));
+ // Explain Analyze doesn't have region info, this may be solved by a
local RegionReplicaSet
+ NodeDistribution childRegion =
+
context.nodeDistributionMap.get(node.getChildren().get(0).getPlanNodeId());
+ if (childRegion != null) {
+ context.nodeDistributionMap.put(
+ node.getPlanNodeId(),
+ new NodeDistribution(SAME_WITH_ALL_CHILDREN,
childRegion.getRegion()));
+ }
Review Comment:
change back
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/ExplainAnalyzeNode.java:
##########
@@ -59,6 +60,16 @@ public List<String> getOutputColumnNames() {
return Collections.singletonList(ColumnHeaderConstant.EXPLAIN_ANALYZE);
}
+ @Override
+ public List<Symbol> getOutputSymbols() {
+ return
Collections.singletonList(Symbol.of(ColumnHeaderConstant.EXPLAIN_ANALYZE));
+ }
Review Comment:
And record outputSymbols which are generated by SymbolAllocator in that new
node
--
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]