You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/06/13 13:59:03 UTC
[iotdb] branch xingtanzjr/fix_schema_fetch created (now a57a8b0a49)
This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a change to branch xingtanzjr/fix_schema_fetch
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at a57a8b0a49 add matchTimeseries as a new parameter when fetching schema
This branch includes the following new commits:
new a57a8b0a49 add matchTimeseries as a new parameter when fetching schema
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[iotdb] 01/01: add matchTimeseries as a new parameter when fetching schema
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a commit to branch xingtanzjr/fix_schema_fetch
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit a57a8b0a497c5d81259e94e8a19a1fee1bbaeb44
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Mon Jun 13 21:58:49 2022 +0800
add matchTimeseries as a new parameter when fetching schema
---
.../iotdb/confignode/manager/ConfigManager.java | 73 ++++++++++++----------
.../apache/iotdb/confignode/manager/Manager.java | 2 +-
.../thrift/ConfigNodeRPCServiceProcessor.java | 2 +-
.../thrift/ConfigNodeRPCServiceProcessorTest.java | 4 +-
.../org/apache/iotdb/commons/path/PartialPath.java | 26 ++++++++
.../db/mpp/common/schematree/PathPatternTree.java | 6 +-
.../apache/iotdb/db/mpp/plan/analyze/Analyzer.java | 18 +++---
.../mpp/plan/analyze/ClusterPartitionFetcher.java | 11 ++--
.../db/mpp/plan/analyze/ClusterSchemaFetcher.java | 8 ++-
.../mpp/plan/analyze/FakePartitionFetcherImpl.java | 2 +-
.../db/mpp/plan/analyze/IPartitionFetcher.java | 2 +-
.../plan/analyze/StandalonePartitionFetcher.java | 2 +-
.../plan/planner/distribution/SourceRewriter.java | 9 +++
.../node/metedata/read/DevicesSchemaScanNode.java | 5 ++
.../src/main/thrift/confignode.thrift | 1 +
15 files changed, 110 insertions(+), 61 deletions(-)
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
index fe30ba53e5..66dc652630 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
@@ -22,6 +22,7 @@ package org.apache.iotdb.confignode.manager;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
import org.apache.iotdb.commons.conf.CommonDescriptor;
+import org.apache.iotdb.commons.conf.IoTDBConstant;
import org.apache.iotdb.commons.path.PartialPath;
import org.apache.iotdb.commons.utils.AuthUtils;
import org.apache.iotdb.confignode.conf.ConfigNodeConf;
@@ -72,11 +73,13 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.stream.Collectors;
/** Entry of all management, AssignPartitionManager,AssignRegionManager. */
public class ConfigManager implements Manager {
@@ -266,56 +269,58 @@ public class ConfigManager implements Manager {
}
}
+ private List<TSeriesPartitionSlot> calculateRelatedSlot(
+ PartialPath path, boolean matchTimeseries) {
+ // The path contains `**`
+ if (path.getFullPath().contains(IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD)
+ || (!matchTimeseries
+ && path.getFullPath().contains(IoTDBConstant.ONE_LEVEL_PATH_WILDCARD))) {
+ return new ArrayList<>();
+ }
+ // The path contains `*` and the only `*` is not in last level
+ if (path.getDevice().contains(IoTDBConstant.ONE_LEVEL_PATH_WILDCARD)) {
+ return new ArrayList<>();
+ }
+ return Collections.singletonList(
+ getPartitionManager().getSeriesPartitionSlot(path.getDevice()));
+ }
+
@Override
- public DataSet getSchemaPartition(PathPatternTree patternTree) {
+ public DataSet getSchemaPartition(PathPatternTree patternTree, boolean matchTimeseries) {
TSStatus status = confirmLeader();
if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
- List<String> devicePaths = patternTree.findAllDevicePaths();
- List<String> storageGroups = getClusterSchemaManager().getStorageGroupNames();
GetSchemaPartitionReq getSchemaPartitionReq = new GetSchemaPartitionReq();
- Map<String, List<TSeriesPartitionSlot>> partitionSlotsMap = new HashMap<>();
-
- boolean getAll = false;
- Set<String> getAllSet = new HashSet<>();
- for (String devicePath : devicePaths) {
- boolean matchStorageGroup = false;
- for (String storageGroup : storageGroups) {
- if (devicePath.startsWith(storageGroup + ".")) {
- matchStorageGroup = true;
- if (devicePath.contains("*")) {
- // Get all SchemaPartitions of this StorageGroup if the devicePath contains "*"
- getAllSet.add(storageGroup);
+ Map<String, Set<TSeriesPartitionSlot>> partitionSlotsMap = new HashMap<>();
+ List<PartialPath> relatedPaths = patternTree.splitToPathList();
+ List<String> allStorageGroups = getClusterSchemaManager().getStorageGroupNames();
+ Map<String, Boolean> scanAllRegions = new HashMap<>();
+ for (PartialPath path : relatedPaths) {
+ for (String storageGroup : allStorageGroups) {
+ if (path.belongToStorageGroup(storageGroup)
+ && !scanAllRegions.containsKey(storageGroup)) {
+ List<TSeriesPartitionSlot> relatedSlot = calculateRelatedSlot(path, matchTimeseries);
+ if (relatedSlot.isEmpty()) {
+ scanAllRegions.put(storageGroup, true);
+ partitionSlotsMap.put(storageGroup, new HashSet<>());
} else {
- // Get the specific SchemaPartition
partitionSlotsMap
- .computeIfAbsent(storageGroup, key -> new ArrayList<>())
- .add(getPartitionManager().getSeriesPartitionSlot(devicePath));
+ .computeIfAbsent(storageGroup, k -> new HashSet<>())
+ .addAll(relatedSlot);
}
- break;
}
}
- if (!matchStorageGroup && devicePath.contains("**")) {
- // Get all SchemaPartitions if there exists one devicePath that contains "**"
- getAll = true;
- }
- }
-
- if (getAll) {
- partitionSlotsMap = new HashMap<>();
- } else {
- for (String storageGroup : getAllSet) {
- partitionSlotsMap.put(storageGroup, new ArrayList<>());
- }
}
- getSchemaPartitionReq.setPartitionSlotsMap(partitionSlotsMap);
+ getSchemaPartitionReq.setPartitionSlotsMap(
+ partitionSlotsMap.entrySet().stream()
+ .collect(Collectors.toMap(Map.Entry::getKey, e -> new ArrayList<>(e.getValue()))));
SchemaPartitionResp resp =
(SchemaPartitionResp) partitionManager.getSchemaPartition(getSchemaPartitionReq);
// TODO: Delete or hide this LOGGER before officially release.
LOGGER.info(
- "GetSchemaPartition interface receive devicePaths: {}, return SchemaPartition: {}",
- devicePaths,
+ "GetSchemaPartition interface receive paths: {}, return SchemaPartition: {}",
+ relatedPaths,
resp.getSchemaPartition().getSchemaPartitionMap());
return resp;
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java
index df6b1593d5..5c19ceae57 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java
@@ -153,7 +153,7 @@ public interface Manager {
*
* @return SchemaPartitionDataSet
*/
- DataSet getSchemaPartition(PathPatternTree patternTree);
+ DataSet getSchemaPartition(PathPatternTree patternTree, boolean matchTimeseries);
/**
* Get or create SchemaPartition
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java b/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
index aabffbed77..5bf7345a8e 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
@@ -259,7 +259,7 @@ public class ConfigNodeRPCServiceProcessor implements ConfigIService.Iface {
PathPatternTree patternTree =
PathPatternTree.deserialize(ByteBuffer.wrap(req.getPathPatternTree()));
SchemaPartitionResp schemaResp =
- (SchemaPartitionResp) configManager.getSchemaPartition(patternTree);
+ (SchemaPartitionResp) configManager.getSchemaPartition(patternTree, req.matchTimeseries);
TSchemaPartitionResp resp = new TSchemaPartitionResp();
schemaResp.convertToRpcSchemaPartitionResp(resp);
diff --git a/confignode/src/test/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessorTest.java b/confignode/src/test/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessorTest.java
index 1b9cbb8357..7b0d21f7a5 100644
--- a/confignode/src/test/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessorTest.java
+++ b/confignode/src/test/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessorTest.java
@@ -382,7 +382,7 @@ public class ConfigNodeRPCServiceProcessorTest {
// Test getOrCreateSchemaPartition, the result should be NOT_ENOUGH_DATANODE
buffer = generatePatternTreeBuffer(new String[] {d00, d01, allSg1});
- schemaPartitionReq = new TSchemaPartitionReq(buffer);
+ schemaPartitionReq = new TSchemaPartitionReq(buffer, true);
schemaPartitionResp = processor.getOrCreateSchemaPartition(schemaPartitionReq);
Assert.assertEquals(
TSStatusCode.NOT_ENOUGH_DATA_NODE.getStatusCode(),
@@ -394,7 +394,7 @@ public class ConfigNodeRPCServiceProcessorTest {
// Test getSchemaPartition, the result should be empty
buffer = generatePatternTreeBuffer(new String[] {d00, d01, allSg1});
- schemaPartitionReq = new TSchemaPartitionReq(buffer);
+ schemaPartitionReq = new TSchemaPartitionReq(buffer, true);
schemaPartitionResp = processor.getSchemaPartition(schemaPartitionReq);
Assert.assertEquals(
TSStatusCode.SUCCESS_STATUS.getStatusCode(), schemaPartitionResp.getStatus().getCode());
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java b/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
index e2d51f429f..68ff8f7638 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
@@ -353,6 +353,32 @@ public class PartialPath extends Path implements Comparable<Path>, Cloneable {
return this.nodes.length == rNodes.length;
}
+ /**
+ * Test whether the path belongs to given storage group or not. Example: [result]: [current path],
+ * [storage group path] 1) True: root.sg, root.sg 2) True: root.**, root.sg 3) True: root.sg.d1,
+ * root.sg 4) True: root.**.d1, root.sg 5) False: root.sg, root.sg2 6) False: root.sg.d1, root.sg2
+ *
+ * @param storageGroup the storage group to be tested
+ */
+ public boolean belongToStorageGroup(String storageGroup) {
+ try {
+ // We divide the judgement into two scenarios:
+ // 1) the size of nodes of the path is larger than size of storage groups nodes
+ // Then we can test the overlap of them
+ PartialPath storageGroupPath =
+ new PartialPath(storageGroup).concatNode(MULTI_LEVEL_PATH_WILDCARD);
+ if (overlapWith(storageGroupPath)) {
+ return true;
+ }
+ // 2) the size of nodes of the path is less or equal to size of storage groups nodes
+ // Then we test the prefix match
+ return storageGroup.startsWith(getFullPath());
+ } catch (IllegalPathException e) {
+ // This code won't be reached in general
+ throw new RuntimeException(e);
+ }
+ }
+
@Override
public String getFullPath() {
if (fullPath == null) {
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/PathPatternTree.java b/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/PathPatternTree.java
index 84047dd825..840eb3ccb6 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/PathPatternTree.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/PathPatternTree.java
@@ -19,6 +19,7 @@
package org.apache.iotdb.db.mpp.common.schematree;
+import org.apache.iotdb.commons.conf.IoTDBConstant;
import org.apache.iotdb.commons.exception.IllegalPathException;
import org.apache.iotdb.commons.path.PartialPath;
import org.apache.iotdb.commons.utils.TestOnly;
@@ -109,8 +110,9 @@ public class PathPatternTree {
PathPatternNode curNode, List<String> nodes, List<String> pathPatternList) {
nodes.add(curNode.getName());
if (curNode.isLeaf()) {
- if (!curNode.getName().equals("**")) {
- pathPatternList.add(parseNodesToString(nodes.subList(0, nodes.size() - 1)));
+ if (!curNode.getName().equals(IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD)) {
+ pathPatternList.add(
+ nodes.size() == 1 ? "" : parseNodesToString(nodes.subList(0, nodes.size() - 1)));
} else {
pathPatternList.add(parseNodesToString(nodes));
}
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
index 834ee25932..58e3ae1c86 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/Analyzer.java
@@ -1015,7 +1015,7 @@ public class Analyzer {
SchemaPartition schemaPartitionInfo;
schemaPartitionInfo =
partitionFetcher.getSchemaPartition(
- new PathPatternTree(alterTimeSeriesStatement.getPath()));
+ new PathPatternTree(alterTimeSeriesStatement.getPath()), true);
analysis.setSchemaPartitionInfo(schemaPartitionInfo);
return analysis;
}
@@ -1140,7 +1140,7 @@ public class Analyzer {
SchemaPartition schemaPartitionInfo =
partitionFetcher.getSchemaPartition(
- new PathPatternTree(showTimeSeriesStatement.getPathPattern()));
+ new PathPatternTree(showTimeSeriesStatement.getPathPattern()), true);
analysis.setSchemaPartitionInfo(schemaPartitionInfo);
if (showTimeSeriesStatement.isOrderByHeat()) {
@@ -1202,10 +1202,7 @@ public class Analyzer {
SchemaPartition schemaPartitionInfo =
partitionFetcher.getSchemaPartition(
- new PathPatternTree(
- showDevicesStatement
- .getPathPattern()
- .concatNode(IoTDBConstant.ONE_LEVEL_PATH_WILDCARD)));
+ new PathPatternTree(showDevicesStatement.getPathPattern()), false);
analysis.setSchemaPartitionInfo(schemaPartitionInfo);
analysis.setRespDatasetHeader(
@@ -1253,7 +1250,8 @@ public class Analyzer {
new PathPatternTree(
countDevicesStatement
.getPartialPath()
- .concatNode(IoTDBConstant.ONE_LEVEL_PATH_WILDCARD)));
+ .concatNode(IoTDBConstant.ONE_LEVEL_PATH_WILDCARD)),
+ false);
analysis.setSchemaPartitionInfo(schemaPartitionInfo);
analysis.setRespDatasetHeader(HeaderConstant.countDevicesHeader);
@@ -1268,7 +1266,7 @@ public class Analyzer {
SchemaPartition schemaPartitionInfo =
partitionFetcher.getSchemaPartition(
- new PathPatternTree(countTimeSeriesStatement.getPartialPath()));
+ new PathPatternTree(countTimeSeriesStatement.getPartialPath()), true);
analysis.setSchemaPartitionInfo(schemaPartitionInfo);
analysis.setRespDatasetHeader(HeaderConstant.countTimeSeriesHeader);
@@ -1283,7 +1281,7 @@ public class Analyzer {
SchemaPartition schemaPartitionInfo =
partitionFetcher.getSchemaPartition(
- new PathPatternTree(countLevelTimeSeriesStatement.getPartialPath()));
+ new PathPatternTree(countLevelTimeSeriesStatement.getPartialPath()), true);
analysis.setSchemaPartitionInfo(schemaPartitionInfo);
analysis.setRespDatasetHeader(HeaderConstant.countLevelTimeSeriesHeader);
@@ -1362,7 +1360,7 @@ public class Analyzer {
PathPatternTree patternTree = new PathPatternTree(deleteDataStatement.getPathList());
- SchemaPartition schemaPartition = partitionFetcher.getSchemaPartition(patternTree);
+ SchemaPartition schemaPartition = partitionFetcher.getSchemaPartition(patternTree, true);
SchemaTree schemaTree = schemaFetcher.fetchSchema(patternTree, schemaPartition);
analysis.setSchemaTree(schemaTree);
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java
index 1470daf66a..ca737c1c58 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java
@@ -103,7 +103,7 @@ public class ClusterPartitionFetcher implements IPartitionFetcher {
}
@Override
- public SchemaPartition getSchemaPartition(PathPatternTree patternTree) {
+ public SchemaPartition getSchemaPartition(PathPatternTree patternTree, boolean matchTimeseries) {
try (ConfigNodeClient client =
configNodeClientManager.borrowClient(ConfigNodeInfo.partitionRegionId)) {
patternTree.constructTree();
@@ -112,7 +112,7 @@ public class ClusterPartitionFetcher implements IPartitionFetcher {
SchemaPartition schemaPartition = partitionCache.getSchemaPartition(deviceToStorageGroupMap);
if (null == schemaPartition) {
TSchemaPartitionResp schemaPartitionResp =
- client.getSchemaPartition(constructSchemaPartitionReq(patternTree));
+ client.getSchemaPartition(constructSchemaPartitionReq(patternTree, matchTimeseries));
if (schemaPartitionResp.getStatus().getCode()
== TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
schemaPartition = parseSchemaPartitionResp(schemaPartitionResp);
@@ -136,7 +136,7 @@ public class ClusterPartitionFetcher implements IPartitionFetcher {
SchemaPartition schemaPartition = partitionCache.getSchemaPartition(deviceToStorageGroupMap);
if (null == schemaPartition) {
TSchemaPartitionResp schemaPartitionResp =
- client.getOrCreateSchemaPartition(constructSchemaPartitionReq(patternTree));
+ client.getOrCreateSchemaPartition(constructSchemaPartitionReq(patternTree, true));
if (schemaPartitionResp.getStatus().getCode()
== TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
schemaPartition = parseSchemaPartitionResp(schemaPartitionResp);
@@ -346,14 +346,15 @@ public class ClusterPartitionFetcher implements IPartitionFetcher {
return result;
}
- private TSchemaPartitionReq constructSchemaPartitionReq(PathPatternTree patternTree) {
+ private TSchemaPartitionReq constructSchemaPartitionReq(
+ PathPatternTree patternTree, boolean matchTimeseries) {
PublicBAOS baos = new PublicBAOS();
try {
patternTree.serialize(baos);
ByteBuffer serializedPatternTree = ByteBuffer.allocate(baos.size());
serializedPatternTree.put(baos.getBuf(), 0, baos.size());
serializedPatternTree.flip();
- return new TSchemaPartitionReq(serializedPatternTree);
+ return new TSchemaPartitionReq(serializedPatternTree, matchTimeseries);
} catch (IOException e) {
throw new StatementAnalyzeException("An error occurred when serializing pattern tree");
}
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterSchemaFetcher.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterSchemaFetcher.java
index cf7c6bb9af..cad131ee3e 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterSchemaFetcher.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterSchemaFetcher.java
@@ -78,7 +78,7 @@ public class ClusterSchemaFetcher implements ISchemaFetcher {
@Override
public SchemaTree fetchSchema(PathPatternTree patternTree) {
- return fetchSchema(patternTree, partitionFetcher.getSchemaPartition(patternTree));
+ return fetchSchema(patternTree, partitionFetcher.getSchemaPartition(patternTree, true));
}
@Override
@@ -144,7 +144,8 @@ public class ClusterSchemaFetcher implements ISchemaFetcher {
SchemaTree remoteSchemaTree;
if (!config.isAutoCreateSchemaEnabled()) {
- remoteSchemaTree = fetchSchema(patternTree, partitionFetcher.getSchemaPartition(patternTree));
+ remoteSchemaTree =
+ fetchSchema(patternTree, partitionFetcher.getSchemaPartition(patternTree, true));
schemaTree.mergeSchemaTree(remoteSchemaTree);
schemaCache.put(remoteSchemaTree);
return schemaTree;
@@ -197,7 +198,8 @@ public class ClusterSchemaFetcher implements ISchemaFetcher {
SchemaTree remoteSchemaTree;
if (!config.isAutoCreateSchemaEnabled()) {
- remoteSchemaTree = fetchSchema(patternTree, partitionFetcher.getSchemaPartition(patternTree));
+ remoteSchemaTree =
+ fetchSchema(patternTree, partitionFetcher.getSchemaPartition(patternTree, true));
schemaTree.mergeSchemaTree(remoteSchemaTree);
schemaCache.put(remoteSchemaTree);
return schemaTree;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/FakePartitionFetcherImpl.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/FakePartitionFetcherImpl.java
index 8738ae9cd9..38499227a0 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/FakePartitionFetcherImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/FakePartitionFetcherImpl.java
@@ -42,7 +42,7 @@ import java.util.Map;
public class FakePartitionFetcherImpl implements IPartitionFetcher {
@Override
- public SchemaPartition getSchemaPartition(PathPatternTree patternTree) {
+ public SchemaPartition getSchemaPartition(PathPatternTree patternTree, boolean matchTimeseries) {
return null;
}
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/IPartitionFetcher.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/IPartitionFetcher.java
index 93f0b6a202..8755d0c65b 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/IPartitionFetcher.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/IPartitionFetcher.java
@@ -29,7 +29,7 @@ import java.util.Map;
public interface IPartitionFetcher {
- SchemaPartition getSchemaPartition(PathPatternTree patternTree);
+ SchemaPartition getSchemaPartition(PathPatternTree patternTree, boolean matchTimeseries);
SchemaPartition getOrCreateSchemaPartition(PathPatternTree patternTree);
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java
index 5f291684b1..293d482449 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java
@@ -66,7 +66,7 @@ public class StandalonePartitionFetcher implements IPartitionFetcher {
}
@Override
- public SchemaPartition getSchemaPartition(PathPatternTree patternTree) {
+ public SchemaPartition getSchemaPartition(PathPatternTree patternTree, boolean matchTimeseries) {
patternTree.constructTree();
return new SchemaPartition(
localConfigNode.getSchemaPartition(patternTree),
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SourceRewriter.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SourceRewriter.java
index 676d93b3b4..2e7b6a76cd 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SourceRewriter.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SourceRewriter.java
@@ -173,9 +173,18 @@ public class SourceRewriter extends SimplePlanNodeRewriter<DistributionPlanConte
.getSchemaPartitionMap()
.forEach(
(storageGroup, deviceGroup) -> {
+ // try {
+ // if (seed.getPath().overlapWith(new
+ //
+ // PartialPath(storageGroup).concatNode(IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD))) {
deviceGroup.forEach(
(deviceGroupId, schemaRegionReplicaSet) ->
schemaRegions.add(schemaRegionReplicaSet));
+ // }
+ // } catch (IllegalPathException e) {
+ // // This won't happen because the storageGroup is always legal.
+ // throw new RuntimeException(e);
+ // }
});
int count = schemaRegions.size();
schemaRegions.forEach(
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/read/DevicesSchemaScanNode.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/read/DevicesSchemaScanNode.java
index 9961d5c668..7672e61296 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/read/DevicesSchemaScanNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/read/DevicesSchemaScanNode.java
@@ -119,4 +119,9 @@ public class DevicesSchemaScanNode extends SchemaQueryScanNode {
public int hashCode() {
return Objects.hash(super.hashCode(), hasSgCol);
}
+
+ @Override
+ public String toString() {
+ return String.format("DevicesSchemaScanNode-%s[Path: %s]", getPlanNodeId(), path);
+ }
}
diff --git a/thrift-confignode/src/main/thrift/confignode.thrift b/thrift-confignode/src/main/thrift/confignode.thrift
index f1bd0e0818..55c4460a44 100644
--- a/thrift-confignode/src/main/thrift/confignode.thrift
+++ b/thrift-confignode/src/main/thrift/confignode.thrift
@@ -108,6 +108,7 @@ struct TStorageGroupSchema {
// Schema
struct TSchemaPartitionReq {
1: required binary pathPatternTree
+ 2: required bool matchTimeseries
}
struct TSchemaPartitionResp {