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 2021/12/17 08:30:13 UTC
[GitHub] [iotdb] ericpai commented on a change in pull request #4603: [IOTDB-2083] ID table implementation
ericpai commented on a change in pull request #4603:
URL: https://github.com/apache/iotdb/pull/4603#discussion_r771193847
##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/id_table/IDTable.java
##########
@@ -0,0 +1,178 @@
+/*
+ * 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.metadata.id_table;
Review comment:
It's not recommanded to use underscore '_' as a part of package name. I think 'idtable' is OK.
##########
File path: integration/src/test/java/org/apache/iotdb/db/integration/IoTDBQueryWithIDTableIT.java
##########
@@ -0,0 +1,291 @@
+/*
+ * 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.integration;
+
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.metadata.id_table.entry.DeviceIDFactory;
+import org.apache.iotdb.integration.env.EnvFactory;
+import org.apache.iotdb.itbase.category.ClusterTest;
+import org.apache.iotdb.itbase.category.LocalStandaloneTest;
+
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.fail;
+
+@Category({LocalStandaloneTest.class, ClusterTest.class})
+public class IoTDBQueryWithIDTableIT {
+
+ private static String[] sqls =
+ new String[] {
+ "SET STORAGE GROUP TO root.vehicle",
+ "SET STORAGE GROUP TO root.other",
+ "CREATE TIMESERIES root.vehicle.d0.s0 WITH DATATYPE=INT32, ENCODING=RLE",
+ "CREATE TIMESERIES root.vehicle.d0.s1 WITH DATATYPE=INT64, ENCODING=RLE",
+ "CREATE TIMESERIES root.vehicle.d0.s2 WITH DATATYPE=FLOAT, ENCODING=RLE",
+ "CREATE TIMESERIES root.vehicle.d0.s3 WITH DATATYPE=TEXT, ENCODING=PLAIN",
+ "CREATE TIMESERIES root.vehicle.d0.s4 WITH DATATYPE=BOOLEAN, ENCODING=PLAIN",
+ "CREATE TIMESERIES root.vehicle.d1.s0 WITH DATATYPE=INT32, ENCODING=RLE",
+ "CREATE TIMESERIES root.other.d1.s0 WITH DATATYPE=FLOAT, ENCODING=RLE",
+ "insert into root.vehicle.d0(timestamp,s0) values(1,101)",
+ "insert into root.vehicle.d0(timestamp,s0) values(2,198)",
+ "insert into root.vehicle.d0(timestamp,s0) values(100,99)",
+ "insert into root.vehicle.d0(timestamp,s0) values(101,99)",
+ "insert into root.vehicle.d0(timestamp,s0) values(102,80)",
+ "insert into root.vehicle.d0(timestamp,s0) values(103,99)",
+ "insert into root.vehicle.d0(timestamp,s0) values(104,90)",
+ "insert into root.vehicle.d0(timestamp,s0) values(105,99)",
+ "insert into root.vehicle.d0(timestamp,s0) values(106,99)",
+ "insert into root.vehicle.d0(timestamp,s0) values(2,10000)",
+ "insert into root.vehicle.d0(timestamp,s0) values(50,10000)",
+ "insert into root.vehicle.d0(timestamp,s0) values(1000,22222)",
+ "insert into root.vehicle.d0(timestamp,s1) values(1,1101)",
+ "insert into root.vehicle.d0(timestamp,s1) values(2,198)",
+ "flush",
+ "insert into root.vehicle.d0(timestamp,s1) values(100,199)",
+ "insert into root.vehicle.d0(timestamp,s1) values(101,199)",
+ "insert into root.vehicle.d0(timestamp,s1) values(102,180)",
+ "insert into root.vehicle.d0(timestamp,s1) values(103,199)",
+ "insert into root.vehicle.d0(timestamp,s1) values(104,190)",
+ "insert into root.vehicle.d0(timestamp,s1) values(105,199)",
+ "insert into root.vehicle.d0(timestamp,s1) values(2,40000)",
+ "insert into root.vehicle.d0(timestamp,s1) values(50,50000)",
+ "insert into root.vehicle.d0(timestamp,s1) values(1000,55555)",
+ "insert into root.vehicle.d0(timestamp,s1) values(2000-01-01T08:00:00+08:00, 100)",
+ "insert into root.vehicle.d0(timestamp,s2) values(1000,55555)",
+ "insert into root.vehicle.d0(timestamp,s2) values(2,2.22)",
+ "insert into root.vehicle.d0(timestamp,s2) values(3,3.33)",
+ "insert into root.vehicle.d0(timestamp,s2) values(4,4.44)",
+ "insert into root.vehicle.d0(timestamp,s2) values(102,10.00)",
+ "insert into root.vehicle.d0(timestamp,s2) values(105,11.11)",
+ "insert into root.vehicle.d0(timestamp,s2) values(1000,1000.11)",
+ "insert into root.vehicle.d0(timestamp,s3) values(60,'aaaaa')",
+ "insert into root.vehicle.d0(timestamp,s3) values(70,'bbbbb')",
+ "insert into root.vehicle.d0(timestamp,s3) values(80,'ccccc')",
+ "insert into root.vehicle.d0(timestamp,s3) values(101,'ddddd')",
+ "insert into root.vehicle.d0(timestamp,s3) values(102,'fffff')",
+ "insert into root.vehicle.d0(timestamp,s3) values(2000-01-01T08:00:00+08:00, 'good')",
+ "insert into root.vehicle.d0(timestamp,s4) values(100, false)",
+ "insert into root.vehicle.d0(timestamp,s4) values(100, true)",
+ "insert into root.vehicle.d1(timestamp,s0) values(1,999)",
+ "insert into root.vehicle.d1(timestamp,s0) values(1000,888)",
+ "insert into root.other.d1(timestamp,s0) values(2, 3.14)",
+ };
+
+ private static boolean isEnableIDTable = false;
+
+ private static String originalDeviceIDTransformationMethod = null;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ IoTDBDescriptor.getInstance().getConfig().setAutoCreateSchemaEnabled(true);
Review comment:
By using new IT framework, altering config via IoTDBDescriptor is not worked in cluster test. Please add new methods to 'org.apache.iotdb.itbase.env.BaseConfig' and implements them.
##########
File path: integration/src/test/java/org/apache/iotdb/db/integration/IoTDBQueryWithIDTableIT.java
##########
@@ -0,0 +1,291 @@
+/*
+ * 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.integration;
+
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.metadata.id_table.entry.DeviceIDFactory;
+import org.apache.iotdb.integration.env.EnvFactory;
+import org.apache.iotdb.itbase.category.ClusterTest;
+import org.apache.iotdb.itbase.category.LocalStandaloneTest;
+
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.fail;
+
+@Category({LocalStandaloneTest.class, ClusterTest.class})
Review comment:
If you category IT to `ClusterTest.class`. Please make sure that it's really passed in a cluster test.
--
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