Skip to content

Support EXPLAIN ANALYZE in table model#14189

Merged
Beyyes merged 10 commits intomasterfrom
ycy/supportEA
Nov 25, 2024
Merged

Support EXPLAIN ANALYZE in table model#14189
Beyyes merged 10 commits intomasterfrom
ycy/supportEA

Conversation

@ycycse
Copy link
Copy Markdown
Member

@ycycse ycycse commented Nov 23, 2024

As the title

# Conflicts:
#	iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java
#	iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/TableLogicalPlanner.java
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 23, 2024

Codecov Report

Attention: Patch coverage is 56.88073% with 47 lines in your changes missing coverage. Please review.

Project coverage is 39.61%. Comparing base (24a0090) to head (6b61c76).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
...e/plan/relational/planner/TableLogicalPlanner.java 55.26% 17 Missing ⚠️
...elational/planner/distribute/AddExchangeNodes.java 40.00% 9 Missing ⚠️
...eryengine/plan/planner/TableOperatorGenerator.java 0.00% 4 Missing ⚠️
...planner/optimizations/UnaliasSymbolReferences.java 0.00% 4 Missing ⚠️
...e/iotdb/db/queryengine/common/MPPQueryContext.java 50.00% 2 Missing ⚠️
...ine/plan/planner/plan/node/ExplainAnalyzeNode.java 0.00% 2 Missing ⚠️
...ne/plan/relational/analyzer/StatementAnalyzer.java 0.00% 2 Missing ⚠️
...nner/distribute/TableDistributedPlanGenerator.java 0.00% 2 Missing ⚠️
...yengine/plan/relational/sql/parser/AstBuilder.java 0.00% 2 Missing ⚠️
.../db/queryengine/plan/execution/QueryExecution.java 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14189      +/-   ##
============================================
- Coverage     39.64%   39.61%   -0.03%     
  Complexity       71       71              
============================================
  Files          4232     4232              
  Lines        269637   269870     +233     
  Branches      32688    32719      +31     
============================================
+ Hits         106897   106922      +25     
- Misses       162740   162948     +208     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@JackieTien97 JackieTien97 requested a review from Beyyes November 25, 2024 07:04
@sonarqubecloud
Copy link
Copy Markdown

@Beyyes Beyyes merged commit d107c2d into master Nov 25, 2024
@JackieTien97 JackieTien97 deleted the ycy/supportEA branch November 26, 2024 00:52

@Override
public List<PlanNode> visitExplainAnalyze(ExplainAnalyzeNode node, PlanContext context) {
symbolAllocator.newSymbol(ColumnHeaderConstant.EXPLAIN_ANALYZE, StringType.getInstance());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call symbolAllocator.newSymbol in logical planner

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call genResult for its children

Comment on lines +63 to +66
@Override
public List<Symbol> getOutputSymbols() {
return Collections.singletonList(Symbol.of(ColumnHeaderConstant.EXPLAIN_ANALYZE));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a new ExplainAnalyzeNode for table model

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And record outputSymbols which are generated by SymbolAllocator in that new node

@Override
public boolean isQuery() {
return false;
return getStatement().isQuery();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

record whether it is query in analysis while analyzing, delete isQuery method in Statement

Comment on lines +62 to +69
// 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()));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change back

}

@Override
public PlanNode visitExplainAnalyze(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add NOT_ASSIGNED region for ExplainAnalyzeNode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants