You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2021/09/12 03:11:45 UTC

[skywalking] 01/01: Fix that `sortMetrics` should only return `long` not `double`

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch bugfix/double-should-be-long
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit ef488a03c0ba20f10f6fb565212356303e54263d
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Sun Sep 12 11:11:26 2021 +0800

    Fix that `sortMetrics` should only return `long` not `double`
---
 .../storage/plugin/elasticsearch/query/AggregationQueryEsDAO.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/AggregationQueryEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/AggregationQueryEsDAO.java
index 2f67266..dc831b5 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/AggregationQueryEsDAO.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/AggregationQueryEsDAO.java
@@ -118,7 +118,7 @@ public class AggregationQueryEsDAO extends EsDAO implements IAggregationQueryDAO
             SelectedRecord record = new SelectedRecord();
             record.setId((String) termsBucket.get("key"));
             Map<String, Object> value = (Map<String, Object>) termsBucket.get(valueColumnName);
-            record.setValue(String.valueOf(value.get("value")));
+            record.setValue(String.valueOf(((Number) value.get("value")).longValue()));
             topNList.add(record);
         }