File tree Expand file tree Collapse file tree 3 files changed +52
-2
lines changed Expand file tree Collapse file tree 3 files changed +52
-2
lines changed Original file line number Diff line number Diff line change @@ -176,11 +176,11 @@ pub fn register(registry: &mut FunctionRegistry) {
176
176
for left in ALL_INTEGER_TYPES {
177
177
with_number_mapped_type ! ( L , match left {
178
178
DataType :: L => {
179
- registry. register_1_arg:: <NumberType <L >, NumberType <f64 >, _, _>(
179
+ registry. register_1_arg:: <NumberType <L >, NumberType <L >, _, _>(
180
180
"ceil" ,
181
181
FunctionProperty :: default ( ) ,
182
182
|_| None ,
183
- |val| val as f64 ,
183
+ |val| val,
184
184
) ;
185
185
}
186
186
_ => unreachable!( ) ,
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ fn test_math() {
29
29
test_abs ( file) ;
30
30
test_sign ( file) ;
31
31
test_trigonometric ( file) ;
32
+ test_ceil ( file) ;
32
33
test_exp ( file) ;
33
34
test_round ( file) ;
34
35
test_sqrt ( file) ;
@@ -74,6 +75,16 @@ fn test_trigonometric(file: &mut impl Write) {
74
75
) ] ) ;
75
76
}
76
77
78
+ fn test_ceil ( file : & mut impl Write ) {
79
+ run_ast ( file, "ceil(5)" , & [ ] ) ;
80
+ run_ast ( file, "ceil(5.6)" , & [ ] ) ;
81
+ run_ast ( file, "ceil(a)" , & [ (
82
+ "a" ,
83
+ DataType :: Float64 ,
84
+ Column :: from_data ( vec ! [ 1.23f64 , -1.23 ] ) ,
85
+ ) ] ) ;
86
+ }
87
+
77
88
fn test_exp ( file : & mut impl Write ) {
78
89
run_ast ( file, "exp(2)" , & [ ] ) ;
79
90
run_ast ( file, "exp(-2)" , & [ ] ) ;
Original file line number Diff line number Diff line change @@ -191,6 +191,45 @@ evaluation (internal):
191
191
+--------+--------------------------------------------------------------------------+
192
192
193
193
194
+ ast : ceil(5)
195
+ raw expr : ceil(5_u8)
196
+ checked expr : ceil<UInt8>(5_u8)
197
+ optimized expr : 5_u8
198
+ output type : UInt8
199
+ output domain : Unknown
200
+ output : 5
201
+
202
+
203
+ ast : ceil(5.6)
204
+ raw expr : ceil(5.6_f64)
205
+ checked expr : ceil<Float64>(5.6_f64)
206
+ optimized expr : 6.0_f64
207
+ output type : Float64
208
+ output domain : Unknown
209
+ output : 6.0
210
+
211
+
212
+ ast : ceil(a)
213
+ raw expr : ceil(ColumnRef(0)::Float64)
214
+ checked expr : ceil<Float64>(ColumnRef(0))
215
+ evaluation:
216
+ +--------+----------------+---------+
217
+ | | a | Output |
218
+ +--------+----------------+---------+
219
+ | Type | Float64 | Float64 |
220
+ | Domain | {-1.23..=1.23} | Unknown |
221
+ | Row 0 | 1.23 | 2.0 |
222
+ | Row 1 | -1.23 | -1.0 |
223
+ +--------+----------------+---------+
224
+ evaluation (internal):
225
+ +--------+------------------------+
226
+ | Column | Data |
227
+ +--------+------------------------+
228
+ | a | Float64([1.23, -1.23]) |
229
+ | Output | Float64([2.0, -1.0]) |
230
+ +--------+------------------------+
231
+
232
+
194
233
ast : exp(2)
195
234
raw expr : exp(2_u8)
196
235
checked expr : exp<UInt8>(2_u8)
You can’t perform that action at this time.
0 commit comments