You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hu...@apache.org on 2022/11/23 04:29:16 UTC
[iotdb] 02/02: add test
This is an automated email from the ASF dual-hosted git repository.
hui pushed a commit to branch lmh/FixGroupByLevel
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 871756fd20eb52803e3465bfa415d171e8bacce9
Author: liuminghui233 <54...@qq.com>
AuthorDate: Wed Nov 23 12:28:28 2022 +0800
add test
---
.../db/it/aligned/IoTDBGroupByLevelQueryIT.java | 39 ++++++++++++++++++----
1 file changed, 32 insertions(+), 7 deletions(-)
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByLevelQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByLevelQueryIT.java
index 06c25d88fa..a49168f137 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByLevelQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByLevelQueryIT.java
@@ -38,6 +38,7 @@ import static org.apache.iotdb.db.it.utils.TestUtils.resultSetEqualTest;
import static org.apache.iotdb.itbase.constant.TestConstant.NULL;
@RunWith(IoTDBTestRunner.class)
+@Category({LocalStandaloneIT.class, ClusterIT.class})
public class IoTDBGroupByLevelQueryIT {
protected static boolean enableSeqSpaceCompaction;
@@ -98,7 +99,6 @@ public class IoTDBGroupByLevelQueryIT {
}
@Test
- @Category({LocalStandaloneIT.class, ClusterIT.class})
public void countFuncByLevelTest() {
// level = 1
double[][] retArray1 = new double[][] {{39, 20}};
@@ -135,7 +135,6 @@ public class IoTDBGroupByLevelQueryIT {
}
@Test
- @Category({LocalStandaloneIT.class, ClusterIT.class})
public void sumFuncByLevelTest() {
// level = 1
double[][] retArray1 = new double[][] {{131111, 510}};
@@ -169,7 +168,6 @@ public class IoTDBGroupByLevelQueryIT {
}
@Test
- @Category({LocalStandaloneIT.class, ClusterIT.class})
public void avgFuncByLevelTest() {
// level = 1
double[][] retArray1 = new double[][] {{2260.53448275862, 25.5}};
@@ -203,7 +201,6 @@ public class IoTDBGroupByLevelQueryIT {
}
@Test
- @Category({LocalStandaloneIT.class, ClusterIT.class})
public void timeFuncGroupByLevelTest() {
double[][] retArray1 = new double[][] {{1, 40, 1, 30}};
String[] columnNames1 = {
@@ -217,7 +214,6 @@ public class IoTDBGroupByLevelQueryIT {
}
@Test
- @Category({LocalStandaloneIT.class, ClusterIT.class})
public void valueFuncGroupByLevelTest() {
double[][] retArray1 = new double[][] {{40, 230000, 30, 30}};
String[] columnNames1 = {
@@ -233,7 +229,6 @@ public class IoTDBGroupByLevelQueryIT {
}
@Test
- @Category({ClusterIT.class})
public void nestedQueryTest1() {
// level = 1
double[][] retArray1 = new double[][] {{40.0, 21.0}};
@@ -255,7 +250,6 @@ public class IoTDBGroupByLevelQueryIT {
}
@Test
- @Category({ClusterIT.class})
public void nestedQueryTest2() {
// level = 1
double[][] retArray1 = new double[][] {{390423.0, 449.0, 390404.0, 430.0}};
@@ -285,4 +279,35 @@ public class IoTDBGroupByLevelQueryIT {
resultSetEqualTest(
"select count(s1) + sum(s1) from root.*.* group by level=3", retArray3, columnNames3);
}
+
+ @Test
+ public void caseSensitivityTest() {
+ double[][] retArray = new double[][] {{39, 20, 39, 20, 39, 20}};
+
+ String[] columnNames1 = {
+ "count(root.sg1.*.s1)",
+ "count(root.sg2.*.s1)",
+ "COUNT(root.sg1.*.s1)",
+ "COUNT(root.sg2.*.s1)",
+ "cOuNt(root.sg1.*.s1)",
+ "cOuNt(root.sg2.*.s1)"
+ };
+ resultSetEqualTest(
+ "select count(s1), COUNT(s1), cOuNt(s1) from root.*.* group by level=1",
+ retArray,
+ columnNames1);
+
+ String[] columnNames2 = {
+ "Count(root.sg1.*.s1)",
+ "Count(root.sg2.*.s1)",
+ "COUNT(root.sg1.*.s1)",
+ "COUNT(root.sg2.*.s1)",
+ "cOuNt(root.sg1.*.s1)",
+ "cOuNt(root.sg2.*.s1)"
+ };
+ resultSetEqualTest(
+ "select Count(s1), COUNT(s1), cOuNt(s1) from root.*.* group by level=1",
+ retArray,
+ columnNames2);
+ }
}