This is an automated email from the ASF dual-hosted git repository.
xiangweiwei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 93a2f40 [IOTDB-2141] Fix some issues in cluster test (#4571)
93a2f40 is described below
commit 93a2f408ea38846863f38fc2c5d51eb962ad07b6
Author: BaiJian <[email protected]>
AuthorDate: Wed Dec 15 19:41:41 2021 +0800
[IOTDB-2141] Fix some issues in cluster test (#4571)
---
.../iotdb/cluster/query/ClusterPlanExecutor.java | 5 +-
.../cluster/query/aggregate/ClusterAggregator.java | 9 ++-
.../cluster/query/reader/ClusterReaderFactory.java | 8 ++-
.../cluster/server/service/DataSyncService.java | 11 ++-
.../apache/iotdb/cluster/utils/PartitionUtils.java | 2 +
.../iotdb/db/integration/IoTDBMetadataFetchIT.java | 28 +++++---
.../apache/iotdb/db/integration/IoTDBTtlIT.java | 2 +-
.../aggregation/IoTDBAggregationLargeDataIT.java | 81 ++++++++++------------
.../aggregation/IoTDBAggregationSmallDataIT.java | 21 +-----
.../apache/iotdb/db/utils/ErrorHandlingUtils.java | 4 ++
.../write/UnSupportedDataTypeException.java | 2 +-
11 files changed, 94 insertions(+), 79 deletions(-)
diff --git
a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
index 8a71cbb..dbdb3db 100644
---
a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
+++
b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterPlanExecutor.java
@@ -307,7 +307,10 @@ public class ClusterPlanExecutor extends PlanExecutor {
// if path doesn't end with **.
// e.g. we have SG root.sg.a and root.sg.b, the query path is root.sg, we
should return the map
// with key root.sg.a and root.sg.b instead of an empty one.
- PartialPath wildcardPath =
path.concatNode(IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD);
+ PartialPath wildcardPath = path;
+ if
(!wildcardPath.getMeasurement().equals(IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD))
{
+ wildcardPath =
wildcardPath.concatNode(IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD);
+ }
Map<String, String> sgPathMap =
IoTDB.metaManager.groupPathByStorageGroup(wildcardPath);
if (sgPathMap.isEmpty()) {
throw new PathNotExistException(path.getFullPath());
diff --git
a/cluster/src/main/java/org/apache/iotdb/cluster/query/aggregate/ClusterAggregator.java
b/cluster/src/main/java/org/apache/iotdb/cluster/query/aggregate/ClusterAggregator.java
index e4f4755..3bd6759 100644
---
a/cluster/src/main/java/org/apache/iotdb/cluster/query/aggregate/ClusterAggregator.java
+++
b/cluster/src/main/java/org/apache/iotdb/cluster/query/aggregate/ClusterAggregator.java
@@ -46,6 +46,7 @@ import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import org.apache.iotdb.tsfile.read.common.Path;
import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.thrift.TApplicationException;
import org.apache.thrift.TException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -244,12 +245,16 @@ public class ClusterAggregator {
results);
return results;
}
+ } catch (TApplicationException e) {
+ logger.error(
+ metaGroupMember.getName() + " query aggregation error " + path + "
from " + node, e);
+ throw new StorageEngineException(e.getMessage());
} catch (TException | IOException e) {
logger.error(
- "{}: Cannot query aggregation {} from {}",
metaGroupMember.getName(), path, node, e);
+ metaGroupMember.getName() + " cannot query aggregation " + path +
" from " + node, e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
- logger.error("{}: query {} interrupted from {}",
metaGroupMember.getName(), path, node, e);
+ logger.error(metaGroupMember.getName() + " query interrupted " + path
+ " from " + node, e);
}
}
throw new StorageEngineException(
diff --git
a/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
b/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
index 328e3bb..17a82c2 100644
---
a/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
+++
b/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
@@ -79,6 +79,7 @@ import org.apache.iotdb.tsfile.read.reader.IPointReader;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
+import org.apache.thrift.TApplicationException;
import org.apache.thrift.TException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -897,11 +898,14 @@ public class ClusterReaderFactory {
logger.debug("{}: no data for {} from {}",
metaGroupMember.getName(), path, node);
return new EmptyReader();
}
+ } catch (TApplicationException e) {
+ logger.error(metaGroupMember.getName() + ": Cannot query " + path + "
from " + node, e);
+ throw new StorageEngineException(e.getMessage());
} catch (TException | IOException e) {
- logger.error("{}: Cannot query {} from {}", metaGroupMember.getName(),
path, node, e);
+ logger.error(metaGroupMember.getName() + ": Cannot query " + path + "
from " + node, e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
- logger.error("{}: Cannot query {} from {}", metaGroupMember.getName(),
path, node, e);
+ logger.error(metaGroupMember.getName() + ": Cannot query " + path + "
from " + node, e);
}
}
throw new StorageEngineException(
diff --git
a/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java
b/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java
index a3320bb..3a7bc6e 100644
---
a/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java
+++
b/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java
@@ -48,7 +48,10 @@ import
org.apache.iotdb.db.exception.metadata.IllegalPathException;
import org.apache.iotdb.db.exception.metadata.MetadataException;
import org.apache.iotdb.db.exception.query.QueryProcessException;
import org.apache.iotdb.db.service.IoTDB;
+import org.apache.iotdb.tsfile.exception.filter.StatisticsClassException;
+import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.thrift.TApplicationException;
import org.apache.thrift.TException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -352,8 +355,12 @@ public class DataSyncService extends BaseSyncService
implements TSDataService.If
public List<ByteBuffer> getAggrResult(GetAggrResultRequest request) throws
TException {
try {
return dataGroupMember.getLocalQueryExecutor().getAggrResult(request);
- } catch (StorageEngineException | QueryProcessException | IOException e) {
- throw new TException(e);
+ } catch (StorageEngineException
+ | QueryProcessException
+ | IOException
+ | StatisticsClassException
+ | UnSupportedDataTypeException e) {
+ throw new TApplicationException(e.getMessage());
}
}
diff --git
a/cluster/src/main/java/org/apache/iotdb/cluster/utils/PartitionUtils.java
b/cluster/src/main/java/org/apache/iotdb/cluster/utils/PartitionUtils.java
index 5638ae0..5ce04b3 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/utils/PartitionUtils.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/utils/PartitionUtils.java
@@ -36,6 +36,7 @@ import
org.apache.iotdb.db.qp.physical.sys.DeleteStorageGroupPlan;
import org.apache.iotdb.db.qp.physical.sys.DeleteTimeSeriesPlan;
import org.apache.iotdb.db.qp.physical.sys.DropFunctionPlan;
import org.apache.iotdb.db.qp.physical.sys.FlushPlan;
+import org.apache.iotdb.db.qp.physical.sys.KillQueryPlan;
import org.apache.iotdb.db.qp.physical.sys.LoadConfigurationPlan;
import
org.apache.iotdb.db.qp.physical.sys.LoadConfigurationPlan.LoadConfigurationPlanType;
import org.apache.iotdb.db.qp.physical.sys.LoadDataPlan;
@@ -71,6 +72,7 @@ public class PartitionUtils {
public static boolean isLocalNonQueryPlan(PhysicalPlan plan) {
return plan instanceof LoadDataPlan
|| plan instanceof OperateFilePlan
+ || plan instanceof KillQueryPlan
|| (plan instanceof LoadConfigurationPlan
&& ((LoadConfigurationPlan) plan)
.getLoadConfigurationPlanType()
diff --git
a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
index 2be905c..43215af 100644
---
a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
+++
b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
@@ -26,9 +26,9 @@ import org.apache.iotdb.itbase.category.RemoteTest;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
-import org.junit.After;
+import org.junit.AfterClass;
import org.junit.Assert;
-import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
@@ -52,7 +52,6 @@ import static org.junit.Assert.fail;
* Notice that, all test begins with "IoTDB" is integration test. All test
which will start the
* IoTDB server should be defined as integration test.
*/
-@Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public class IoTDBMetadataFetchIT {
private DatabaseMetaData databaseMetaData;
@@ -81,19 +80,20 @@ public class IoTDBMetadataFetchIT {
}
}
- @Before
- public void setUp() throws Exception {
+ @BeforeClass
+ public static void setUp() throws Exception {
EnvFactory.getEnv().initBeforeTest();
insertSQL();
}
- @After
- public void tearDown() throws Exception {
+ @AfterClass
+ public static void tearDown() throws Exception {
EnvFactory.getEnv().cleanAfterTest();
}
@Test
+ @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public void showTimeseriesTest() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -151,6 +151,7 @@ public class IoTDBMetadataFetchIT {
}
@Test
+ @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public void showStorageGroupTest() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -194,6 +195,7 @@ public class IoTDBMetadataFetchIT {
}
@Test
+ @Category({LocalStandaloneTest.class})
public void databaseMetaDataTest() throws SQLException {
Connection connection = null;
try {
@@ -212,7 +214,8 @@ public class IoTDBMetadataFetchIT {
}
@Test
- public void showVersion() throws SQLException {
+ @Category({LocalStandaloneTest.class})
+ public void showVersionTest() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
String sql = "show version";
@@ -231,6 +234,7 @@ public class IoTDBMetadataFetchIT {
}
@Test
+ @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public void showDevicesWithSgTest() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -273,6 +277,7 @@ public class IoTDBMetadataFetchIT {
}
@Test
+ @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public void showDevicesTest() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -310,6 +315,7 @@ public class IoTDBMetadataFetchIT {
}
@Test
+ @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public void showChildPaths() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -342,6 +348,7 @@ public class IoTDBMetadataFetchIT {
}
@Test
+ @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public void showChildNodes() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -374,6 +381,7 @@ public class IoTDBMetadataFetchIT {
}
@Test
+ @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public void showCountTimeSeries() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -406,6 +414,7 @@ public class IoTDBMetadataFetchIT {
}
@Test
+ @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public void showCountDevices() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -443,6 +452,7 @@ public class IoTDBMetadataFetchIT {
}
@Test
+ @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public void showCountStorageGroup() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -480,6 +490,7 @@ public class IoTDBMetadataFetchIT {
}
@Test
+ @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public void showCountTimeSeriesGroupBy() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -510,6 +521,7 @@ public class IoTDBMetadataFetchIT {
}
@Test
+ @Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
public void showCountNodes() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
diff --git
a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java
b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java
index 2073f81..a0107ba 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java
@@ -39,7 +39,7 @@ import java.sql.Statement;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-@Category({LocalStandaloneTest.class, ClusterTest.class})
+@Category({LocalStandaloneTest.class})
public class IoTDBTtlIT {
@Before
diff --git
a/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationLargeDataIT.java
b/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationLargeDataIT.java
index 7a7f40c..05c3a3a 100644
---
a/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationLargeDataIT.java
+++
b/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationLargeDataIT.java
@@ -26,9 +26,9 @@ import org.apache.iotdb.itbase.category.ClusterTest;
import org.apache.iotdb.itbase.category.LocalStandaloneTest;
import org.apache.iotdb.jdbc.Config;
-import org.junit.After;
+import org.junit.AfterClass;
import org.junit.Assert;
-import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -114,43 +114,23 @@ public class IoTDBAggregationLargeDataIT {
"insert into root.vehicle.d0(timestamp,s4) values(100, true)",
};
- private long prevPartitionInterval;
-
- @Before
- public void setUp() throws Exception {
+ private static long prevPartitionInterval;
+ @BeforeClass
+ public static void setUp() throws Exception {
prevPartitionInterval =
IoTDBDescriptor.getInstance().getConfig().getPartitionInterval();
- EnvFactory.getEnv().initBeforeTest();
+ EnvFactory.getEnv().initBeforeClass();
+ insertSQL();
}
- @After
- public void tearDown() throws Exception {
- EnvFactory.getEnv().cleanAfterTest();
+ @AfterClass
+ public static void tearDown() throws Exception {
+ EnvFactory.getEnv().cleanAfterClass();
ConfigFactory.getConfig().setPartitionInterval(prevPartitionInterval);
}
@Test
- public void test() throws ClassNotFoundException {
- insertSQL();
-
- lastValueAggreWithSingleFilterTest();
- avgAggreWithSingleFilterTest();
- sumAggreWithSingleFilterTest();
- firstAggreWithSingleFilterTest();
- countAggreWithSingleFilterTest();
- minTimeAggreWithSingleFilterTest();
- minValueAggreWithSingleFilterTest();
- maxValueAggreWithSingleFilterTest();
- extremeAggreWithSingleFilterTest();
-
- countAggreWithMultiFilterTest();
- maxTimeAggreWithMultiFilterTest();
- avgAggreWithMultiFilterTest();
- sumAggreWithMultiFilterTest();
- firstAggreWithMultiFilterTest();
- }
-
- private void lastValueAggreWithSingleFilterTest() {
+ public void lastValueAggreWithSingleFilterTest() {
String[] retArray = new String[] {"0,9,39,63.0,E,true"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -212,7 +192,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void sumAggreWithSingleFilterTest() {
+ @Test
+ public void sumAggreWithSingleFilterTest() {
String[] retArray = new String[] {"0,55061.0,156752.0,20254"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -266,7 +247,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void firstAggreWithSingleFilterTest() {
+ @Test
+ public void firstAggreWithSingleFilterTest() {
String[] retArray = new String[] {"0,90,1101,2.22,ddddd,true"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -330,7 +312,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void avgAggreWithSingleFilterTest() {
+ @Test
+ public void avgAggreWithSingleFilterTest() {
String[] retArray = new String[] {"0,75,212,28"};
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -381,7 +364,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void countAggreWithSingleFilterTest() {
+ @Test
+ public void countAggreWithSingleFilterTest() {
String[] retArray = new String[] {"0,733,740,734"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -434,7 +418,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void minTimeAggreWithSingleFilterTest() {
+ @Test
+ public void minTimeAggreWithSingleFilterTest() {
String[] retArray = new String[] {"0,104,1,2,101,100"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -499,7 +484,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void minValueAggreWithSingleFilterTest() {
+ @Test
+ public void minValueAggreWithSingleFilterTest() {
String[] retArray = new String[] {"0,0,0,0.0,B,true"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -567,7 +553,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void maxValueAggreWithSingleFilterTest() {
+ @Test
+ public void maxValueAggreWithSingleFilterTest() {
String[] retArray = new String[] {"0,99,40000,122.0,fffff,true"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -636,7 +623,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void extremeAggreWithSingleFilterTest() {
+ @Test
+ public void extremeAggreWithSingleFilterTest() {
String[] retArray = new String[] {"0,99,40000,122.0"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -697,7 +685,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void avgAggreWithMultiFilterTest() {
+ @Test
+ public void avgAggreWithMultiFilterTest() {
String[] retArray = new String[] {"0,55061.0,733,75,212,28"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -734,7 +723,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void sumAggreWithMultiFilterTest() {
+ @Test
+ public void sumAggreWithMultiFilterTest() {
String[] retArray = new String[] {"0,55061.0,156752.0,20262"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -788,7 +778,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void firstAggreWithMultiFilterTest() {
+ @Test
+ public void firstAggreWithMultiFilterTest() {
String[] retArray = new String[] {"0,90,1101,2.22,ddddd,true"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -852,7 +843,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void countAggreWithMultiFilterTest() {
+ @Test
+ public void countAggreWithMultiFilterTest() {
String[] retArray = new String[] {"0,733,740,736,482,1"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -889,7 +881,8 @@ public class IoTDBAggregationLargeDataIT {
}
}
- private void maxTimeAggreWithMultiFilterTest() throws ClassNotFoundException
{
+ @Test
+ public void maxTimeAggreWithMultiFilterTest() throws ClassNotFoundException {
String[] retArray = new String[] {"0,3999,3999,3999,3599,100"};
Class.forName(Config.JDBC_DRIVER_NAME);
diff --git
a/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationSmallDataIT.java
b/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationSmallDataIT.java
index 1c564a3..de50d32 100644
---
a/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationSmallDataIT.java
+++
b/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationSmallDataIT.java
@@ -19,7 +19,6 @@
package org.apache.iotdb.db.integration.aggregation;
-import org.apache.iotdb.db.conf.OperationType;
import org.apache.iotdb.integration.env.EnvFactory;
import org.apache.iotdb.itbase.category.ClusterTest;
import org.apache.iotdb.itbase.category.LocalStandaloneTest;
@@ -213,14 +212,7 @@ public class IoTDBAggregationSmallDataIT {
"SELECT max_value(d0.s0),max_value(d1.s1),max_value(d0.s3) FROM
root.vehicle");
fail();
} catch (IoTDBSQLException e) {
- Assert.assertTrue(
- e.toString()
- .contains(
- String.format(
- "500: [INTERNAL_SERVER_ERROR(500)] Exception occurred:
"
- + "\"SELECT
max_value(d0.s0),max_value(d1.s1),max_value(d0.s3) "
- + "FROM root.vehicle\". %s failed. Binary
statistics does not support: max",
- OperationType.EXECUTE_STATEMENT.getName())));
+ Assert.assertTrue(e.toString().contains("Binary statistics does not
support: max"));
}
boolean hasResultSet =
@@ -247,7 +239,7 @@ public class IoTDBAggregationSmallDataIT {
}
@Test
- public void extremeWithoutFilterTest() throws ClassNotFoundException {
+ public void extremeWithoutFilterTest() {
String[] retArray = new String[] {"0,22222,null"};
try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -257,14 +249,7 @@ public class IoTDBAggregationSmallDataIT {
statement.execute("SELECT extreme(d0.s0),extreme(d1.s1),extreme(d0.s3)
FROM root.vehicle");
fail();
} catch (IoTDBSQLException e) {
- Assert.assertTrue(
- e.toString()
- .contains(
- String.format(
- "500: [INTERNAL_SERVER_ERROR(500)] Exception occurred:
"
- + "\"SELECT
extreme(d0.s0),extreme(d1.s1),extreme(d0.s3) "
- + "FROM root.vehicle\". %s failed. Binary
statistics does not support: max",
- OperationType.EXECUTE_STATEMENT.getName())));
+ Assert.assertTrue(e.toString().contains("Binary statistics does not
support: max"));
}
boolean hasResultSet =
diff --git
a/server/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java
b/server/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java
index 41db954..80b4285 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java
@@ -29,6 +29,7 @@ import
org.apache.iotdb.db.exception.runtime.SQLParserException;
import org.apache.iotdb.rpc.RpcUtils;
import org.apache.iotdb.rpc.TSStatusCode;
import org.apache.iotdb.service.rpc.thrift.TSStatus;
+import org.apache.iotdb.tsfile.exception.TsFileRuntimeException;
import org.antlr.v4.runtime.misc.ParseCancellationException;
import org.slf4j.Logger;
@@ -106,6 +107,9 @@ public class ErrorHandlingUtils {
} else if (e instanceof IoTDBException && !(e instanceof
StorageGroupNotReadyException)) {
DETAILED_FAILURE_QUERY_TRACE_LOGGER.warn(INFO_QUERY_PROCESS_ERROR, e);
return RpcUtils.getStatus(((IoTDBException) e).getErrorCode(),
getRootCause(e));
+ } else if (e instanceof TsFileRuntimeException) {
+ DETAILED_FAILURE_QUERY_TRACE_LOGGER.warn(INFO_QUERY_PROCESS_ERROR, e);
+ return RpcUtils.getStatus(TSStatusCode.TSFILE_PROCESSOR_ERROR,
getRootCause(e));
}
return null;
}
diff --git
a/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/write/UnSupportedDataTypeException.java
b/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/write/UnSupportedDataTypeException.java
index 3e77e83..59c8770 100644
---
a/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/write/UnSupportedDataTypeException.java
+++
b/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/write/UnSupportedDataTypeException.java
@@ -25,6 +25,6 @@ public class UnSupportedDataTypeException extends
TsFileRuntimeException {
private static final long serialVersionUID = 6399248887091915203L;
public UnSupportedDataTypeException(String dataTypeName) {
- super("UnSupported dataType: " + dataTypeName);
+ super("Unsupported dataType: " + dataTypeName);
}
}