In Session, the JDBC module can set the Boolean return data type to 0/1 or true/false.#1642
In Session, the JDBC module can set the Boolean return data type to 0/1 or true/false.#1642shutter-cp wants to merge 20 commits intoapache:masterfrom
Conversation
HTHou
left a comment
There was a problem hiding this comment.
Very good job. I marked some format issues. It will be great if you fix them.
Also, I think it's necessary to add these interface changes into User Guide docs to tell users.
By the way, the Travis CI has many errors, please fix them. Big thanks!
service-rpc/src/main/java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java
Outdated
Show resolved
Hide resolved
session/src/main/java/org/apache/iotdb/session/SessionDataSet.java
Outdated
Show resolved
Hide resolved
| package org.apache.iotdb.rpc; | ||
|
|
||
|
|
||
| /** | ||
| * @author chenPeng | ||
| * @version 1.0.0 | ||
| * @ClassName Config.java | ||
| * @Description TODO | ||
| * @createTime 2020年08月19日 22:26:00 | ||
| */ | ||
| public class Config { |
There was a problem hiding this comment.
Missing Apache header here...
There was a problem hiding this comment.
Please add this header to all new files.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
Let me change that Co-authored-by: Haonan <hhaonan@outlook.com>
Co-authored-by: Haonan <hhaonan@outlook.com>
Co-authored-by: Haonan <hhaonan@outlook.com>
Co-authored-by: Haonan <hhaonan@outlook.com>
Co-authored-by: Haonan <hhaonan@outlook.com>
….java Co-authored-by: Haonan <hhaonan@outlook.com>
Co-authored-by: Haonan <hhaonan@outlook.com>
…java Co-authored-by: Haonan <hhaonan@outlook.com>
Co-authored-by: Haonan <hhaonan@outlook.com>
Co-authored-by: Haonan <hhaonan@outlook.com>
Co-authored-by: Haonan <hhaonan@outlook.com>
HTHou
left a comment
There was a problem hiding this comment.
There is also a conflict needs to be fixed.
Co-authored-by: Haonan <hhaonan@outlook.com>
HTHou
left a comment
There was a problem hiding this comment.
CI failed, please take a look.
qiaojialin
left a comment
There was a problem hiding this comment.
Good work! Please add ITs in jdbc and Session module. And update the docs/UserGuide/Client and docs/UserGuide/zh/Client.
…ent and docs/UserGuide/zh/Client.
| if (org.apache.iotdb.rpc.Config.boolFormat == org.apache.iotdb.rpc.Config.Constant.BOOLEAN) { | ||
| field.setBoolV(booleanValue); | ||
| } else { | ||
| field = new Field(TSDataType.deserialize((short) 1)); | ||
| field.setIntV(booleanValue ? 1 : 0); | ||
| } |
There was a problem hiding this comment.
Hi, I think we should not change the type of Field. This issue only changes how the getString() method returns data.
| session.insertRecord(deviceId, 1L, measurements, dataTypes, values); | ||
|
|
||
| String expected = "1"; | ||
| SessionDataSet dataSet = session.executeQueryStatement("select s2 from root.sg1.d1"); | ||
| while (dataSet.hasNext()) { | ||
| List<Field> fields = dataSet.next().getFields(); |
There was a problem hiding this comment.
Hi, you could use the SessionDataSet.Iterator() to get the iterator and use the iterator.getString() that triggers the config.
| Class.forName("org.apache.iotdb.jdbc.IoTDBDriver"); | ||
| try (Connection connection = DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root"); | ||
| try (Connection connection = DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/?boolFormat=bool", "root", "root"); | ||
| Statement statement = connection.createStatement()) { |
There was a problem hiding this comment.
If we don't indicate ?boolFormat=bool, is there any problem?
If not, I think we'd better keep the old example to show we don't have to do such setting when getting a normal JDBC connection.
可以通过在 Session,JDBC模块中可以设置Boolean的返回数据类型为0/1或true/false
In Session, the JDBC module can set the Boolean return data type to 0/1 or true/false.
SessionExample
JDBCExample
将来需要传输多个参数也能支持如:
The need to transfer multiple parameters in the future can also be supported such as:
SessionExample
JDBCExample