iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

sessionDataSet.hasNext() 为false

Open szz-9503 opened this issue 2 years ago • 7 comments

Describe the bug 同一条sql,在时序数据库可以查询得出数据,但是我在java 中使用 session.executeQueryStatement(sql) 方法,获取到的SessionDataSet,sessionDataSet.getColumnNames() 是有数据的,但是 sessionDataSet.hasNext() 中的 hasCachedResults() 为false , (这个现象不是经常出现)

szz-9503 avatar Aug 12 '22 08:08 szz-9503

导致我获取不到 时序数据的值

szz-9503 avatar Aug 12 '22 08:08 szz-9503

It obeys expected that getColumnNames() has names.

For example, the following sql has no data, but the resultset has column names.

IoTDB> select * from root.** where time > 100;
+----+--------------+--------------+
|Time|root.sg1.d1.s1|root.sg1.d2.s1|
+----+--------------+--------------+
+----+--------------+--------------+
Empty set.
It costs 0.066s
IoTDB> select * from root.** where time > 100 align by device;
+----+------+--+
|Time|Device|s1|
+----+------+--+
+----+------+--+
Empty set.
It costs 0.018s

同一条sql,在时序数据库可以查询得出数据,但是 sessionDataSet.hasNext() 中的 hasCachedResults() 为false

it does matter that HasCachedResults() == false. Whether a client can get data just depends on sessionDataSet.hasNext() == true.

Even though it can not be stable reproduced, you may still paste the sqls and code snippets to help us check whether it is a bug.

jixuan1989 avatar Aug 14 '22 08:08 jixuan1989

image

szz-9503 avatar Aug 15 '22 01:08 szz-9503

image

szz-9503 avatar Aug 15 '22 02:08 szz-9503

我使用的是session 中提供的example,在使用过程中会遇见数据库有数据,但是就如你所说的sessionDataSet.hasNext()==false 的情况

szz-9503 avatar Aug 15 '22 02:08 szz-9503

可以打印一下代码里的SQL吗。

jixuan1989 avatar Aug 15 '22 02:08 jixuan1989

我让数据采集跑了2天,发现之前那个问题不见了,我会继续观察这个问题,如果再次发生,我会将SQL贴入到这个帖子里面的,麻烦你们了

szz-9503 avatar Aug 15 '22 02:08 szz-9503