This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch rel/0.13
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/0.13 by this push:
new 5b6cb7e19f [To rel/0.13][IOTDB-4542] Optimize schema validate error
message (#7469)
5b6cb7e19f is described below
commit 5b6cb7e19fcd02287ec7af4e9abec0883ff3ddb4
Author: Haonan <[email protected]>
AuthorDate: Thu Sep 29 08:59:26 2022 +0800
[To rel/0.13][IOTDB-4542] Optimize schema validate error message (#7469)
---
.../org/apache/iotdb/session/IoTDBSessionSimpleIT.java | 2 +-
.../main/java/org/apache/iotdb/db/metadata/MManager.java | 15 +++++++--------
.../org/apache/iotdb/db/metadata/MManagerBasicTest.java | 4 ++--
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git
a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSimpleIT.java
b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSimpleIT.java
index af6a32151a..451be54fd7 100644
---
a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSimpleIT.java
+++
b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSimpleIT.java
@@ -1300,7 +1300,7 @@ public class IoTDBSessionSimpleIT {
session.insertAlignedRecord("root.sg.loc1.sector.GPS", 3L, measurements,
values);
} catch (StatementExecutionException e) {
assertEquals(
- "303: Timeseries under path [root.sg.loc1.sector.GPS] is not aligned
, please set InsertPlan.isAligned() = false",
+ "319: timeseries under this device are not aligned, please use
non-aligned interface (Path: root.sg.loc1.sector.GPS)",
e.getMessage());
}
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
b/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
index d88dd82879..9be5fc84db 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
@@ -26,6 +26,7 @@ import org.apache.iotdb.db.engine.StorageEngine;
import org.apache.iotdb.db.engine.fileSystem.SystemFileFactory;
import org.apache.iotdb.db.engine.trigger.executor.TriggerEngine;
import org.apache.iotdb.db.exception.metadata.AliasAlreadyExistException;
+import org.apache.iotdb.db.exception.metadata.AlignedTimeseriesException;
import org.apache.iotdb.db.exception.metadata.DataTypeMismatchException;
import org.apache.iotdb.db.exception.metadata.DeleteFailedException;
import org.apache.iotdb.db.exception.metadata.DifferentTemplateException;
@@ -2031,17 +2032,15 @@ public class MManager {
if (deviceMNode.isEntity()) {
if (plan.isAligned()) {
if (!deviceMNode.getAsEntityMNode().isAligned()) {
- throw new MetadataException(
- String.format(
- "Timeseries under path [%s] is not aligned , please set
InsertPlan.isAligned() = false",
- plan.getDevicePath()));
+ throw new AlignedTimeseriesException(
+ "timeseries under this device are not aligned, " + "please use
non-aligned interface",
+ devicePath.getFullPath());
}
} else {
if (deviceMNode.getAsEntityMNode().isAligned()) {
- throw new MetadataException(
- String.format(
- "Timeseries under path [%s] is aligned , please set
InsertPlan.isAligned() = true",
- plan.getDevicePath()));
+ throw new AlignedTimeseriesException(
+ "timeseries under this device are aligned, " + "please use
aligned interface",
+ devicePath.getFullPath());
}
}
}
diff --git
a/server/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java
b/server/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java
index 21b1ca63c6..048e070ef3 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java
@@ -2060,7 +2060,7 @@ public class MManagerBasicTest {
fail();
} catch (Exception e) {
Assert.assertEquals(
- "Timeseries under path [root.laptop.d1.aligned_device] is aligned ,
please set InsertPlan.isAligned() = true",
+ "timeseries under this device are aligned, please use aligned
interface (Path: root.laptop.d1.aligned_device)",
e.getMessage());
}
}
@@ -2166,7 +2166,7 @@ public class MManagerBasicTest {
fail();
} catch (Exception e) {
Assert.assertEquals(
- "Timeseries under path [root.laptop.d1.aligned_device] is not
aligned , please set InsertPlan.isAligned() = false",
+ "timeseries under this device are not aligned, please use
non-aligned interface (Path: root.laptop.d1.aligned_device)",
e.getMessage());
}
}