You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/11/26 01:15:11 UTC

[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10035: Use column value name for apdex topn sorted queries

wu-sheng commented on code in PR #10035:
URL: https://github.com/apache/skywalking/pull/10035#discussion_r1032720745


##########
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/AggregationQueryEsDAO.java:
##########
@@ -120,11 +120,13 @@ public List<SelectedRecord> sortMetrics(final TopNCondition condition,
         final List<Map<String, Object>> buckets =
             (List<Map<String, Object>>) idTerms.get("buckets");
         for (Map<String, Object> termsBucket : buckets) {
-            SelectedRecord record = new SelectedRecord();
-            record.setId((String) termsBucket.get("key"));
             Map<String, Object> value = (Map<String, Object>) termsBucket.get(valueColumnName);
-            record.setValue(String.valueOf(((Number) value.get("value")).longValue()));
-            topNList.add(record);
+            if (value.get("value") != null) {

Review Comment:
   This could only avoid NPE. I think @wankai123 has found the root cause, should be able to fix soon.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org