99//! propagating strict validity, selecting an execution strategy, and validating the finished
1010//! output.
1111//!
12- //! [`BatchPlan`] carries the nullable execution strategy selected by a concrete dispatch.
13- //! [`RowFnExecutionArgs`] applies that strategy, and [`BorrowedRowFnArgs`] pairs each kernel
14- //! invocation with its planning metadata.
12+ //! [`RowInputs`] borrows the input columns, and [`BatchProbe`] classifies them before dispatch.
13+ //! [`BatchInputs`] retains the columns and their classification. [`BatchPlan`] carries the nullable
14+ //! execution strategy selected by a concrete dispatch. [`RowFnExecutionArgs`] applies that strategy,
15+ //! and [`BorrowedRowFnArgs`] pairs each kernel invocation with its planning metadata.
1516
1617use smallvec:: SmallVec ;
1718
@@ -23,6 +24,10 @@ use crate::validity::Validity;
2324mod args;
2425pub ( super ) use args:: BorrowedRowFnArgs ;
2526
27+ mod inputs;
28+ pub ( crate ) use inputs:: ArrayInputs ;
29+ pub ( crate ) use inputs:: RowInputs ;
30+
2631mod execute;
2732pub ( super ) use execute:: finalize_kernel_output;
2833
@@ -31,8 +36,29 @@ mod planning;
3136pub ( super ) use super :: visitor:: BatchPlan ;
3237pub ( super ) use super :: visitor:: RowPolicy ;
3338
34- /// The same-length input columns and metadata for one row-function execution.
35- pub ( crate ) struct RowFnExecutionArgs {
39+ /// What batch execution derives from its borrowed inputs before a dispatch plans them.
40+ ///
41+ /// A probe holds no input column. [`BatchInputs`] retains the columns and their probe when a batch
42+ /// needs owned inputs for execution.
43+ pub ( crate ) struct BatchProbe {
44+ /// The number of rows in the original execution scope.
45+ row_count : usize ,
46+
47+ /// The conjoined input validity. An output row is valid exactly when it is valid in every
48+ /// input. Conjoining is lazy, and null handling materializes the mask only when required.
49+ validity : Validity ,
50+
51+ /// Bit `i` is set when input `i` is a batch constant, seen through extension and masked
52+ /// wrappers.
53+ const_mask : u32 ,
54+
55+ /// Whether any input is a null literal constant.
56+ has_null_const : bool ,
57+ }
58+
59+ /// The same-length input columns collected for one row-function execution, with the facts of
60+ /// their [`BatchProbe`].
61+ pub ( crate ) struct BatchInputs {
3662 /// The function being executed, named in the errors this raises.
3763 id : ScalarFnId ,
3864
@@ -42,13 +68,26 @@ pub(crate) struct RowFnExecutionArgs {
4268 /// The input columns, collected once for validity, constant folding, filtering, and execution.
4369 inputs : SmallVec < [ ArrayRef ; 4 ] > ,
4470
45- /// The input dtypes, collected with the columns and reused by both planning and execution.
46- arg_dtypes : SmallVec < [ DType ; 4 ] > ,
47-
4871 /// The conjoined input validity. An output row is valid exactly when it is valid in every
4972 /// input. Conjoining is lazy, and null handling materializes the mask only when required.
5073 validity : Validity ,
5174
75+ /// Bit `i` is set when input `i` is a batch constant, seen through extension and masked
76+ /// wrappers.
77+ const_mask : u32 ,
78+
79+ /// Whether any input is a null literal constant.
80+ has_null_const : bool ,
81+ }
82+
83+ /// The same-length input columns and metadata for one row-function execution.
84+ pub ( crate ) struct RowFnExecutionArgs < ' a > {
85+ /// The collected input columns and their conjoined validity.
86+ batch : & ' a BatchInputs ,
87+
88+ /// The input dtypes, collected with the columns and reused by both planning and execution.
89+ arg_dtypes : & ' a [ DType ] ,
90+
5291 /// The output dtype, widened to nullable when any input is nullable. The finished column is
5392 /// reconciled against this dtype.
5493 result_dtype : DType ,
0 commit comments