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