This is an automated email from the ASF dual-hosted git repository.

chaow pushed a commit to branch rel/0.12
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/0.12 by this push:
     new 0cb1e4f  [IOTDB-1407][To rel/0.12] Filtering time series based on tags 
query fails Occasion… (#3529)
0cb1e4f is described below

commit 0cb1e4f83470afa8899308b16d4f057d80f5a513
Author: wangchao316 <[email protected]>
AuthorDate: Thu Jul 8 14:41:15 2021 +0800

    [IOTDB-1407][To rel/0.12] Filtering time series based on tags query fails 
Occasion… (#3529)
---
 .../apache/iotdb/cluster/metadata/CMManager.java    | 11 ++++++++++-
 .../iotdb/cluster/common/TestAsyncDataClient.java   | 11 +++++++++++
 .../cluster/query/ClusterPlanExecutorTest.java      | 21 +++++++++++++++++++++
 .../assembly/resources/conf/iotdb-engine.properties |  6 +++---
 4 files changed, 45 insertions(+), 4 deletions(-)

diff --git 
a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java 
b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
index 12c1116..43eeeb6 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
@@ -1568,7 +1568,16 @@ public class CMManager extends MManager {
     ExecutorService pool =
         new ThreadPoolExecutor(
             THREAD_POOL_SIZE, THREAD_POOL_SIZE, 0, TimeUnit.SECONDS, new 
LinkedBlockingDeque<>());
-    List<PartitionGroup> globalGroups = 
metaGroupMember.getPartitionTable().getGlobalGroups();
+
+    List<PartitionGroup> globalGroups = new ArrayList<>();
+    try {
+      PartitionGroup partitionGroup =
+          
metaGroupMember.getPartitionTable().partitionByPathTime(plan.getPath(), 0);
+      globalGroups.add(partitionGroup);
+    } catch (MetadataException e) {
+      // if the path location is not find, obtain the path location from all 
groups.
+      globalGroups = metaGroupMember.getPartitionTable().getGlobalGroups();
+    }
 
     int limit = plan.getLimit() == 0 ? Integer.MAX_VALUE : plan.getLimit();
     int offset = plan.getOffset();
diff --git 
a/cluster/src/test/java/org/apache/iotdb/cluster/common/TestAsyncDataClient.java
 
b/cluster/src/test/java/org/apache/iotdb/cluster/common/TestAsyncDataClient.java
index c5461dc..8b0baab 100644
--- 
a/cluster/src/test/java/org/apache/iotdb/cluster/common/TestAsyncDataClient.java
+++ 
b/cluster/src/test/java/org/apache/iotdb/cluster/common/TestAsyncDataClient.java
@@ -273,4 +273,15 @@ public class TestAsyncDataClient extends AsyncDataClient {
                     .previousFill(request, resultHandler))
         .start();
   }
+
+  @Override
+  public void getAllMeasurementSchema(
+      Node header, ByteBuffer planBinary, AsyncMethodCallback<ByteBuffer> 
resultHandler) {
+    new Thread(
+            () -> {
+              new DataAsyncService(dataGroupMemberMap.get(header))
+                  .getAllMeasurementSchema(header, planBinary, resultHandler);
+            })
+        .start();
+  }
 }
diff --git 
a/cluster/src/test/java/org/apache/iotdb/cluster/query/ClusterPlanExecutorTest.java
 
b/cluster/src/test/java/org/apache/iotdb/cluster/query/ClusterPlanExecutorTest.java
index d6585b9..5de2ce2 100644
--- 
a/cluster/src/test/java/org/apache/iotdb/cluster/query/ClusterPlanExecutorTest.java
+++ 
b/cluster/src/test/java/org/apache/iotdb/cluster/query/ClusterPlanExecutorTest.java
@@ -25,6 +25,7 @@ import 
org.apache.iotdb.db.exception.query.QueryProcessException;
 import org.apache.iotdb.db.metadata.PartialPath;
 import org.apache.iotdb.db.metadata.mnode.StorageGroupMNode;
 import org.apache.iotdb.db.qp.physical.crud.RawDataQueryPlan;
+import org.apache.iotdb.db.qp.physical.sys.ShowTimeSeriesPlan;
 import org.apache.iotdb.db.query.context.QueryContext;
 import org.apache.iotdb.db.query.control.QueryResourceManager;
 import org.apache.iotdb.db.service.IoTDB;
@@ -88,4 +89,24 @@ public class ClusterPlanExecutorTest extends BaseQueryTest {
           allStorageGroupNodes.get(i).getFullPath());
     }
   }
+
+  @Test
+  public void testShowTimeseries()
+      throws StorageEngineException, QueryFilterOptimizationException, 
MetadataException,
+          IOException, InterruptedException, QueryProcessException {
+    ShowTimeSeriesPlan showTimeSeriesPlan = new 
ShowTimeSeriesPlan(pathList.get(0));
+    QueryContext context =
+        new 
RemoteQueryContext(QueryResourceManager.getInstance().assignQueryId(true, 1024, 
-1));
+    try {
+      QueryDataSet dataSet = queryExecutor.processQuery(showTimeSeriesPlan, 
context);
+      int count = 0;
+      while (dataSet.hasNext()) {
+        dataSet.next();
+        count++;
+      }
+      assertEquals(count, 1);
+    } finally {
+      QueryResourceManager.getInstance().endQuery(context.getQueryId());
+    }
+  }
 }
diff --git a/server/src/assembly/resources/conf/iotdb-engine.properties 
b/server/src/assembly/resources/conf/iotdb-engine.properties
index bb754f1..e646807 100644
--- a/server/src/assembly/resources/conf/iotdb-engine.properties
+++ b/server/src/assembly/resources/conf/iotdb-engine.properties
@@ -249,7 +249,7 @@ timestamp_precision=ms
 
 # Memory Allocation Ratio: Write, Read, Schema and Free Memory.
 # The parameter form is a:b:c:d, where a, b, c and d are integers. for 
example: 1:1:1:1 , 6:2:1:1
-# If you have high level of writing pressure and low level of reading 
pressure, please adjust it to for example 6:1:1:2 
+# If you have high level of writing pressure and low level of reading 
pressure, please adjust it to for example 6:1:1:2
 # write_read_schema_free_memory_proportion=4:3:1:2
 
 # primitive array size (length of each array) in array pool
@@ -263,7 +263,7 @@ timestamp_precision=ms
 # buffered_arrays_memory_proportion=0.6
 
 # Ratio of write memory for rejecting insertion, 0.8 by default
-# If you have extremely high write load (like batch=1000) and the physical 
memory size is large enough, 
+# If you have extremely high write load (like batch=1000) and the physical 
memory size is large enough,
 # it can be set higher than the default value like 0.9
 # reject_proportion=0.8
 
@@ -682,4 +682,4 @@ timestamp_precision=ms
 
 # admin password, default is root
 # Datatype: string
-# admin_password=root
+# admin_password=root
\ No newline at end of file

Reply via email to