@@ -8,10 +8,12 @@ import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload
8
8
import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
9
9
import org.jetbrains.kotlinx.dataframe.annotations.Refine
10
10
import org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor
11
+ import org.jetbrains.kotlinx.dataframe.columns.ColumnPath
11
12
import org.jetbrains.kotlinx.dataframe.impl.aggregation.internal
12
13
import org.jetbrains.kotlinx.dataframe.impl.aggregation.withExpr
13
14
import org.jetbrains.kotlinx.dataframe.impl.columnName
14
15
import kotlin.reflect.KProperty
16
+ import kotlin.reflect.KType
15
17
import kotlin.reflect.typeOf
16
18
17
19
// region GroupBy
@@ -29,7 +31,7 @@ public fun <T> GroupBy<T, *>.into(column: KProperty<AnyFrame>): DataFrame<T> = t
29
31
public inline fun <T , G , reified V > GroupBy <T , G >.into (
30
32
columnName : String? = null,
31
33
noinline expression : RowExpression <G , V >,
32
- ): DataFrame <G > = into(pathOf(columnName ? : groups.name()).cast() , expression)
34
+ ): DataFrame <G > = into(pathOf(columnName ? : groups.name()), expression, typeOf< V >() )
33
35
34
36
// @Hide
35
37
@AccessApiOverload
@@ -44,6 +46,16 @@ public inline fun <T, G, reified V> GroupBy<T, G>.into(
44
46
}
45
47
}
46
48
49
+ @PublishedApi
50
+ internal fun <T , G , V > GroupBy <T , G >.into (
51
+ path : ColumnPath ,
52
+ expression : RowExpression <G , V >,
53
+ type : KType ,
54
+ ): DataFrame <G > =
55
+ aggregate {
56
+ internal().withExpr(type, path, expression)
57
+ }
58
+
47
59
@AccessApiOverload
48
60
public inline fun <T , G , reified V > GroupBy <T , G >.into (
49
61
column : KProperty <V >,
0 commit comments