8000 count查询时间参数用纳秒格式和文本格式时返回的结果不一致 · Issue #891 · openGemini/openGemini · GitHub
[go: up one dir, main page]

Skip to content

count查询时间参数用纳秒格式和文本格式时返回的结果不一致 #891

Open

Description

@yangkun2216

Describe the bug(Bug 描述)

版本:1.3.1
操作系统:kylin v10
时间范围用纳秒和文本时间两种方式进行count查询返回结果不一致
分两种情况:1、先用文本格式时间查询,再用纳秒格式时间查询,返回的count条数不一致。
2、先用纳秒格式时间查询,接着用文本格式时间查询,返回的count条数一致,过5分钟后再用文本格式时间查询,返回count条数与上次查询不一致
用纳秒格式,count数据是稳定的,sql如下,
select count(time) from "__light"."autogen"."df" where time >= 1744300800000000000 and time < 1745164800000000000
select count(time) from "__light"."autogen"."df" where time >= '2025-04-11T00:00:00+08:00' and time < '2025-04-21T00:00:00+08:00'

To Reproduce(Bug 复现步骤)

1、先用文本格式时间查询,例如:
select count(time) from "__light"."autogen"."df" where time >= '2025-04-11T00:00:00+08:00' and time < '2025-04-21T00:00:00+08:00'
2、再用纳秒格式时间查询,例如:
select count(time) from "__light"."autogen"."df" where time >= 1744300800000000000 and time < 1745164800000000000

Expected behavior(期望结果)

No response

Screenshots(屏幕截图)

Logs(完整的错误日志)

Additional context(其他的一些补充内容)

No response

Activity

  1. TDroyal commented on Jul 17, 2025

    @TDroyal
    Contributor

    我的ts-cli是1.3.1(直接下的官方的release包),然后我clone了openGemini最新的源码在本地进行了编译,使用config/install.conf配置文件在本地起了一个单机的数据库,我的环境为ubuntu。然后我按你的复现过程做了一遍,但是没有出现你上诉的问题。你可以尝试使用现在最新的源码编译一下,看看是否还会出现上述问题?也请你将bug出现的过程提供更多细节。

    openGemini CLI 1.3.1 (rev-revision)
    Please use `quit`, `exit` or `Ctrl-D` to exit this program.
    > select count(time) from "_internal"."autogen"."io" where time >= '2025-07-16T10:20:10+08:00' and time < '2025-07-17T14:09:40+08:00'
    name: io
    +---------------------+-------+
    |        time         | count |
    +---------------------+-------+
    | 1752632410000000000 |  4171 |
    +---------------------+-------+
    2 columns, 1 rows in set
    > select count(time) from "_internal"."autogen"."io" where time >= 1752632410000000000 and time < 1752732580000000000
    name: io 
    +---------------------+-------+
    |        time         | count |
    +---------------------+-------+
    | 1752632410000000000 |  4171 |
    +---------------------+-------+
    2 columns, 1 rows in set

    @yangkun2216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0