mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-26 19:00:02 +00:00
parent
32b8bea8c2
commit
48d6776240
@ -28,19 +28,21 @@ type Props = {
|
|||||||
const viewCap = 3;
|
const viewCap = 3;
|
||||||
|
|
||||||
const getUniqueTablesWithCount = (tableFQNs: Props['tableList']) => {
|
const getUniqueTablesWithCount = (tableFQNs: Props['tableList']) => {
|
||||||
return tableFQNs.reduce((resList, curr) => {
|
return tableFQNs
|
||||||
let duplicates = false;
|
.reduce((resList, curr) => {
|
||||||
for (const table of resList) {
|
let duplicates = false;
|
||||||
if (table.fqn === curr.fqn) {
|
for (const table of resList) {
|
||||||
table.joinCount += curr.joinCount;
|
if (table.fqn === curr.fqn) {
|
||||||
duplicates = true;
|
table.joinCount += curr.joinCount;
|
||||||
|
duplicates = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return duplicates ? resList : [...resList, curr];
|
return duplicates ? resList : [...resList, curr];
|
||||||
}, [] as Props['tableList']);
|
}, [] as Props['tableList'])
|
||||||
|
.sort((a, b) => (a.joinCount < b.joinCount ? 1 : -1));
|
||||||
};
|
};
|
||||||
|
|
||||||
const FrequentlyJoinedTables: FunctionComponent<Props> = ({
|
const FrequentlyJoinedTables: FunctionComponent<Props> = ({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user