Commit b60d6fc
Add Compiler Plugin support for statistics on GroupBy (#1077)
* Add GroupBySumOf functionality to groupBy operations
Introduces the `GroupBySumOf` interpreter for aggregation, enabling the calculation of column sums with customizable expressions and result names in grouped DataFrames. Adds tests and updates APIs to support and validate this feature.
* Add commented GroupBySum0 support with updated scenarios and tests
* Refactor GroupBy statistics functionality and tests.
Updated statistical aggregation functions for GroupBy with comments addressing open questions. Added comprehensive tests to verify behavior across various statistics (sum, mean, median, std, min, and max), replacing older test cases for cleaner coverage.
* Add support for GroupBy mean and median operations.
* Add support for min and max functions
* Added support for std function
* Updated support for sum/sumFor
* Added support for all statistics but faced with limitation of FiR
* Fixed comparable types for median
* Fixed for max/min
* Fixed for std/mean
* added missed casts to median/percentile. Could result in Comparable<Any?> columns
* Refactor groupBy for enhanced type safety and comparability
Replaced direct subtype checks with `isIntraComparable` to improve type safety when resolving columns. Updated documentation syntax for better consistency and clarity. Added schema comparison in test to validate grouping behavior.
* Refactor `GroupBy` aggregation classes and test handling.
Revised `GroupBy` aggregation logic by restructuring classes, improving naming consistency, and refining comments/documentation. Updated test cases to address initializer type mismatches and better handle scenarios involving multiple columns. Added relevant TODOs for unresolved cases linked to issue #1090.
---------
Co-authored-by: Jolan Rensen <jolan.rensen@jetbrains.com>1 parent ccbcd19 commit b60d6fc
File tree
17 files changed
+1159
-14
lines changed- core/src
- main/kotlin/org/jetbrains/kotlinx/dataframe/api
- test/kotlin/org/jetbrains/kotlinx/dataframe/api
- plugins/kotlin-dataframe
- src/org/jetbrains/kotlinx/dataframe/plugin
- impl/api
- testData/box
- tests-gen/org/jetbrains/kotlin/fir/dataframe
17 files changed
+1159
-14
lines changedLines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
| 140 | + | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
| |||
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| 155 | + | |
| 156 | + | |
152 | 157 | | |
153 | 158 | | |
154 | 159 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | | - | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
| 107 | + | |
| 108 | + | |
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
| |||
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| 129 | + | |
| 130 | + | |
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
| |||
147 | 154 | | |
148 | 155 | | |
149 | 156 | | |
| 157 | + | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
| |||
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | | - | |
| 109 | + | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
| 113 | + | |
| 114 | + | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
| |||
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
| 128 | + | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
| |||
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
| 148 | + | |
| 149 | + | |
140 | 150 | | |
141 | 151 | | |
142 | 152 | | |
143 | | - | |
| 153 | + | |
144 | 154 | | |
145 | 155 | | |
146 | 156 | | |
| |||
227 | 237 | | |
228 | 238 | | |
229 | 239 | | |
230 | | - | |
| 240 | + | |
231 | 241 | | |
232 | 242 | | |
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
| 140 | + | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
| |||
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| 155 | + | |
| 156 | + | |
152 | 157 | | |
153 | 158 | | |
154 | 159 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
293 | 293 | | |
294 | 294 | | |
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | | - | |
| 107 | + | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| 112 | + | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
111 | 116 | | |
| |||
118 | 123 | | |
119 | 124 | | |
120 | 125 | | |
| 126 | + | |
121 | 127 | | |
122 | 128 | | |
123 | 129 | | |
| |||
131 | 137 | | |
132 | 138 | | |
133 | 139 | | |
| 140 | + | |
| 141 | + | |
134 | 142 | | |
135 | 143 | | |
136 | 144 | | |
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
140 | 148 | | |
| 149 | + | |
141 | 150 | | |
142 | 151 | | |
143 | 152 | | |
| |||
160 | 169 | | |
161 | 170 | | |
162 | 171 | | |
| 172 | + | |
| 173 | + | |
163 | 174 | | |
164 | 175 | | |
165 | 176 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | | - | |
| 94 | + | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
| 98 | + | |
| 99 | + | |
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
| |||
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
| 113 | + | |
| 114 | + | |
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
| |||
119 | 126 | | |
120 | 127 | | |
121 | 128 | | |
| 129 | + | |
| 130 | + | |
122 | 131 | | |
123 | 132 | | |
124 | 133 | | |
| |||
0 commit comments