You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2021/10/13 21:02:58 UTC
[pinot] branch master updated: fix: Sorting tables by number of
segments is broken (#7564)
This is an automated email from the ASF dual-hosted git repository.
jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 5eee297 fix: Sorting tables by number of segments is broken (#7564)
5eee297 is described below
commit 5eee297dbea7b3b73ae853f2479a89e9ce017363
Author: Sanket Shah <sh...@users.noreply.github.com>
AuthorDate: Thu Oct 14 02:32:37 2021 +0530
fix: Sorting tables by number of segments is broken (#7564)
---
pinot-controller/src/main/resources/app/components/Table.tsx | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/pinot-controller/src/main/resources/app/components/Table.tsx b/pinot-controller/src/main/resources/app/components/Table.tsx
index b546327..ffb0928 100644
--- a/pinot-controller/src/main/resources/app/components/Table.tsx
+++ b/pinot-controller/src/main/resources/app/components/Table.tsx
@@ -369,7 +369,17 @@ export default function CustomizedTables({
className={classes.head}
key={index}
onClick={() => {
- setFinalData(_.orderBy(finalData, column, order ? 'asc' : 'desc'));
+ if(column === 'Number of Segments'){
+ const data = finalData.sort((a,b)=>{
+ const aSegmentInt = parseInt(a[column]);
+ const bSegmentInt = parseInt(b[column]);
+ const result = order ? (aSegmentInt > bSegmentInt) : (aSegmentInt < bSegmentInt);
+ return result ? 1 : -1;
+ });
+ setFinalData(data);
+ } else {
+ setFinalData(_.orderBy(finalData, column, order ? 'asc' : 'desc'));
+ }
setOrder(!order);
setColumnClicked(column);
}}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org