taosdata / taosdata/TDengine

last_row return wrong result

Open
#24,754 6 comments 0 reactions 1 assignee View on GitHub

@yu285 is already working on this.

Since Feb 17, 2024.

help wanted question
Dominant language
C
Stars
25.1k
Forks
5k
Avg merge
4d 59m
Merged PRs (30d)
7

Description

General Questions
A general question should be related to TDengine's user's manual, user experience, milestones, business cooperations etc.
根据issue295issue293
查询超级表下属子表的值只需要使用last_row关键字。但是我测试过程中出现了last_row返回的数据不正确的问题。
测试的过程如下
使用表名的最后四位作为小数,时间戳的毫秒作为整数生成数值,对应的时间作为时间写入到数据库中。
当我使用last_row关键字进行查询的时候发现数据居然和我生成的规则不一致,比如时间为2024-02-08 16:53:27.817表名为abcdefghijklmnopqrstuvwxyzabc0147的数据,按照生成逻辑应该是817.147,实际查询也是这样。
不过使用last_row关键字进行查询的时候可能就会出现时间与数值的逻辑不对应的结果。这里是对应的截图,子表和超级表查询都会出现这个问题。
image
image
补充:
我的集群有三台4C8G虚拟机
taos版本是3.2.2.0
使用的是springboot进行插入,可能会有多线程写入的可能。
建库语句create database kkstable CACHEMODEL 'last_row' DURATION 30 WAL_FSYNC_PERIOD 60000 KEEP 3650 REPLICA 1 VGROUPS 3 STT_TRIGGER 1
建表语句create stable kkstable.kksstable (ts timestamp,current float) TAGS (kks binary(33));

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.