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

xiangweiwei pushed a commit to branch clusterQueryOpt
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/clusterQueryOpt by this push:
     new a2a4e27  throw exception when getValues() method
a2a4e27 is described below

commit a2a4e27cd196f524d62f3470b35ecc44c1c0dda8
Author: Alima777 <[email protected]>
AuthorDate: Sun Mar 14 20:21:42 2021 +0800

    throw exception when getValues() method
---
 .../tsfile/read/query/timegenerator/TimeGenerator.java   | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git 
a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/query/timegenerator/TimeGenerator.java
 
b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/query/timegenerator/TimeGenerator.java
index 2ea5fb8..0e79605 100644
--- 
a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/query/timegenerator/TimeGenerator.java
+++ 
b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/query/timegenerator/TimeGenerator.java
@@ -67,13 +67,21 @@ public abstract class TimeGenerator {
   }
 
   /** ATTENTION: this method should only be used when there is no `OR` node */
-  public Object[] getValues(Path path) {
-    return leafValuesCache.get(path) == null ? null : 
leafValuesCache.remove(path).toArray();
+  public Object[] getValues(Path path) throws IOException {
+    if (leafValuesCache.get(path) == null) {
+      throw new IOException(
+          "getValues() method should not be invoked by non-existent path in 
where clause");
+    }
+    return leafValuesCache.remove(path).toArray();
   }
 
   /** ATTENTION: this method should only be used when there is no `OR` node */
-  public Object getValue(Path path) {
-    return leafValuesCache.get(path) == null ? null : 
leafValuesCache.get(path).remove(0);
+  public Object getValue(Path path) throws IOException {
+    if (leafValuesCache.get(path) == null) {
+      throw new IOException(
+          "getValues() method should not be invoked by non-existent path in 
where clause");
+    }
+    return leafValuesCache.get(path).remove(0);
   }
 
   public void constructNode(IExpression expression) throws IOException {

Reply via email to