@@ -25,7 +25,7 @@ impl CompareKernel for DateTimeParts {
2525 lhs : ArrayView < ' _ , Self > ,
2626 rhs : & ArrayRef ,
2727 operator : CompareOperator ,
28- _ctx : & mut ExecutionCtx ,
28+ ctx : & mut ExecutionCtx ,
2929 ) -> VortexResult < Option < ArrayRef > > {
3030 let Some ( rhs_const) = rhs. as_constant ( ) else {
3131 return Ok ( None ) ;
@@ -51,17 +51,17 @@ impl CompareKernel for DateTimeParts {
5151 let ts_parts = timestamp:: split ( timestamp, options. unit ) ?;
5252
5353 match operator {
54- CompareOperator :: Eq => compare_eq ( lhs, & ts_parts, nullability) ,
55- CompareOperator :: NotEq => compare_ne ( lhs, & ts_parts, nullability) ,
54+ CompareOperator :: Eq => compare_eq ( lhs, & ts_parts, nullability, ctx ) ,
55+ CompareOperator :: NotEq => compare_ne ( lhs, & ts_parts, nullability, ctx ) ,
5656 // lt and lte have identical behavior, as we optimize
5757 // for the case that all days on the lhs are smaller.
5858 // If that special case is not hit, we return `Ok(None)` to
5959 // signal that the comparison wasn't handled within dtp.
60- CompareOperator :: Lt => compare_lt ( lhs, & ts_parts, nullability) ,
61- CompareOperator :: Lte => compare_lt ( lhs, & ts_parts, nullability) ,
60+ CompareOperator :: Lt => compare_lt ( lhs, & ts_parts, nullability, ctx ) ,
61+ CompareOperator :: Lte => compare_lt ( lhs, & ts_parts, nullability, ctx ) ,
6262 // (Like for lt, lte)
63- CompareOperator :: Gt => compare_gt ( lhs, & ts_parts, nullability) ,
64- CompareOperator :: Gte => compare_gt ( lhs, & ts_parts, nullability) ,
63+ CompareOperator :: Gt => compare_gt ( lhs, & ts_parts, nullability, ctx ) ,
64+ CompareOperator :: Gte => compare_gt ( lhs, & ts_parts, nullability, ctx ) ,
6565 }
6666 }
6767}
@@ -70,9 +70,10 @@ fn compare_eq(
7070 lhs : ArrayView < DateTimeParts > ,
7171 ts_parts : & timestamp:: TimestampParts ,
7272 nullability : Nullability ,
73+ ctx : & mut ExecutionCtx ,
7374) -> VortexResult < Option < ArrayRef > > {
7475 let mut comparison = compare_dtp ( lhs. days ( ) , ts_parts. days , CompareOperator :: Eq , nullability) ?;
75- if comparison. statistics ( ) . compute_max :: < bool > ( ) == Some ( false ) {
76+ if comparison. statistics ( ) . compute_max :: < bool > ( ctx ) == Some ( false ) {
7677 // All values are different.
7778 return Ok ( Some ( comparison) ) ;
7879 }
@@ -85,7 +86,7 @@ fn compare_eq(
8586 ) ?
8687 . binary ( comparison, Operator :: And ) ?;
8788
88- if comparison. statistics ( ) . compute_max :: < bool > ( ) == Some ( false ) {
89+ if comparison. statistics ( ) . compute_max :: < bool > ( ctx ) == Some ( false ) {
8990 // All values are different.
9091 return Ok ( Some ( comparison) ) ;
9192 }
@@ -105,14 +106,15 @@ fn compare_ne(
105106 lhs : ArrayView < DateTimeParts > ,
106107 ts_parts : & timestamp:: TimestampParts ,
107108 nullability : Nullability ,
109+ ctx : & mut ExecutionCtx ,
108110) -> VortexResult < Option < ArrayRef > > {
109111 let mut comparison = compare_dtp (
110112 lhs. days ( ) ,
111113 ts_parts. days ,
112114 CompareOperator :: NotEq ,
113115 nullability,
114116 ) ?;
115- if comparison. statistics ( ) . compute_min :: < bool > ( ) == Some ( true ) {
117+ if comparison. statistics ( ) . compute_min :: < bool > ( ctx ) == Some ( true ) {
116118 // All values are different.
117119 return Ok ( Some ( comparison) ) ;
118120 }
@@ -125,7 +127,7 @@ fn compare_ne(
125127 ) ?
126128 . binary ( comparison, Operator :: Or ) ?;
127129
128- if comparison. statistics ( ) . compute_min :: < bool > ( ) == Some ( true ) {
130+ if comparison. statistics ( ) . compute_min :: < bool > ( ctx ) == Some ( true ) {
129131 // All values are different.
130132 return Ok ( Some ( comparison) ) ;
131133 }
@@ -145,9 +147,10 @@ fn compare_lt(
145147 lhs : ArrayView < DateTimeParts > ,
146148 ts_parts : & timestamp:: TimestampParts ,
147149 nullability : Nullability ,
150+ ctx : & mut ExecutionCtx ,
148151) -> VortexResult < Option < ArrayRef > > {
149152 let days_lt = compare_dtp ( lhs. days ( ) , ts_parts. days , CompareOperator :: Lt , nullability) ?;
150- if days_lt. statistics ( ) . compute_min :: < bool > ( ) == Some ( true ) {
153+ if days_lt. statistics ( ) . compute_min :: < bool > ( ctx ) == Some ( true ) {
151154 // All values on the lhs are smaller.
152155 return Ok ( Some ( days_lt) ) ;
153156 }
@@ -159,9 +162,10 @@ fn compare_gt(
159162 lhs : ArrayView < DateTimeParts > ,
160163 ts_parts : & timestamp:: TimestampParts ,
161164 nullability : Nullability ,
165+ ctx : & mut ExecutionCtx ,
162166) -> VortexResult < Option < ArrayRef > > {
163167 let days_gt = compare_dtp ( lhs. days ( ) , ts_parts. days , CompareOperator :: Gt , nullability) ?;
164- if days_gt. statistics ( ) . compute_min :: < bool > ( ) == Some ( true ) {
168+ if days_gt. statistics ( ) . compute_min :: < bool > ( ctx ) == Some ( true ) {
165169 // All values on the lhs are larger.
166170 return Ok ( Some ( days_gt) ) ;
167171 }
0 commit comments