Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support EXPLAIN ANALYZE in table model #14189

Merged
merged 10 commits into from
Nov 25, 2024
Merged

Support EXPLAIN ANALYZE in table model #14189

merged 10 commits into from
Nov 25, 2024

Conversation

ycycse
Copy link
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
Copy link

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
@Beyyes Beyyes merged commit d107c2d into master Nov 25, 2024
17 of 18 checks passed
@JackieTien97 JackieTien97 deleted the ycy/supportEA branch November 26, 2024 00:52
@@ -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());
Copy link
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
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
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
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

@@ -751,7 +752,7 @@ public TsBlock constructResultForMemorySource(MPPQueryContext context) {

@Override
public boolean isQuery() {
return false;
return getStatement().isQuery();
Copy link
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
Contributor

Choose a reason for hiding this comment

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

change back

@@ -120,6 +121,23 @@ public PlanNode visitTableDeviceQueryCount(
return processTableDeviceSourceNode(node, context);
}

@Override
public PlanNode visitExplainAnalyze(
Copy link
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