(n int, attrs map[string]*integerAttributeSummary)
| 1046 | } |
| 1047 | |
| 1048 | func topNInt(n int, attrs map[string]*integerAttributeSummary) []*integerAttributeSummary { |
| 1049 | top := make([]*integerAttributeSummary, 0, len(attrs)) |
| 1050 | for _, attr := range attrs { |
| 1051 | top = append(top, attr) |
| 1052 | } |
| 1053 | sort.Slice(top, func(i, j int) bool { |
| 1054 | return top[i].count > top[j].count |
| 1055 | }) |
| 1056 | if len(top) > n { |
| 1057 | top = top[:n] |
| 1058 | } |
| 1059 | return top |
| 1060 | } |
| 1061 | |
| 1062 | var _ parquetquery.GroupPredicate = (*attrStatsCollector)(nil) |
| 1063 |
no outgoing calls
no test coverage detected