endcy opened a new issue, #9709:
URL: https://github.com/apache/iotdb/issues/9709

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/iotdb/issues) and 
found nothing similar.
   
   
   ### Version
   
   iotdb:1.0.0  buildInfo:fbbca3f-dev  (show version)
   其它:
   iotdb-jdbc:1.0.0
   mybatis-spring-boot-starter:2.2.0
   mybatis:3.5.7
   mybatis-spring:2.0.6
   
   
   ### Describe the bug and provide the minimal reproduce step
   
   -- 整合mybatis的DataSource配置
   spring.datasource.username=xxx
   spring.datasource.password=xxx
   spring.datasource.driver-class-name = org.apache.iotdb.jdbc.IoTDBDriver
   spring.datasource.driverClassName = org.apache.iotdb.jdbc.IoTDBDriver
   spring.datasource.jdbc-url=jdbc:iotdb://xxx:6667/
   spring.datasource.url=jdbc:iotdb://xxx:6667/
   mybatis.mapper-locations=classpath*:/mappers/*.xml
   
   -- entity
       private Long timestamp;
       private Long orderId;
       private Integer orderNum;
       private String orderName;
       private String createTime;
   
   -- 以order作为示例时序实体,mapper xml中部分statement如下
   
       <select id="queryOrder" resultMap="BaseResultMap">
           select * from root.order.orderdetail limit 3 offset 0
       </select>
   
       <insert id="createOrder" parameterType="com.test.iotdb.entity.OrderInfo">
           insert into root.order.orderdetail(timestamp, order_id, order_num, 
create_time, order_name)
           values ( #{timestamp}, #{orderId}, #{orderNum}, 
#{createTime,jdbcType=VARCHAR,javaType=java.lang.String}, 
#{orderName,jdbcType=VARCHAR,javaType=java.lang.String} );
       </insert>
   
   -- 时序结构
   SET STORAGE GROUP TO root.order;
   CREATE TIMESERIES root.order.orderdetail.order_id WITH DATATYPE=INT64, 
ENCODING=PLAIN, COMPRESSOR=SNAPPY;
   CREATE TIMESERIES root.order.orderdetail.order_num WITH DATATYPE=INT32, 
ENCODING=PLAIN, COMPRESSOR=SNAPPY;
   CREATE TIMESERIES root.order.orderdetail.order_name WITH DATATYPE=TEXT, 
ENCODING=PLAIN, COMPRESSOR=SNAPPY;
   CREATE TIMESERIES root.order.orderdetail.create_time WITH DATATYPE=TEXT, 
ENCODING=PLAIN, COMPRESSOR=SNAPPY;
   
   ### What did you expect to see?
   
   query方法和insert方法应该包含在最小sql集中,这里应该sql正常赋值正确,时序数据成功保存/查询出映射的信息
   
   ### What did you see instead?
   
   增加时序create/insert时失败,string预处理时缺少引号,使用
   insert into root.order.orderdetail( order_id, order_num, order_name, 
create_time) values (1682244729014, 10004, 1, 实体测试4,aaa4);
   
   2023-04-26 14:43:36.831  INFO 21076 --- [nio-9015-exec-4] 
c.test.iotdb.rest.OrderController   : 
创建失败!org.springframework.jdbc.UncategorizedSQLException: 
   ### Error updating database.  Cause: 
org.apache.iotdb.jdbc.IoTDBSQLException: 700: Error occurred while parsing SQL 
to physical plan: line 2:57 no viable alternative at input '( 1682491416531, 
10011, 11, '2023-04-26', 中文名称13'
   ### The error may exist in file 
[E:\projects\ces-iotdb\target\classes\mapper\OrderMapper.xml]
   ### The error may involve 
com.test.iotdb.mapper.OrderMapper.createOrder-Inline
   ### The error occurred while setting parameters
   ### SQL: insert into root.order.orderdetail(timestamp, order_id, order_num, 
create_time, order_name)         values ( ?, ?, ?, ?, ? );
   ### Cause: org.apache.iotdb.jdbc.IoTDBSQLException: 700: Error occurred 
while parsing SQL to physical plan: line 2:57 no viable alternative at input '( 
1682491416531, 10011, 11, '2023-04-26', 中文名称13'
   ; uncategorized SQLException; SQL state [Error occurred while parsing SQL to 
physical plan: line 2:57 no viable alternative at input '( 1682491416531, 
10011, 11, '2023-04-26', 中文名称13']; error code [700]; 700: Error occurred while 
parsing SQL to physical plan: line 2:57 no viable alternative at input '( 
1682491416531, 10011, 11, '2023-04-26', 中文名称13'; nested exception is 
org.apache.iotdb.jdbc.IoTDBSQLException: 700: Error occurred while parsing SQL 
to physical plan: line 2:57 no viable alternative at input '( 1682491416531, 
10011, 11, '2023-04-26', 中文名称13'
   
   ### Anything else?
   
   查询成功,IoTDBStatement异常
   java.sql.SQLException: Not support getMaxFieldSize
        at 
org.apache.iotdb.jdbc.IoTDBStatement.getMaxFieldSize(IoTDBStatement.java:624) 
~[iotdb-jdbc-1.0.1.jar:1.0.1]
        at 
com.alibaba.druid.pool.DruidPooledPreparedStatement.<init>(DruidPooledPreparedStatement.java:66)
 ~[druid-1.2.16.jar:na]
        at 
com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:371)
 [druid-1.2.16.jar:na]
        at 
org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:86)
 [mybatis-3.5.7.jar:3.5.7]
   -- 查询后数据打印
   OrderInfo(timestamp=null, orderId=10001, orderNum=1, orderName=实体测试1, 
createTime=aaa)
   
   很感谢阅读,同时希望能出一些简单整合框架的教程(基于封装的学习成本,想把mybatis当过渡工具),能很大程度减少入门使用门槛。感谢!
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to