Skip to content

Commit e9e3dd6

Browse files
authored
Refactor some method and PlanNodeType (#17918)
1 parent 3853d38 commit e9e3dd6

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

  • iotdb-core
    • datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner
    • node-commons/src/main/java/org/apache/iotdb/commons/queryengine/plan/planner/plan/node

‎iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/RelationPlanner.java‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -343,17 +343,7 @@ private RelationPlan processPhysicalTable(Table table, Scope scope) {
343343
final ImmutableList.Builder<Symbol> outputSymbolsBuilder = ImmutableList.builder();
344344
final ImmutableMap.Builder<Symbol, ColumnSchema> symbolToColumnSchema = ImmutableMap.builder();
345345
final Collection<Field> fields = scope.getRelationType().getAllFields();
346-
final QualifiedName qualifiedName = analysis.getRelationName(table);
347-
348-
if (!qualifiedName.getPrefix().isPresent()) {
349-
throw new IllegalStateException(
350-
DataNodeQueryMessages.TABLE + table.getName() + " has no prefix!");
351-
}
352-
353-
final QualifiedObjectName qualifiedObjectName =
354-
new QualifiedObjectName(
355-
qualifiedName.getPrefix().map(QualifiedName::toString).orElse(null),
356-
qualifiedName.getSuffix());
346+
final QualifiedObjectName qualifiedObjectName = getQualifiedObjectName(table, analysis);
357347

358348
// on the basis of that the order of fields is same with the column category order of segments
359349
// in DeviceEntry
@@ -411,6 +401,19 @@ private RelationPlan processPhysicalTable(Table table, Scope scope) {
411401
return new RelationPlan(tableScanNode, scope, outputSymbols, outerContext);
412402
}
413403

404+
public static QualifiedObjectName getQualifiedObjectName(Table table, Analysis analysis) {
405+
final QualifiedName qualifiedName = analysis.getRelationName(table);
406+
if (!qualifiedName.getPrefix().isPresent()) {
407+
throw new IllegalStateException("Table " + table.getName() + " has no prefix!");
408+
}
409+
410+
final QualifiedObjectName qualifiedObjectName =
411+
new QualifiedObjectName(
412+
qualifiedName.getPrefix().map(QualifiedName::toString).orElse(null),
413+
qualifiedName.getSuffix());
414+
return qualifiedObjectName;
415+
}
416+
414417
@Override
415418
public RelationPlan visitQuerySpecification(final QuerySpecification node, final Void context) {
416419
return new QueryPlanner(

‎iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/queryengine/plan/planner/plan/node/PlanNodeType.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ public enum PlanNodeType {
201201
ALIGNED_AGGREGATION_TREE_DEVICE_VIEW_SCAN_NODE((short) 1041),
202202
NON_ALIGNED_AGGREGATION_TREE_DEVICE_VIEW_SCAN_NODE((short) 1042),
203203
TABLE_NEXT_FILL_NODE((short) 1043),
204+
SESSION_SCAN_NODE((short) 1044),
205+
EVENT_SCAN_NODE((short) 1045),
204206

205207
RELATIONAL_INSERT_TABLET((short) 2000),
206208
RELATIONAL_INSERT_ROW((short) 2001),

0 commit comments

Comments
 (0)