You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/04/12 21:00:33 UTC

[GitHub] [incubator-druid] vogievetsky commented on a change in pull request #7460: Add created_time as tie breaker when sorting by status in task table

vogievetsky commented on a change in pull request #7460: Add created_time as tie breaker when sorting by status in task table
URL: https://github.com/apache/incubator-druid/pull/7460#discussion_r275063018
 
 

 ##########
 File path: web-console/src/views/tasks-view.tsx
 ##########
 @@ -521,9 +521,10 @@ ORDER BY "rank" DESC, "created_time" DESC`);
               const previewCount = countBy(previewValues);
               return <span>{Object.keys(previewCount).sort().map(v => `${v} (${previewCount[v]})`).join(', ')}</span>;
             },
-            sortMethod: (status1: string, status2: string) => {
+            sortMethod: (d1, d2, desc) => {
               const statusRanking: any = this.statusRanking;
-              return statusRanking[status1] - statusRanking[status2];
+              const timeDifference = Date.parse(d1.created_time) - Date.parse(d2.created_time);
+              return statusRanking[d1.status] - statusRanking[d2.status] || (desc ? timeDifference : -timeDifference);
 
 Review comment:
   Why is the `desc` parameter only considered in the tie breaker?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org