suchenglong created IOTDB-3907:
----------------------------------
Summary: Session API use method dropSchemaTemplate error
Key: IOTDB-3907
URL: https://issues.apache.org/jira/browse/IOTDB-3907
Project: Apache IoTDB
Issue Type: Bug
Affects Versions: 0.13.1-SNAPSHOT
Reporter: suchenglong
使用session api进行已创建模板的删除操作,虽然报错但实际删除成功.
代码:
SessionPool sessionPool = new SessionPool.Builder().host("127.0.0.1")
.port(6667)
.user("root")
.password("root")
.maxSize(5)
.build();
String templateName = "t1_nonAlign";
Template template = new Template(templateName, true);
for (int i = 0; i < 10; i++) {
TemplateNode templateNode = new MeasurementNode("s" + i, TSDataType.INT64,
TSEncoding.PLAIN, CompressionType.SNAPPY);
template.addToTemplate(templateNode);
}
sessionPool.createSchemaTemplate(template);
System.out.println(sessionPool.showAllTemplates());
try {
sessionPool.dropSchemaTemplate(templateName);
}catch (Exception e){
e.printStackTrace();
}
System.out.println(sessionPool.showAllTemplates());
结果:
17:53:07.373 [main] DEBUG org.apache.iotdb.session.pool.SessionPool - Create a
new Session 127.0.0.1, 6667, root, root
[template1, t1, t2, t1_nonAlign]
org.apache.iotdb.rpc.StatementExecutionException: 321: Undefined template name:
t1_nonAlign
at org.apache.iotdb.rpc.RpcUtils.verifySuccess(RpcUtils.java:94)
at
org.apache.iotdb.session.SessionConnection.dropSchemaTemplate(SessionConnection.java:969)
at org.apache.iotdb.session.Session.dropSchemaTemplate(Session.java:2389)
at
org.apache.iotdb.session.pool.SessionPool.dropSchemaTemplate(SessionPool.java:2173)
at com.cisdi.iotdbtest.Test1.main(Test1.java:32)
[template1, t1, t2]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)