Skip to content

一个有关排序查询的问题(A problem about sort query) #3888

Answered by SteveYurongSu
LIU-WEI-git asked this question in Q&A
Discussion options

You must be logged in to vote

谢谢你的提问 :D

我尝试了select top_k(last_ping, "k"="1") from root.skywalking.instance_traffic..,我希望获得last_ping=2的那一条数据,但由于两条数据在两个device下,查询结果还是两条,并没有实现过滤。

top_k这个函数的输出结果本质还是一个时间序列。select 多个时间序列的时候,结果集是默认按照多列的时间戳归并对齐的。
在你的场景下,每一个 top_k 的输出列最多只有一个非 null 的数据点,目前可以通过判断非 null 值的位置来获取过滤情况。

我猜你是想要类似 align by device 这样的表结构作为返回结果集?


Thanks for your questions!

I try to use select top_k(last_ping, "k"="1") from root.skywalking.instance_traffic.. and hope to get only a piece of data whose last_ping=2. However, because the two data are in two devices, the query result is still two, and filtering is not implemented.

The output result of the top_k function is essentially a time series. When selecting multipl…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@LIU-WEI-git
Comment options

@SteveYurongSu
Comment options

@LIU-WEI-git
Comment options

@LIU-WEI-git
Comment options

@SteveYurongSu
Comment options

Answer selected by LIU-WEI-git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants