Skip to content

Commit b2a2462

Browse files
hongzhi-gaoHTHou
andauthored
[To dev/1.3] cpp session query timeout (#17403)
Co-authored-by: Haonan <hhaonan@outlook.com>
1 parent e1095fd commit b2a2462

6 files changed

Lines changed: 16 additions & 11 deletions

File tree

.github/workflows/multi-language-client.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
fail-fast: false
4747
max-parallel: 15
4848
matrix:
49-
os: [ubuntu-latest, macos-latest, windows-latest]
49+
os: [ubuntu-latest, windows-latest, macos-latest]
5050
runs-on: ${{ matrix.os}}
5151

5252
steps:
@@ -120,15 +120,15 @@ jobs:
120120
cd iotdb-client
121121
git clone https://github.com/apache/iotdb-client-go.git
122122
cd iotdb-client-go
123-
git checkout rc/1.3.3
123+
git checkout dev/1.3
124124
make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo
125125
126126
python:
127127
strategy:
128128
fail-fast: false
129129
max-parallel: 15
130130
matrix:
131-
python: [ '3.6', '3.x' ]
131+
python: [ '3.x' ]
132132
runs-on: ${{ (matrix.python == '3.6' && 'ubuntu-20.04') || 'ubuntu-latest' }}
133133

134134
steps:

docker/src/main/Dockerfile-1c1d

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ RUN apt update \
3434
&& sed -i 's/cn_internal_address=127.0.0.1/cn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-system.properties \
3535
&& sed -i 's/cn_seed_config_node=127.0.0.1:10710/cn_seed_config_node=0.0.0.0:10710/g' /iotdb/conf/iotdb-system.properties \
3636
&& sed -i 's/dn_seed_config_node=127.0.0.1:10710/dn_seed_config_node=0.0.0.0:10710/g' /iotdb/conf/iotdb-system.properties \
37-
&& sed -i 's/# config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus/config_node_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus/g' /iotdb/conf/iotdb-system.properties \
38-
&& sed -i 's/# schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus/schema_region_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus/g' /iotdb/conf/iotdb-system.properties \
39-
&& sed -i 's/# data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus/data_region_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus/g' /iotdb/conf/iotdb-system.properties \
37+
&& sed -i 's/dn_rpc_address=127.0.0.1/dn_rpc_address=0.0.0.0/g' /iotdb/conf/iotdb-system.properties \
4038
&& apt remove unzip -y \
4139
&& apt autoremove -y \
4240
&& apt purge --auto-remove -y \

iotdb-client/client-cpp/src/main/IoTDBRpcDataSet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ bool IoTDBRpcDataSet::fetchResults() {
188188
TSFetchResultsResp resp;
189189
client_->fetchResultsV2(resp, req);
190190
RpcUtils::verifySuccess(resp.status);
191+
moreData_ = resp.moreData;
191192
if (!resp.hasResultSet) {
192193
close();
193194
}

iotdb-client/client-cpp/src/main/SessionConnection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ std::unique_ptr<SessionDataSet> SessionConnection::executeQueryStatement(const s
193193
return std::unique_ptr<SessionDataSet>(new SessionDataSet(sql, resp.columns, resp.dataTypeList,
194194
resp.columnNameIndexMap, resp.queryId, statementId,
195195
client, sessionId, resp.queryResult, resp.ignoreTimeStamp,
196-
connectionTimeoutInMs, resp.moreData, fetchSize, zoneId));
196+
timeoutInMs, resp.moreData, fetchSize, zoneId));
197197
}
198198

199199
std::unique_ptr<SessionDataSet> SessionConnection::executeRawDataQuery(const std::vector<std::string>& paths,

iotdb-client/client-py/iotdb/utils/IoTDBRpcDataSet.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ def construct_one_data_frame(self):
212212
data_array = np.array(data_array, dtype=object)
213213
else:
214214
raise RuntimeError("unsupported data type {}.".format(data_type))
215-
if data_array.dtype.byteorder == ">":
215+
if (
216+
isinstance(data_array.dtype, np.dtype)
217+
and data_array.dtype.byteorder == ">"
218+
):
216219
data_array = data_array.byteswap().view(
217220
data_array.dtype.newbyteorder("<")
218221
)
@@ -355,7 +358,10 @@ def result_set_to_pandas(self):
355358
data_array = pd.Series(data_array).apply(parse_int_to_date)
356359
else:
357360
raise RuntimeError("unsupported data type {}.".format(data_type))
358-
if data_array.dtype.byteorder == ">":
361+
if (
362+
isinstance(data_array.dtype, np.dtype)
363+
and data_array.dtype.byteorder == ">"
364+
):
359365
data_array = data_array.byteswap().view(
360366
data_array.dtype.newbyteorder("<")
361367
)
@@ -382,7 +388,7 @@ def result_set_to_pandas(self):
382388
or data_type == 10
383389
or data_type == 9
384390
):
385-
tmp_array = np.full(total_length, None, dtype=data_array.dtype)
391+
tmp_array = np.full(total_length, None)
386392

387393
bitmap_buffer = self.__query_data_set.bitmapList[location]
388394
buffer = _to_bitbuffer(bitmap_buffer)

iotdb-client/client-py/tests/integration/test_todf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def test_with_null_query():
139139
tmp_array = np.full(data_nums, np.nan, np.float32)
140140
tmp_array = pd.Series(tmp_array).astype("boolean")
141141
else:
142-
tmp_array = np.full(data_nums, None, dtype=data[ts_path].dtype)
142+
tmp_array = np.full(data_nums, np.nan, dtype=data[ts_path].dtype)
143143
data_empty[ts_path] = tmp_array
144144
df_input = pd.DataFrame(data_empty)
145145

0 commit comments

Comments
 (0)