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_r275072341
 
 

 ##########
 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:
   I think that is not what we want. I think the sort should behave honestly 
meaning that buy default Running is on top and the latest created time is on 
top, but if you reverse the order then the entire list reverses.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to