@@ -1910,7 +1910,7 @@ impl<'a, Index: ColumnIndex> ConstantFolder<'a, Index> {
19101910 } ;
19111911
19121912 if inner_expr. as_constant ( ) . is_some ( ) {
1913- let block = DataBlock :: empty ( ) ;
1913+ let block = DataBlock :: empty_with_rows ( 1 ) ;
19141914 let evaluator = Evaluator :: new ( & block, self . func_ctx , self . fn_registry ) ;
19151915 // Since we know the expression is constant, it'll be safe to change its column index type.
19161916 let cast_expr = cast_expr. project_column_ref ( |_| unreachable ! ( ) ) ;
@@ -2041,7 +2041,7 @@ impl<'a, Index: ColumnIndex> ConstantFolder<'a, Index> {
20412041 } ;
20422042
20432043 if all_args_is_scalar {
2044- let block = DataBlock :: empty ( ) ;
2044+ let block = DataBlock :: empty_with_rows ( 1 ) ;
20452045 let evaluator = Evaluator :: new ( & block, self . func_ctx , self . fn_registry ) ;
20462046 // Since we know the expression is constant, it'll be safe to change its column index type.
20472047 let func_expr = func_expr. project_column_ref ( |_| unreachable ! ( ) ) ;
@@ -2120,7 +2120,7 @@ impl<'a, Index: ColumnIndex> ConstantFolder<'a, Index> {
21202120 }
21212121
21222122 if all_args_is_scalar {
2123- let block = DataBlock :: empty ( ) ;
2123+ let block = DataBlock :: empty_with_rows ( 1 ) ;
21242124 let evaluator = Evaluator :: new ( & block, self . func_ctx , self . fn_registry ) ;
21252125 // Since we know the expression is constant, it'll be safe to change its column index type.
21262126 let func_expr = func_expr. project_column_ref ( |_| unreachable ! ( ) ) ;
@@ -2167,7 +2167,7 @@ impl<'a, Index: ColumnIndex> ConstantFolder<'a, Index> {
21672167 } ;
21682168
21692169 if all_args_is_scalar {
2170- let block = DataBlock :: empty ( ) ;
2170+ let block = DataBlock :: empty_with_rows ( 1 ) ;
21712171 let evaluator = Evaluator :: new ( & block, self . func_ctx , self . fn_registry ) ;
21722172 // Since we know the expression is constant, it'll be safe to change its column index type.
21732173 let func_expr = func_expr. project_column_ref ( |_| unreachable ! ( ) ) ;
0 commit comments