This is an automated email from the ASF dual-hosted git repository. jackietien pushed a commit to branch DeletionIT in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 30099ec44e68edf8725bedda037c00aeb296a567 Author: JackieTien97 <[email protected]> AuthorDate: Mon Jun 13 15:37:19 2022 +0800 Add delete IT --- .../org/apache/iotdb/it/env/ClusterEnvConfig.java | 6 + .../org/apache/iotdb/itbase/env/BaseConfig.java | 12 + .../db/it/aligned/IoTDBInsertAlignedValues2IT.java | 115 ++++++++ .../db/it/aligned/IoTDBInsertAlignedValues3IT.java | 116 ++++++++ .../db/it/aligned/IoTDBInsertAlignedValues4IT.java | 72 +++++ .../db/it/aligned/IoTDBInsertAlignedValuesIT.java | 281 ++++++++++++++++++ .../it/aligned/IoTDBLastQueryWithDeletion2IT.java | 74 +++++ .../it/aligned/IoTDBLastQueryWithDeletionIT.java | 320 +++++++++++++++++++++ ...DBLastQueryWithoutLastCacheWithDeletion2IT.java | 78 +++++ ...TDBLastQueryWithoutLastCacheWithDeletionIT.java | 77 +++++ .../iotdb/db/it/env/StandaloneEnvConfig.java | 16 ++ 11 files changed, 1167 insertions(+) diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/ClusterEnvConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/ClusterEnvConfig.java index f0a3e2d957..a4cf78e147 100644 --- a/integration-test/src/main/java/org/apache/iotdb/it/env/ClusterEnvConfig.java +++ b/integration-test/src/main/java/org/apache/iotdb/it/env/ClusterEnvConfig.java @@ -185,4 +185,10 @@ public class ClusterEnvConfig implements BaseConfig { engineProperties.setProperty("enable_last_cache", String.valueOf(lastCacheEnable)); return this; } + + @Override + public BaseConfig setPrimitiveArraySize(int primitiveArraySize) { + engineProperties.setProperty("primitive_array_size", String.valueOf(primitiveArraySize)); + return this; + } } diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseConfig.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseConfig.java index 28f015b850..bc2504582d 100644 --- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseConfig.java +++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseConfig.java @@ -137,4 +137,16 @@ public interface BaseConfig { default int getMaxNumberOfPointsInPage() { return 1024 * 1024; } + + default boolean isAutoCreateSchemaEnabled() { + return true; + } + + default BaseConfig setPrimitiveArraySize(int primitiveArraySize) { + return this; + } + + default int getPrimitiveArraySize() { + return 32; + } } diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues2IT.java new file mode 100644 index 0000000000..be125323f1 --- /dev/null +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues2IT.java @@ -0,0 +1,115 @@ +/* + * 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.aligned; + +import org.apache.iotdb.it.env.ConfigFactory; +import org.apache.iotdb.it.env.EnvFactory; +import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import static org.junit.Assert.assertEquals; + +public class IoTDBInsertAlignedValues2IT { + private int numOfPointsPerPage; + private boolean autoCreateSchemaEnabled; + + @Before + public void setUp() throws Exception { + numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage(); + autoCreateSchemaEnabled = ConfigFactory.getConfig().isAutoCreateSchemaEnabled(); + ConfigFactory.getConfig().setAutoCreateSchemaEnabled(true); + TSFileDescriptor.getInstance().getConfig().setMaxNumberOfPointsInPage(2); + EnvFactory.getEnv().initBeforeClass(); + } + + @After + public void tearDown() throws Exception { + EnvFactory.getEnv().cleanAfterClass(); + ConfigFactory.getConfig().setAutoCreateSchemaEnabled(autoCreateSchemaEnabled); + ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage); + } + + @Test + public void testInsertAlignedWithEmptyPage() throws SQLException { + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + // TODO change it to executeBatch way when it's supported in new cluster + statement.execute( + "CREATE ALIGNED TIMESERIES root.lz.dev.GPS(S1 INT32 encoding=PLAIN compressor=SNAPPY, S2 INT32 encoding=PLAIN compressor=SNAPPY, S3 INT32 encoding=PLAIN compressor=SNAPPY) "); + for (int i = 0; i < 100; i++) { + if (i == 99) { + statement.execute( + "insert into root.lz.dev.GPS(time,S1,S3) aligned values(" + + i + + "," + + i + + "," + + i + + ")"); + } else { + statement.execute( + "insert into root.lz.dev.GPS(time,S1,S2) aligned values(" + + i + + "," + + i + + "," + + i + + ")"); + } + } + + // TODO we need to recover it while flush is supported in cluster mode + // statement.execute("flush"); + int rowCount = 0; + try (ResultSet resultSet = statement.executeQuery("select S3 from root.lz.dev.GPS")) { + while (resultSet.next()) { + assertEquals(99, resultSet.getInt(2)); + rowCount++; + } + assertEquals(1, rowCount); + } + + try (ResultSet resultSet = statement.executeQuery("select S2 from root.lz.dev.GPS")) { + rowCount = 0; + while (resultSet.next()) { + assertEquals(rowCount, resultSet.getInt(2)); + rowCount++; + } + assertEquals(99, rowCount); + } + + try (ResultSet resultSet = statement.executeQuery("select S1 from root.lz.dev.GPS")) { + rowCount = 0; + while (resultSet.next()) { + assertEquals(rowCount, resultSet.getInt(2)); + rowCount++; + } + assertEquals(100, rowCount); + } + } + } +} diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues3IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues3IT.java new file mode 100644 index 0000000000..ddd097cb17 --- /dev/null +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues3IT.java @@ -0,0 +1,116 @@ +/* + * 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.aligned; + +import org.apache.iotdb.it.env.ConfigFactory; +import org.apache.iotdb.it.env.EnvFactory; +import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import static org.junit.Assert.assertEquals; + +public class IoTDBInsertAlignedValues3IT { + private int numOfPointsPerPage; + private boolean autoCreateSchemaEnabled; + + @Before + public void setUp() throws Exception { + numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage(); + autoCreateSchemaEnabled = ConfigFactory.getConfig().isAutoCreateSchemaEnabled(); + ConfigFactory.getConfig().setAutoCreateSchemaEnabled(true); + TSFileDescriptor.getInstance().getConfig().setMaxNumberOfPointsInPage(4); + EnvFactory.getEnv().initBeforeClass(); + } + + @After + public void tearDown() throws Exception { + EnvFactory.getEnv().cleanAfterClass(); + ConfigFactory.getConfig().setAutoCreateSchemaEnabled(autoCreateSchemaEnabled); + ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage); + } + + @Test + public void testInsertAlignedWithEmptyPage2() throws SQLException { + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + // TODO change it to executeBatch way when it's supported in new cluster + statement.execute( + "CREATE ALIGNED TIMESERIES root.lz.dev.GPS(S1 INT32 encoding=PLAIN compressor=SNAPPY, S2 INT32 encoding=PLAIN compressor=SNAPPY, S3 INT32 encoding=PLAIN compressor=SNAPPY) "); + for (int i = 0; i < 100; i++) { + if (i >= 49) { + statement.execute( + "insert into root.lz.dev.GPS(time,S1,S2,S3) aligned values(" + + i + + "," + + i + + "," + + i + + "," + + i + + ")"); + } else { + statement.execute( + "insert into root.lz.dev.GPS(time,S1,S2) aligned values(" + + i + + "," + + i + + "," + + i + + ")"); + } + } + // TODO we need to recover it while flush is supported in cluster mode + // statement.execute("flush"); + int rowCount = 0; + try (ResultSet resultSet = statement.executeQuery("select S3 from root.lz.dev.GPS")) { + while (resultSet.next()) { + assertEquals(rowCount + 49, resultSet.getInt(2)); + rowCount++; + } + assertEquals(51, rowCount); + } + + try (ResultSet resultSet = statement.executeQuery("select S2 from root.lz.dev.GPS")) { + rowCount = 0; + while (resultSet.next()) { + assertEquals(rowCount, resultSet.getInt(2)); + rowCount++; + } + assertEquals(100, rowCount); + } + + try (ResultSet resultSet = statement.executeQuery("select S1 from root.lz.dev.GPS")) { + rowCount = 0; + while (resultSet.next()) { + assertEquals(rowCount, resultSet.getInt(2)); + rowCount++; + } + assertEquals(100, rowCount); + } + } + } +} diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues4IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues4IT.java new file mode 100644 index 0000000000..b0fa79567f --- /dev/null +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues4IT.java @@ -0,0 +1,72 @@ +/* + * 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.aligned; + +import org.apache.iotdb.it.env.ConfigFactory; +import org.apache.iotdb.it.env.EnvFactory; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; + +import static org.junit.Assert.fail; + +public class IoTDBInsertAlignedValues4IT { + private boolean autoCreateSchemaEnabled; + private int primitiveArraySize; + + @Before + public void setUp() throws Exception { + autoCreateSchemaEnabled = ConfigFactory.getConfig().isAutoCreateSchemaEnabled(); + primitiveArraySize = ConfigFactory.getConfig().getPrimitiveArraySize(); + ConfigFactory.getConfig().setAutoCreateSchemaEnabled(true); + ConfigFactory.getConfig().setPrimitiveArraySize(2); + EnvFactory.getEnv().initBeforeClass(); + } + + @After + public void tearDown() throws Exception { + EnvFactory.getEnv().cleanAfterClass(); + ConfigFactory.getConfig().setAutoCreateSchemaEnabled(autoCreateSchemaEnabled); + ConfigFactory.getConfig().setPrimitiveArraySize(primitiveArraySize); + } + + @Test + public void testExtendTextColumn() { + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + statement.execute("insert into root.sg.d1(time,s1,s2) aligned values(1,'test','test')"); + statement.execute("insert into root.sg.d1(time,s1,s2) aligned values(2,'test','test')"); + statement.execute("insert into root.sg.d1(time,s1,s2) aligned values(3,'test','test')"); + statement.execute("insert into root.sg.d1(time,s1,s2) aligned values(4,'test','test')"); + statement.execute("insert into root.sg.d1(time,s1,s3) aligned values(5,'test','test')"); + statement.execute("insert into root.sg.d1(time,s1,s2) aligned values(6,'test','test')"); + // TODO we need to recover it while flush is supported in cluster mode + // statement.execute("flush"); + statement.execute("insert into root.sg.d1(time,s1,s3) aligned values(7,'test','test')"); + } catch (SQLException e) { + fail(); + } + } +} diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java new file mode 100644 index 0000000000..1a0df9eefa --- /dev/null +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java @@ -0,0 +1,281 @@ +/* + * 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.aligned; + +import org.apache.iotdb.it.env.ConfigFactory; +import org.apache.iotdb.it.env.EnvFactory; +import org.apache.iotdb.itbase.category.ClusterIT; +import org.apache.iotdb.itbase.category.LocalStandaloneIT; +import org.apache.iotdb.jdbc.IoTDBSQLException; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +@Category({LocalStandaloneIT.class, ClusterIT.class}) +public class IoTDBInsertAlignedValuesIT { + private boolean autoCreateSchemaEnabled; + + @Before + public void setUp() throws Exception { + autoCreateSchemaEnabled = ConfigFactory.getConfig().isAutoCreateSchemaEnabled(); + ConfigFactory.getConfig().setAutoCreateSchemaEnabled(true); + EnvFactory.getEnv().initBeforeClass(); + } + + @After + public void tearDown() throws Exception { + EnvFactory.getEnv().cleanAfterClass(); + ConfigFactory.getConfig().setAutoCreateSchemaEnabled(autoCreateSchemaEnabled); + } + + @Test + public void testInsertAlignedValues() throws SQLException { + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + // TODO change it to executeBatch way when it's supported in new cluster + statement.execute( + "insert into root.t1.wf01.wt01(time, status, temperature) aligned values (4000, true, 17.1)"); + statement.execute( + "insert into root.t1.wf01.wt01(time, status, temperature) aligned values (5000, true, 20.1)"); + statement.execute( + "insert into root.t1.wf01.wt01(time, status, temperature) aligned values (6000, true, 22)"); + + try (ResultSet resultSet = statement.executeQuery("select status from root.t1.wf01.wt01")) { + assertTrue(resultSet.next()); + assertTrue(resultSet.getBoolean(2)); + assertTrue(resultSet.next()); + assertTrue(resultSet.getBoolean(2)); + assertTrue(resultSet.next()); + assertTrue(resultSet.getBoolean(2)); + assertFalse(resultSet.next()); + } + + try (ResultSet resultSet = + statement.executeQuery("select status, temperature from root.t1.wf01.wt01")) { + + assertTrue(resultSet.next()); + assertEquals(4000, resultSet.getLong(1)); + assertTrue(resultSet.getBoolean(2)); + assertEquals(17.1, resultSet.getFloat(3), 0.1); + + assertTrue(resultSet.next()); + assertEquals(5000, resultSet.getLong(1)); + assertTrue(resultSet.getBoolean(2)); + assertEquals(20.1, resultSet.getFloat(3), 0.1); + + assertTrue(resultSet.next()); + assertEquals(6000, resultSet.getLong(1)); + assertTrue(resultSet.getBoolean(2)); + assertEquals(22, resultSet.getFloat(3), 0.1); + + assertFalse(resultSet.next()); + } + } + } + + @Test + public void testInsertAlignedNullableValues() throws SQLException { + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + // TODO change it to executeBatch way when it's supported in new cluster + statement.execute( + "insert into root.t1.wf01.wt01(time, status, temperature) aligned values (4000, true, 17.1)"); + statement.execute("insert into root.t1.wf01.wt01(time, status) aligned values (5000, true)"); + statement.execute( + "insert into root.t1.wf01.wt01(time, temperature) aligned values (6000, 22)"); + + try (ResultSet resultSet = statement.executeQuery("select status from root.t1.wf01.wt01")) { + assertTrue(resultSet.next()); + assertTrue(resultSet.getBoolean(2)); + assertTrue(resultSet.next()); + assertTrue(resultSet.getBoolean(2)); + assertFalse(resultSet.next()); + } + + try (ResultSet resultSet = + statement.executeQuery("select status, temperature from root.t1.wf01.wt01")) { + + assertTrue(resultSet.next()); + assertEquals(4000, resultSet.getLong(1)); + assertTrue(resultSet.getBoolean(2)); + assertEquals(17.1, resultSet.getFloat(3), 0.1); + + assertTrue(resultSet.next()); + assertEquals(5000, resultSet.getLong(1)); + assertTrue(resultSet.getBoolean(2)); + assertNull(resultSet.getObject(3)); + + assertTrue(resultSet.next()); + assertEquals(6000, resultSet.getLong(1)); + assertNull(resultSet.getObject(2)); + assertEquals(22.0f, resultSet.getObject(3)); + + assertFalse(resultSet.next()); + } + } + } + + @Test + public void testUpdatingAlignedValues() throws SQLException { + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + // TODO change it to executeBatch way when it's supported in new cluster + statement.execute( + "insert into root.t1.wf01.wt01(time, status, temperature) aligned values (4000, true, 17.1)"); + statement.execute("insert into root.t1.wf01.wt01(time, status) aligned values (5000, true)"); + statement.execute( + "insert into root.t1.wf01.wt01(time, temperature) aligned values (5000, 20.1)"); + statement.execute( + "insert into root.t1.wf01.wt01(time, temperature) aligned values (6000, 22)"); + statement.close(); + + try (ResultSet resultSet = statement.executeQuery("select status from root.t1.wf01.wt01")) { + assertTrue(resultSet.next()); + assertTrue(resultSet.getBoolean(2)); + assertTrue(resultSet.next()); + assertTrue(resultSet.getBoolean(2)); + assertFalse(resultSet.next()); + } + + try (ResultSet resultSet = + statement.executeQuery("select status, temperature from root.t1.wf01.wt01")) { + + assertTrue(resultSet.next()); + assertEquals(4000, resultSet.getLong(1)); + assertTrue(resultSet.getBoolean(2)); + assertEquals(17.1, resultSet.getFloat(3), 0.1); + + assertTrue(resultSet.next()); + assertEquals(5000, resultSet.getLong(1)); + assertTrue(resultSet.getBoolean(2)); + assertEquals(20.1, resultSet.getFloat(3), 0.1); + + assertTrue(resultSet.next()); + assertEquals(6000, resultSet.getLong(1)); + assertNull(resultSet.getObject(2)); + assertEquals(22.0f, resultSet.getObject(3)); + + assertFalse(resultSet.next()); + } + + // TODO we need to recover it while flush is supported in cluster mode + // statement.execute("flush"); + try (ResultSet resultSet = statement.executeQuery("select status from root.t1.wf01.wt01")) { + assertTrue(resultSet.next()); + assertTrue(resultSet.getBoolean(2)); + assertTrue(resultSet.next()); + assertTrue(resultSet.getBoolean(2)); + assertFalse(resultSet.next()); + } + + try (ResultSet resultSet = + statement.executeQuery("select status, temperature from root.t1.wf01.wt01")) { + + assertTrue(resultSet.next()); + assertEquals(4000, resultSet.getLong(1)); + assertTrue(resultSet.getBoolean(2)); + assertEquals(17.1, resultSet.getFloat(3), 0.1); + + assertTrue(resultSet.next()); + assertEquals(5000, resultSet.getLong(1)); + assertTrue(resultSet.getBoolean(2)); + assertEquals(20.1, resultSet.getFloat(3), 0.1); + + assertTrue(resultSet.next()); + assertEquals(6000, resultSet.getLong(1)); + assertNull(resultSet.getObject(2)); + assertEquals(22.0f, resultSet.getObject(3)); + + assertFalse(resultSet.next()); + } + } + } + + @Test(expected = Exception.class) + public void testInsertWithWrongMeasurementNum1() throws SQLException { + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + statement.execute( + "insert into root.t1.wf01.wt01(time, status, temperature) aligned values(11000, 100)"); + } + } + + @Test(expected = Exception.class) + public void testInsertWithWrongMeasurementNum2() throws SQLException { + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + statement.execute( + "insert into root.t1.wf01.wt01(time, status, temperature) aligned values(11000, 100, 300, 400)"); + } + } + + @Test + public void testInsertWithWrongType() throws SQLException { + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + statement.execute( + "CREATE ALIGNED TIMESERIES root.lz.dev.GPS(latitude INT32 encoding=PLAIN compressor=SNAPPY, longitude INT32 encoding=PLAIN compressor=SNAPPY) "); + statement.execute( + "insert into root.lz.dev.GPS(time,latitude,longitude) aligned values(1,1.3,6.7)"); + fail(); + } catch (IoTDBSQLException e) { + assertEquals(313, e.getErrorCode()); + } + } + + @Test + public void testInsertAlignedValuesWithThreeLevelPath() throws SQLException { + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + statement.execute("insert into root.sg_device(time, status) aligned values (4000, true)"); + + try (ResultSet resultSet = statement.executeQuery("select ** from root")) { + assertTrue(resultSet.next()); + assertTrue(resultSet.getBoolean(2)); + assertFalse(resultSet.next()); + } + } + } + + @Test + public void testInsertWithDuplicatedMeasurements() { + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + statement.execute( + "insert into root.t1.wf01.wt01(time, s3, status, status) aligned values(100, true, 20.1, 20.2)"); + fail(); + } catch (SQLException e) { + assertEquals("411: Insertion contains duplicated measurement: status", e.getMessage()); + } + } +} diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletion2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletion2IT.java new file mode 100644 index 0000000000..c23a09b6ef --- /dev/null +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletion2IT.java @@ -0,0 +1,74 @@ +/* + * 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.aligned; + +import org.apache.iotdb.it.env.ConfigFactory; +import org.apache.iotdb.it.env.EnvFactory; +import org.apache.iotdb.itbase.category.ClusterIT; +import org.apache.iotdb.itbase.category.LocalStandaloneIT; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.experimental.categories.Category; + +import java.sql.Connection; +import java.sql.Statement; + +import static org.junit.Assert.fail; + +@Category({LocalStandaloneIT.class, ClusterIT.class}) +public class IoTDBLastQueryWithDeletion2IT extends IoTDBLastQueryWithDeletionIT { + + private static int numOfPointsPerPage; + + @BeforeClass + public static void setUp() throws Exception { + enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction(); + enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction(); + enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction(); + numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage(); + + ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false); + ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false); + ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false); + ConfigFactory.getConfig().setMaxNumberOfPointsInPage(3); + EnvFactory.getEnv().initBeforeClass(); + AlignedWriteUtil.insertData(); + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + // TODO replace it while delete timeseries is supported in cluster mode + // statement.execute("delete timeseries root.sg1.d1.s2"); + statement.execute("delete timeseries root.sg1.d1.s2 where time <= 40"); + statement.execute("delete from root.sg1.d1.s1 where time <= 27"); + } catch (Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } + + @AfterClass + public static void tearDown() throws Exception { + EnvFactory.getEnv().cleanAfterClass(); + ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction); + ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction); + ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction); + ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage); + } +} diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletionIT.java new file mode 100644 index 0000000000..19e31c4b4a --- /dev/null +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletionIT.java @@ -0,0 +1,320 @@ +/* + * 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.aligned; + +import org.apache.iotdb.it.env.ConfigFactory; +import org.apache.iotdb.it.env.EnvFactory; +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 java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +import static org.apache.iotdb.db.constant.TestConstant.DATA_TYPE_STR; +import static org.apache.iotdb.db.constant.TestConstant.TIMESEIRES_STR; +import static org.apache.iotdb.db.constant.TestConstant.TIMESTAMP_STR; +import static org.apache.iotdb.db.constant.TestConstant.VALUE_STR; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +@Category({LocalStandaloneIT.class, ClusterIT.class}) +public class IoTDBLastQueryWithDeletionIT { + + protected static boolean enableSeqSpaceCompaction; + protected static boolean enableUnseqSpaceCompaction; + protected static boolean enableCrossSpaceCompaction; + + @BeforeClass + public static void setUp() throws Exception { + enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction(); + enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction(); + enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction(); + ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false); + ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false); + ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false); + EnvFactory.getEnv().initBeforeClass(); + AlignedWriteUtil.insertData(); + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + // TODO replace it while delete timeseries is supported in cluster mode + // statement.execute("delete timeseries root.sg1.d1.s2"); + statement.execute("delete timeseries root.sg1.d1.s2 where time <= 40"); + statement.execute("delete from root.sg1.d1.s1 where time <= 27"); + } catch (Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } + + @AfterClass + public static void tearDown() throws Exception { + EnvFactory.getEnv().cleanAfterClass(); + ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction); + ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction); + ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction); + } + + @Test + public void selectAllAlignedLastTest() { + Set<String> retSet = + new HashSet<>( + Arrays.asList( + "30,root.sg1.d1.s3,30,INT64", + "30,root.sg1.d1.s4,false,BOOLEAN", + "40,root.sg1.d1.s5,aligned_test40,TEXT")); + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery("select last * from root.sg1.d1")) { + + int cnt = 0; + while (resultSet.next()) { + String ans = + resultSet.getString(TIMESTAMP_STR) + + "," + + resultSet.getString(TIMESEIRES_STR) + + "," + + resultSet.getString(VALUE_STR) + + "," + + resultSet.getString(DATA_TYPE_STR); + Assert.assertTrue(retSet.contains(ans)); + cnt++; + assertEquals(retSet.size(), cnt); + } + + } catch (SQLException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } + + @Test + public void selectAllAlignedAndNonAlignedLastTest() { + + Set<String> retSet = + new HashSet<>( + Arrays.asList( + "30,root.sg1.d1.s3,30,INT64", + "30,root.sg1.d1.s4,false,BOOLEAN", + "40,root.sg1.d1.s5,aligned_test40,TEXT", + "20,root.sg1.d2.s1,20.0,FLOAT", + "40,root.sg1.d2.s2,40,INT32", + "30,root.sg1.d2.s3,30,INT64", + "30,root.sg1.d2.s4,false,BOOLEAN", + "40,root.sg1.d2.s5,non_aligned_test40,TEXT")); + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery("select last * from root.sg1.*")) { + + int cnt = 0; + while (resultSet.next()) { + String ans = + resultSet.getString(TIMESTAMP_STR) + + "," + + resultSet.getString(TIMESEIRES_STR) + + "," + + resultSet.getString(VALUE_STR) + + "," + + resultSet.getString(DATA_TYPE_STR); + Assert.assertTrue(retSet.contains(ans)); + cnt++; + } + assertEquals(retSet.size(), cnt); + + } catch (SQLException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } + + @Test + public void selectAllAlignedLastWithTimeFilterTest() { + + Set<String> retSet = + new HashSet<>(Collections.singletonList("40,root.sg1.d1.s5,aligned_test40,TEXT")); + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = + statement.executeQuery("select last * from root.sg1.d1 where time > 30")) { + int cnt = 0; + while (resultSet.next()) { + String ans = + resultSet.getString(TIMESTAMP_STR) + + "," + + resultSet.getString(TIMESEIRES_STR) + + "," + + resultSet.getString(VALUE_STR) + + "," + + resultSet.getString(DATA_TYPE_STR); + Assert.assertTrue(retSet.contains(ans)); + cnt++; + assertEquals(retSet.size(), cnt); + } + + } catch (SQLException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } + + @Test + public void selectSomeAlignedLastTest1() { + Set<String> retSet = + new HashSet<>( + Arrays.asList( + "30,root.sg1.d1.s4,false,BOOLEAN", "40,root.sg1.d1.s5,aligned_test40,TEXT")); + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery("select last s1, s4, s5 from root.sg1.d1")) { + + int cnt = 0; + while (resultSet.next()) { + String ans = + resultSet.getString(TIMESTAMP_STR) + + "," + + resultSet.getString(TIMESEIRES_STR) + + "," + + resultSet.getString(VALUE_STR) + + "," + + resultSet.getString(DATA_TYPE_STR); + Assert.assertTrue(retSet.contains(ans)); + cnt++; + assertEquals(retSet.size(), cnt); + } + + } catch (SQLException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } + + @Test + public void selectSomeAlignedLastTest2() { + Set<String> retSet = + new HashSet<>(Collections.singletonList("30,root.sg1.d1.s4,false,BOOLEAN")); + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery("select last s1, s4 from root.sg1.d1")) { + + int cnt = 0; + while (resultSet.next()) { + String ans = + resultSet.getString(TIMESTAMP_STR) + + "," + + resultSet.getString(TIMESEIRES_STR) + + "," + + resultSet.getString(VALUE_STR) + + "," + + resultSet.getString(DATA_TYPE_STR); + Assert.assertTrue(retSet.contains(ans)); + cnt++; + assertEquals(retSet.size(), cnt); + } + + } catch (SQLException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } + + @Test + public void selectSomeAlignedLastWithTimeFilterTest() { + + Set<String> retSet = + new HashSet<>(Collections.singletonList("40,root.sg1.d1.s5,aligned_test40,TEXT")); + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = + statement.executeQuery("select last s1, s4, s5 from root.sg1.d1 where time > 30")) { + + int cnt = 0; + while (resultSet.next()) { + String ans = + resultSet.getString(TIMESTAMP_STR) + + "," + + resultSet.getString(TIMESEIRES_STR) + + "," + + resultSet.getString(VALUE_STR) + + "," + + resultSet.getString(DATA_TYPE_STR); + Assert.assertTrue(retSet.contains(ans)); + cnt++; + assertEquals(retSet.size(), cnt); + } + + } catch (SQLException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } + + @Test + public void selectSomeAlignedAndNonAlignedLastWithTimeFilterTest() { + + Set<String> retSet = + new HashSet<>( + Arrays.asList( + "40,root.sg1.d1.s5,aligned_test40,TEXT", + "40,root.sg1.d2.s5,non_aligned_test40,TEXT")); + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = + statement.executeQuery( + "select last d2.s5, d1.s4, d2.s1, d1.s5, d2.s4, d1.s1 from root.sg1 where time > 30")) { + + int cnt = 0; + while (resultSet.next()) { + String ans = + resultSet.getString(TIMESTAMP_STR) + + "," + + resultSet.getString(TIMESEIRES_STR) + + "," + + resultSet.getString(VALUE_STR) + + "," + + resultSet.getString(DATA_TYPE_STR); + Assert.assertTrue(retSet.contains(ans)); + cnt++; + assertEquals(retSet.size(), cnt); + } + + } catch (SQLException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } +} diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletion2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletion2IT.java new file mode 100644 index 0000000000..1898219bf5 --- /dev/null +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletion2IT.java @@ -0,0 +1,78 @@ +/* + * 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.aligned; + +import org.apache.iotdb.it.env.ConfigFactory; +import org.apache.iotdb.it.env.EnvFactory; +import org.apache.iotdb.itbase.category.ClusterIT; +import org.apache.iotdb.itbase.category.LocalStandaloneIT; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.experimental.categories.Category; + +import java.sql.Connection; +import java.sql.Statement; + +import static org.junit.Assert.fail; + +@Category({LocalStandaloneIT.class, ClusterIT.class}) +public class IoTDBLastQueryWithoutLastCacheWithDeletion2IT + extends IoTDBLastQueryWithoutLastCacheWithDeletionIT { + + private static int numOfPointsPerPage; + + @BeforeClass + public static void setUp() throws Exception { + + enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction(); + enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction(); + enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction(); + enableLastCache = ConfigFactory.getConfig().isLastCacheEnabled(); + numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage(); + ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false); + ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false); + ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false); + ConfigFactory.getConfig().setEnableLastCache(false); + ConfigFactory.getConfig().setMaxNumberOfPointsInPage(3); + EnvFactory.getEnv().initBeforeClass(); + AlignedWriteUtil.insertData(); + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + // TODO replace it while delete timeseries is supported in cluster mode + // statement.execute("delete timeseries root.sg1.d1.s2"); + statement.execute("delete timeseries root.sg1.d1.s2 where time <= 40"); + statement.execute("delete from root.sg1.d1.s1 where time <= 27"); + } catch (Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } + + @AfterClass + public static void tearDown() throws Exception { + EnvFactory.getEnv().cleanAfterClass(); + ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction); + ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction); + ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction); + ConfigFactory.getConfig().setEnableLastCache(enableLastCache); + ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage); + } +} diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletionIT.java new file mode 100644 index 0000000000..a08eb49126 --- /dev/null +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletionIT.java @@ -0,0 +1,77 @@ +/* + * 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.aligned; + +import org.apache.iotdb.it.env.ConfigFactory; +import org.apache.iotdb.it.env.EnvFactory; +import org.apache.iotdb.itbase.category.ClusterIT; +import org.apache.iotdb.itbase.category.LocalStandaloneIT; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.experimental.categories.Category; + +import java.sql.Connection; +import java.sql.Statement; + +import static org.junit.Assert.fail; + +@Category({LocalStandaloneIT.class, ClusterIT.class}) +public class IoTDBLastQueryWithoutLastCacheWithDeletionIT extends IoTDBLastQueryWithDeletionIT { + + protected static boolean enableSeqSpaceCompaction; + protected static boolean enableUnseqSpaceCompaction; + protected static boolean enableCrossSpaceCompaction; + protected static boolean enableLastCache; + + @BeforeClass + public static void setUp() throws Exception { + + enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction(); + enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction(); + enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction(); + enableLastCache = ConfigFactory.getConfig().isLastCacheEnabled(); + ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false); + ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false); + ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false); + ConfigFactory.getConfig().setEnableLastCache(false); + EnvFactory.getEnv().initBeforeClass(); + AlignedWriteUtil.insertData(); + + try (Connection connection = EnvFactory.getEnv().getConnection(); + Statement statement = connection.createStatement()) { + // TODO replace it while delete timeseries is supported in cluster mode + // statement.execute("delete timeseries root.sg1.d1.s2"); + statement.execute("delete timeseries root.sg1.d1.s2 where time <= 40"); + statement.execute("delete from root.sg1.d1.s1 where time <= 27"); + } catch (Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } + + @AfterClass + public static void tearDown() throws Exception { + EnvFactory.getEnv().cleanAfterClass(); + ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction); + ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction); + ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction); + ConfigFactory.getConfig().setEnableLastCache(enableLastCache); + } +} diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnvConfig.java b/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnvConfig.java index 2e32fffe6c..d6ffa8cd42 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnvConfig.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnvConfig.java @@ -189,8 +189,24 @@ public class StandaloneEnvConfig implements BaseConfig { return IoTDBDescriptor.getInstance().getConfig().isEnableCrossSpaceCompaction(); } + @Override + public boolean isAutoCreateSchemaEnabled() { + return IoTDBDescriptor.getInstance().getConfig().isAutoCreateSchemaEnabled(); + } + @Override public int getMaxNumberOfPointsInPage() { return TSFileDescriptor.getInstance().getConfig().getMaxNumberOfPointsInPage(); } + + @Override + public BaseConfig setPrimitiveArraySize(int primitiveArraySize) { + IoTDBDescriptor.getInstance().getConfig().setPrimitiveArraySize(primitiveArraySize); + return this; + } + + @Override + public int getPrimitiveArraySize() { + return IoTDBDescriptor.getInstance().getConfig().getPrimitiveArraySize(); + } }
