You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/06/29 02:17:07 UTC

[GitHub] [iotdb] JackieTien97 commented on a diff in pull request #6373: [IOTDB-3498] [IOTDB-3517] Add ITs related to the group by & query result set in MPP

JackieTien97 commented on code in PR #6373:
URL: https://github.com/apache/iotdb/pull/6373#discussion_r909136643


##########
integration-test/import-control.xml:
##########
@@ -25,8 +25,10 @@
   <allow pkg="java.util"/>
   <allow pkg="java.sql"/>
   <allow pkg="java.io"/>
+  <allow pkg="java.text"/>

Review Comment:
   why we need to import this package?



##########
integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByNaturalMonthIT.java:
##########
@@ -0,0 +1,245 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.db.it.groupby;
+
+import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
+import org.apache.iotdb.itbase.category.ClusterIT;
+import org.apache.iotdb.itbase.category.LocalStandaloneIT;
+
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TimeZone;
+
+import static org.apache.iotdb.db.constant.TestConstant.sum;
+import static org.apache.iotdb.db.it.utils.TestUtils.assertTestFail;
+import static org.apache.iotdb.db.it.utils.TestUtils.prepareData;
+import static org.apache.iotdb.db.it.utils.TestUtils.resultSetEqualTest;
+import static org.apache.iotdb.itbase.constant.TestConstant.TIMESTAMP_STR;
+import static org.junit.Assert.fail;
+
+@RunWith(IoTDBTestRunner.class)
+public class IoTDBGroupByNaturalMonthIT {
+
+  private static final List<String> dataSet = new ArrayList<>();
+
+  static {
+    for (long i = 1604102400000L /*  2020-10-31 08:00:00 */;
+        i <= 1617148800000L /* 2021-03-31 08:00:00 */;
+        i += 86400_000L) {
+      dataSet.add("insert into root.sg1.d1(timestamp, temperature) values (" + i + ", 1)");
+    }
+  }
+
+  private static final DateFormat df = new SimpleDateFormat("MM/dd/yyyy:HH:mm:ss");
+
+  @BeforeClass
+  public static void setUp() throws Exception {
+    df.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
+    EnvFactory.getEnv().initBeforeClass();
+    prepareData(dataSet.toArray(new String[0]));
+  }
+
+  @AfterClass
+  public static void tearDown() throws Exception {
+    EnvFactory.getEnv().cleanAfterClass();
+  }
+
+  /**
+   * Test when interval = slidingStep = 1 month. StartTime: 2020-10-31 00:00:00, EndTime: 2021-03-01
+   * 00:00:00
+   */
+  @Test
+  @Category({LocalStandaloneIT.class, ClusterIT.class})

Review Comment:
   move it before class



##########
integration/src/test/java/org/apache/iotdb/db/integration/groupby/IoTDBGroupByFillIT.java:
##########
@@ -49,7 +50,7 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-@Category({LocalStandaloneTest.class})
+@Category({LocalStandaloneTest.class, ClusterTest.class})

Review Comment:
   ```suggestion
   @Category({LocalStandaloneTest.class})
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org