@@ -10,6 +10,7 @@ import org.partiql.spi.fn.FnExperimental
10
10
import org.partiql.spi.fn.FnParameter
11
11
import org.partiql.value.PartiQLValueExperimental
12
12
import org.partiql.value.PartiQLValueType.ANY
13
+ import org.partiql.value.PartiQLValueType.DECIMAL
13
14
import org.partiql.value.PartiQLValueType.DECIMAL_ARBITRARY
14
15
import org.partiql.value.PartiQLValueType.FLOAT32
15
16
import org.partiql.value.PartiQLValueType.FLOAT64
@@ -24,79 +25,79 @@ public object Agg_AVG__INT8__INT8 : Agg {
24
25
25
26
override val signature: AggSignature = AggSignature (
26
27
name = " avg" ,
27
- returns = INT8 ,
28
+ returns = DECIMAL ,
28
29
parameters = listOf (
29
30
FnParameter (" value" , INT8 ),
30
31
),
31
32
isNullable = true ,
32
33
isDecomposable = true
33
34
)
34
35
35
- override fun accumulator (): Agg .Accumulator = AccumulatorAvg (INT8 )
36
+ override fun accumulator (): Agg .Accumulator = AccumulatorAvg (DECIMAL )
36
37
}
37
38
38
39
@OptIn(PartiQLValueExperimental ::class , FnExperimental ::class )
39
40
public object Agg_AVG__INT16__INT16 : Agg {
40
41
41
42
override val signature: AggSignature = AggSignature (
42
43
name = " avg" ,
43
- returns = INT16 ,
44
+ returns = DECIMAL ,
44
45
parameters = listOf (
45
46
FnParameter (" value" , INT16 ),
46
47
),
47
48
isNullable = true ,
48
49
isDecomposable = true
49
50
)
50
51
51
- override fun accumulator (): Agg .Accumulator = AccumulatorAvg (INT16 )
52
+ override fun accumulator (): Agg .Accumulator = AccumulatorAvg (DECIMAL )
52
53
}
53
54
54
55
@OptIn(PartiQLValueExperimental ::class , FnExperimental ::class )
55
56
public object Agg_AVG__INT32__INT32 : Agg {
56
57
57
58
override val signature: AggSignature = AggSignature (
58
59
name = " avg" ,
59
- returns = INT32 ,
60
+ returns = DECIMAL ,
60
61
parameters = listOf (
61
62
FnParameter (" value" , INT32 ),
62
63
),
63
64
isNullable = true ,
64
65
isDecomposable = true
65
66
)
66
67
67
- override fun accumulator (): Agg .Accumulator = AccumulatorAvg (INT32 )
68
+ override fun accumulator (): Agg .Accumulator = AccumulatorAvg (DECIMAL )
68
69
}
69
70
70
71
@OptIn(PartiQLValueExperimental ::class , FnExperimental ::class )
71
72
public object Agg_AVG__INT64__INT64 : Agg {
72
73
73
74
override val signature: AggSignature = AggSignature (
74
75
name = " avg" ,
75
- returns = INT64 ,
76
+ returns = DECIMAL ,
76
77
parameters = listOf (
77
78
FnParameter (" value" , INT64 ),
78
79
),
79
80
isNullable = true ,
80
81
isDecomposable = true
81
82
)
82
83
83
- override fun accumulator (): Agg .Accumulator = AccumulatorAvg (INT64 )
84
+ override fun accumulator (): Agg .Accumulator = AccumulatorAvg (DECIMAL )
84
85
}
85
86
86
87
@OptIn(PartiQLValueExperimental ::class , FnExperimental ::class )
87
88
public object Agg_AVG__INT__INT : Agg {
88
89
89
90
override val signature: AggSignature = AggSignature (
90
91
name = " avg" ,
91
- returns = INT ,
92
+ returns = DECIMAL_ARBITRARY ,
92
93
parameters = listOf (
93
94
FnParameter (" value" , INT ),
94
95
),
95
96
isNullable = true ,
96
97
isDecomposable = true
97
98
)
98
99
99
- override fun accumulator (): Agg .Accumulator = AccumulatorAvg (INT )
100
+ override fun accumulator (): Agg .Accumulator = AccumulatorAvg (DECIMAL_ARBITRARY )
100
101
}
101
102
102
103
@OptIn(PartiQLValueExperimental ::class , FnExperimental ::class )
@@ -152,13 +153,13 @@ public object Agg_AVG__ANY__ANY : Agg {
152
153
153
154
override val signature: AggSignature = AggSignature (
154
155
name = " avg" ,
155
- returns = ANY ,
156
+ returns = DECIMAL_ARBITRARY ,
156
157
parameters = listOf (
157
158
FnParameter (" value" , ANY ),
158
159
),
159
160
isNullable = true ,
160
161
isDecomposable = true
161
162
)
162
163
163
- override fun accumulator (): Agg .Accumulator = AccumulatorAvg ()
164
+ override fun accumulator (): Agg .Accumulator = AccumulatorAvg (DECIMAL_ARBITRARY )
164
165
}
0 commit comments