Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kibana dashboard 展示问题 #58

Closed
warmdust opened this issue Jul 26, 2024 · 5 comments
Closed

kibana dashboard 展示问题 #58

warmdust opened this issue Jul 26, 2024 · 5 comments

Comments

@warmdust
Copy link

kibana dashboard 展示排序有问题,但是数据是准确的。

实际体验下来,数据比较大的时候,才会出现排序问题,小数据的时候不会出现排序问题

image

image

@linger000
Copy link
Contributor

按上面配置条件,应该x-axis 是ip。x和y-axis互换是如何配置,辛苦提供下截图。

@linger000
Copy link
Contributor

模拟上面sum数据量,是没有问题的。这个视图配置是直接使用ck group by order by 语法,建议f12看下对应视图的sql,ck上直接执行看下结果。用于识别是否字段类型或值引发的问题。
若还有疑问,提供下一个正常和一个非正常视图的对应sql和表结构

@warmdust
Copy link
Author

建表

CREATE TABLE ckibana_demo (create_time DateTime('Asia/Shanghai'),ip String,rsize Int64)
ENGINE = SummingMergeTree()
PARTITION BY toYYYYMM(create_time)
PRIMARY KEY (create_time,ip);

写入数据

insert into ckibana_demo values (now(),'127.0.0.1', 123412341234);
insert into ckibana_demo values (now(),'127.0.0.2', 223412341234);
insert into ckibana_demo values (now(),'127.0.0.3', 323412341234);
insert into ckibana_demo values (now(),'127.0.0.4', 423412341234);
insert into ckibana_demo values (now(),'127.0.0.5', 523412341234);

kibana visualize

image

_msearch?rest_total_hits_as_int=true&ignore_throttled=true 接口响应如下:

{
    "responses": [
        {
            "hits": {
                "hits": [

                ],
                "total": 3,
                "max_score": 0
            },
            "took": 31,
            "cache": false,
            "aggregations": {
                "2": {
                    "doc_count_error_upper_bound": 0,
                    "sum_other_doc_count": 0,
                    "buckets": [
                        {
                            "1": {
                                "value": 323412341234
                            },
                            "doc_count": 1,
                            "key": "127.0.0.3"
                        },
                        {
                            "1": {
                                "value": 423412341234
                            },
                            "doc_count": 1,
                            "key": "127.0.0.4"
                        },
                        {
                            "1": {
                                "value": 523412341234
                            },
                            "doc_count": 1,
                            "key": "127.0.0.5"
                        }
                    ]
                }
            },
            "status": 200,
            "error": null,
            "sqls": [
                "SELECT SUM(`rsize`) as `1_rsize`,`ip` as `2_ip`,count(1) as `2__ckCount` FROM `ckibana_demo` PREWHERE (  `create_time` <= toDateTime(1724320140000/1000)  AND  `create_time` >= toDateTime(1724319240000/1000)  ) AND (`2_ip` is not null AND `2_ip` != '' ) GROUP BY `2_ip` ORDER BY `1_rsize` desc LIMIT 3"
            ],
            "timed_out": false,
            "_shards": {
                "total": 1,
                "successful": 1,
                "skipped": 0,
                "failed": 0
            }
        }
    ]
}

sql 执行如下
image

查询 clickhouse 返回的数据是降序的,kibana 展示并不是降序的

linger000 pushed a commit to linger000/ckibana that referenced this issue Aug 22, 2024
@linger000
Copy link
Contributor

已修复。
#66

1 similar comment
@linger000
Copy link
Contributor

已修复。
#66

@famosss famosss closed this as completed Aug 23, 2024
famosss added a commit that referenced this issue Aug 23, 2024
fix:修复大数值排序问题#58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants