Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ public int[] executeBatch() throws SQLException {
}

@Override
public Connection getConnection() {
throw new UnsupportedOperationException();
public Connection getConnection() throws SQLException {
return writeStatement.getConnection();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it;

import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -71,6 +72,10 @@ public void testJDBCExecuteBatch() {
statement.addBatch(
"insert into root.ln.wf01.wt01(timestamp,temperature) values(1509465600001,2.3)");
statement.addBatch("delete timeseries root.ln.wf01.wt01.**");
statement.executeBatch();
statement.clearBatch();
TestUtils.waitForTimeSeriesDeletion(
EnvFactory.getEnv(), "delete timeseries root.ln.wf01.wt01.**");
statement.addBatch(
"insert into root.ln.wf01.wt01(timestamp,temperature) values(1509465600002,3.4)");
statement.executeBatch();
Expand Down Expand Up @@ -104,6 +109,10 @@ public void testJDBCExecuteBatchForCreateMultiTimeSeriesPlan() {
statement.addBatch(
"insert into root.ln.wf01.wt01(timestamp,temperature) values(1509465600001,2.3)");
statement.addBatch("delete timeseries root.ln.wf01.wt01.**");
statement.executeBatch();
statement.clearBatch();
TestUtils.waitForTimeSeriesDeletion(
EnvFactory.getEnv(), "delete timeseries root.ln.wf01.wt01.**");
statement.addBatch(
"create timeseries root.turbine.d1.s1(s1) with datatype=boolean, encoding=plain , compression=snappy "
+ "tags('tag1'='v1', 'tag2'='v2') attributes('attr1'='v3', 'attr2'='v4')");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ public void testLoad() throws Exception {
// Try to delete after loading. Expect no deadlock
try (final Connection connection = EnvFactory.getEnv().getConnection();
final Statement statement = connection.createStatement()) {
statement.execute(
TestUtils.deleteTimeSeries(
statement,
String.format(
"delete timeseries %s.%s",
SchemaConfig.DEVICE_0, SchemaConfig.MEASUREMENT_00.getMeasurementName()));
Expand Down Expand Up @@ -485,7 +486,8 @@ public void testLoadWithAlignmentMismatch() throws Exception {
// Try to delete after loading. Expect no deadlock
try (final Connection connection = EnvFactory.getEnv().getConnection();
final Statement statement = connection.createStatement()) {
statement.execute(
TestUtils.deleteTimeSeries(
statement,
String.format(
"delete timeseries %s.%s",
SchemaConfig.DEVICE_0, SchemaConfig.MEASUREMENT_00.getMeasurementName()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.apache.iotdb.db.it;

import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -61,7 +62,7 @@ public void testQueryDiffTypeTimeseries() {
Thread.sleep(100);
statement.execute("FLUSH");
Thread.sleep(100);
statement.execute("DELETE TIMESERIES root.sg.d1.s1");
TestUtils.deleteTimeSeries(statement, "DELETE TIMESERIES root.sg.d1.s1");
statement.execute("CREATE TIMESERIES root.sg.d1.s1 with datatype=INT32,encoding=PLAIN");
try (ResultSet resultSet =
statement.executeQuery("SELECT s1 FROM root.sg.d1 WHERE s1 > 10")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.apache.iotdb.db.it;

import org.apache.iotdb.commons.conf.IoTDBConstant;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.LocalStandaloneIT;
Expand Down Expand Up @@ -77,7 +78,7 @@ public void testDeletionAfterRecreatingTwoLevelTimeseriesSurvivesCompaction() th
statement.execute("INSERT INTO root.repro(time, s1) VALUES (1, 1)");
statement.execute("FLUSH");

statement.execute("DELETE TIMESERIES root.repro.s1");
TestUtils.deleteTimeSeries(statement, "DELETE TIMESERIES root.repro.s1");
statement.execute("CREATE TIMESERIES root.repro.s1 WITH DATATYPE=INT64");
statement.execute("INSERT INTO root.repro(time, s1) VALUES (2, 2)");
statement.execute("FLUSH");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public void testRecoverWALMismatchDataType() throws Exception {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("insert into root.turbine1.d1(timestamp,s1,s2) values(1,1.1,2.2)");
statement.execute("delete timeseries root.turbine1.d1.s1");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.turbine1.d1.s1");
statement.execute(
"create timeseries root.turbine1.d1.s1 with datatype=INT32, encoding=RLE, compression=SNAPPY");
}
Expand Down Expand Up @@ -412,7 +412,7 @@ public void testRecoverWALDeleteSchema() throws Exception {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("insert into root.turbine1.d1(timestamp,s1,s2) values(1,1.1,2.2)");
statement.execute("delete timeseries root.turbine1.d1.s1");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.turbine1.d1.s1");
}

TestUtils.restartDataNodes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public void testRecoverWALMismatchDataType() throws Exception {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("insert into root.turbine1.d1(timestamp,s1,s2) values(1,1.1,2.2)");
statement.execute("delete timeseries root.turbine1.d1.s1");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.turbine1.d1.s1");
statement.execute(
"create timeseries root.turbine1.d1.s1 with datatype=INT32, encoding=RLE, compression=SNAPPY");
}
Expand Down Expand Up @@ -281,7 +281,7 @@ public void testRecoverWALDeleteSchema() throws Exception {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("insert into root.turbine1.d1(timestamp,s1,s2) values(1,1.1,2.2)");
statement.execute("delete timeseries root.turbine1.d1.s1");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.turbine1.d1.s1");
}

TestUtils.restartDataNodes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -55,7 +56,7 @@ public static void setUp() throws Exception {

try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
statement.execute("delete from root.sg1.d1.s1 where time <= 21");
} catch (Exception e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -62,7 +63,7 @@ public static void setUp() throws Exception {

try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
statement.execute("delete from root.sg1.d1.s1 where time <= 21");
} catch (Exception e) {
fail(e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -61,7 +62,7 @@ public static void setUp() throws Exception {

statement.execute("insert into root.sg1.d1(time, s1, s2) aligned values (1, 1, true)");
statement.execute("flush");
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
statement.execute("insert into root.sg1.d1(time, s1, s2) aligned values (10, 10, 100)");
statement.execute("flush");
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -54,7 +55,7 @@ public static void setUp() throws Exception {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete from root.sg1.d1.s1 where time <= 15");
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
} catch (Exception e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -65,7 +66,7 @@ public static void setUp() throws Exception {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete from root.sg1.d1.s1 where time <= 15");
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
} catch (Exception e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -53,7 +54,7 @@ public static void setUp() throws Exception {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete from root.sg1.d1.s1 where time <= 15");
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
statement.execute("delete from root.sg1.d1.s3 where time > 25");
} catch (Exception e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -65,7 +66,7 @@ public static void setUp() throws Exception {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete from root.sg1.d1.s1 where time <= 15");
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
statement.execute("delete from root.sg1.d1.s3 where time > 25");
} catch (Exception e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -52,7 +53,7 @@ public static void setUp() throws Exception {

try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
statement.execute("delete from root.sg1.d1.s1 where time <= 27");
} catch (Exception e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -64,7 +65,7 @@ public static void setUp() throws Exception {

try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
statement.execute("delete from root.sg1.d1.s1 where time <= 27");
} catch (Exception e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -55,7 +56,7 @@ public static void setUp() throws Exception {

try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
statement.execute("delete from root.sg1.d1.s1 where time <= 27");
} catch (Exception e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -53,7 +54,7 @@ public static void setUp() throws Exception {

try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
statement.execute("delete from root.sg1.d1.s1 where time <= 27");
} catch (Exception e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -54,7 +55,7 @@ public static void setUp() throws Exception {

try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
statement.execute("delete from root.sg1.d1.s2 where time <= 40");
statement.execute("delete from root.sg1.d1.s1 where time <= 21");
statement.execute("delete from root.sg1.d1.s5 where time <= 31 and time > 20");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.iotdb.db.it.aligned;

import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.ClusterIT;
Expand Down Expand Up @@ -58,7 +59,7 @@ public static void setUp() throws Exception {

try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute("delete timeseries root.sg1.d1.s2");
TestUtils.deleteTimeSeries(statement, "delete timeseries root.sg1.d1.s2");
statement.execute("delete from root.sg1.d1.s2 where time <= 40");
statement.execute("delete from root.sg1.d1.s1 where time <= 21");
statement.execute("delete from root.sg1.d1.s5 where time <= 31 and time > 20");
Expand Down
Loading
Loading