Skip to content

Commit edb1719

Browse files
authored
Support prefix path 'root.**' in tree view scan
1 parent e271df7 commit edb1719

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,10 @@ public static IDeviceID.TreeDeviceIdColumnValueExtractor createTreeDeviceIdColum
10281028
try {
10291029
PartialPath db = new PartialPath(treeDBName);
10301030
int dbLevel = db.getNodes().length;
1031-
if (dbLevel == 2) {
1031+
// For the path of 'root.**', we can only get the root level in this place
1032+
// In this case, we still need to support deviceId such as 'root.db'
1033+
// The relevant deviceId must be two level db, but we can't get it now
1034+
if (dbLevel == 1 || dbLevel == 2) {
10321035
return new TwoLevelDBExtractor(treeDBName.length());
10331036
} else if (dbLevel == 3) {
10341037
return new ThreeLevelDBExtractor(treeDBName.length());

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,10 @@ private void planTraverseDevice(final AbstractTraverseDevice statement, final An
582582
ClusterPartitionFetcher.getInstance().getSchemaPartition(tree));
583583

584584
if (analysis.getSchemaPartitionInfo().getSchemaPartitionMap().size() > 1) {
585-
throw new SemanticException("Tree device view with multiple databases is unsupported yet.");
585+
throw new SemanticException(
586+
"Tree device view with multiple databases("
587+
+ analysis.getSchemaPartitionInfo().getSchemaPartitionMap().keySet()
588+
+ ") is unsupported yet.");
586589
}
587590
} else {
588591
analysis.setSchemaPartitionInfo(

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,10 @@ private void getDeviceEntriesWithDataPartitions(
580580
attributeColumns,
581581
queryContext);
582582
if (deviceEntriesMap.size() > 1) {
583-
throw new SemanticException("Tree device view with multiple databases is unsupported yet.");
583+
throw new SemanticException(
584+
"Tree device view with multiple databases("
585+
+ deviceEntriesMap.keySet()
586+
+ ") is unsupported yet.");
584587
}
585588
final String deviceDatabase =
586589
!deviceEntriesMap.isEmpty() ? deviceEntriesMap.keySet().iterator().next() : null;

0 commit comments

Comments
 (0)