You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fixed aggregators based on feedback. Removed preservesType property. It's unneeded as we can calculate return types at runtime quickly. Added overload for calculateReturnTypeOrNull for multiple columns. Aggregator callers now use this function instead of preservesType
Copy file name to clipboardExpand all lines: core/api/core.api
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5304,9 +5304,9 @@ public abstract interface class org/jetbrains/kotlinx/dataframe/impl/aggregation
5304
5304
public abstract fun aggregate (Lorg/jetbrains/kotlinx/dataframe/DataColumn;)Ljava/lang/Object;
5305
5305
public abstract fun aggregateCalculatingType (Ljava/lang/Iterable;Ljava/util/Set;)Ljava/lang/Object;
5306
5306
public static synthetic fun aggregateCalculatingType$default (Lorg/jetbrains/kotlinx/dataframe/impl/aggregation/aggregators/Aggregator;Ljava/lang/Iterable;Ljava/util/Set;ILjava/lang/Object;)Ljava/lang/Object;
5307
+
public abstract fun calculateReturnTypeOrNull (Ljava/util/Set;Z)Lkotlin/reflect/KType;
5307
5308
public abstract fun calculateReturnTypeOrNull (Lkotlin/reflect/KType;Z)Lkotlin/reflect/KType;
5308
5309
public abstract fun getName ()Ljava/lang/String;
5309
-
public abstract fun getPreservesType ()Z
5310
5310
}
5311
5311
5312
5312
public final class org/jetbrains/kotlinx/dataframe/impl/aggregation/aggregators/AggregatorKt {
Copy file name to clipboardExpand all lines: core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/aggregators/Aggregator.kt
Copy file name to clipboardExpand all lines: core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/aggregators/AggregatorBase.kt
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -94,4 +94,15 @@ internal abstract class AggregatorBase<in Value, out Return>(
Copy file name to clipboardExpand all lines: core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/aggregators/AggregatorOptionSwitch.kt
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -30,9 +30,8 @@ internal class AggregatorOptionSwitch1<in Param1, out AggregatorType : Aggregato
Copy file name to clipboardExpand all lines: core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/aggregators/Aggregators.kt
+7-17Lines changed: 7 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -33,24 +33,21 @@ internal object Aggregators {
33
33
* -> Return?
34
34
* ```
35
35
*
36
-
* It can also be used as a "simple" aggregator by providing the same function for both steps,
37
-
* requires [preservesType][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.TwoStepAggregator.preservesType] be set to `true`.
36
+
* It can also be used as a "simple" aggregator by providing the same function for both steps.
38
37
*
39
38
* See [FlatteningAggregator][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.FlatteningAggregator] for different behavior for multiple columns.
40
39
*
41
40
* @param name The name of this aggregator.
42
-
* @param getReturnTypeOrNull Functional argument for the [calculateReturnTypeOrNull][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.AggregatorBase.calculateReturnTypeOrNull] function.
41
+
* @param getReturnTypeOrNull Functional argument for the [calculateReturnTypeOrNull][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.TwoStepAggregator.calculateReturnTypeOrNull] function.
43
42
* @param stepOneAggregator Functional argument for the [aggregate][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.TwoStepAggregator.aggregate] function, used within a [DataColumn][org.jetbrains.kotlinx.dataframe.DataColumn] or [Iterable].
44
43
* @param stepTwoAggregator Functional argument for the aggregation function used between different columns.
45
44
* It is run on the results of [stepOneAggregator].
46
-
* @param preservesType If `true`, [Value][Value]` == `[Return][Return].
* It can also be used as a "simple" aggregator by providing the same function for both steps,
78
-
* requires [preservesType][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.TwoStepAggregator.preservesType] be set to `true`.
74
+
* It can also be used as a "simple" aggregator by providing the same function for both steps.
79
75
*
80
76
* See [FlatteningAggregator][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.FlatteningAggregator] for different behavior for multiple columns.
81
77
*
82
78
* @param name The name of this aggregator.
83
-
* @param getReturnTypeOrNull Functional argument for the [calculateReturnTypeOrNull][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.AggregatorBase.calculateReturnTypeOrNull] function.
79
+
* @param getReturnTypeOrNull Functional argument for the [calculateReturnTypeOrNull][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.TwoStepAggregator.calculateReturnTypeOrNull] function.
84
80
* @param stepOneAggregator Functional argument for the [aggregate][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.TwoStepAggregator.aggregate] function, used within a [DataColumn][org.jetbrains.kotlinx.dataframe.DataColumn] or [Iterable].
85
81
* @param stepTwoAggregator Functional argument for the aggregation function used between different columns.
86
82
* It is run on the results of [stepOneAggregator].
87
-
* @param preservesType If `true`, [Value][Value]` == `[Return][Return].
* See [TwoStepAggregator][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.TwoStepAggregator] for different behavior for multiple columns.
122
116
*
123
117
* @param name The name of this aggregator.
124
-
* @param getReturnTypeOrNull Functional argument for the [calculateReturnTypeOrNull][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.AggregatorBase.calculateReturnTypeOrNull] function.
118
+
* @param getReturnTypeOrNull Functional argument for the [calculateReturnTypeOrNull][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.FlatteningAggregator.calculateReturnTypeOrNull] function.
125
119
* @param aggregator Functional argument for the [aggregate][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.FlatteningAggregator.aggregate] function.
126
120
* Note that it must be able to handle `null` values for the [Iterable] overload of [aggregate][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.FlatteningAggregator.aggregate].
127
-
* @param preservesType If `true`, [Value][Value]` == `[Return][Return].
* See [TwoStepAggregator][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.TwoStepAggregator] for different behavior for multiple columns.
158
150
*
159
151
* @param name The name of this aggregator.
160
-
* @param getReturnTypeOrNull Functional argument for the [calculateReturnTypeOrNull][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.AggregatorBase.calculateReturnTypeOrNull] function.
152
+
* @param getReturnTypeOrNull Functional argument for the [calculateReturnTypeOrNull][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.FlatteningAggregator.calculateReturnTypeOrNull] function.
161
153
* @param aggregator Functional argument for the [aggregate][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.FlatteningAggregator.aggregate] function.
162
154
* Note that it must be able to handle `null` values for the [Iterable] overload of [aggregate][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.FlatteningAggregator.aggregate].
163
-
* @param preservesType If `true`, [Value][Value]` == `[Return][Return].
* @param getReturnTypeOrNull Functional argument for the [calculateReturnTypeOrNull][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.AggregatorBase.calculateReturnTypeOrNull] function.
189
+
* @param getReturnTypeOrNull Functional argument for the [calculateReturnTypeOrNull][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.TwoStepNumbersAggregator.calculateReturnTypeOrNull] function.
200
190
* @param aggregator Functional argument for the [aggregate][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.TwoStepNumbersAggregator.aggregate] function, used within a [DataColumn][org.jetbrains.kotlinx.dataframe.DataColumn] or [Iterable].
201
191
* While it takes a [Number] argument, you can assume that all values are of the same specific type, however,
202
192
* this type can be different for different calls to [aggregator][org.jetbrains.kotlinx.dataframe.impl.aggregation.aggregators.AggregatorBase.aggregator].
Copy file name to clipboardExpand all lines: core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/aggregators/FlatteningAggregator.kt
Copy file name to clipboardExpand all lines: core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/aggregators/TwoStepAggregator.kt
0 commit comments