sdf-jkl commented on code in PR #18789:
URL: https://github.com/apache/datafusion/pull/18789#discussion_r2608338770


##########
datafusion/expr/src/udf.rs:
##########
@@ -696,6 +696,33 @@ pub trait ScalarUDFImpl: Debug + DynEq + DynHash + Send + 
Sync {
         Ok(ExprSimplifyResult::Original(args))
     }
 
+    /// Attempts to convert a literal value to in interval of the 
corresponding datatype
+    /// of a column expression so that a **preimage** can be computed for
+    /// pruning comparison predicates.
+    ///
+    /// This is used during predicate-pushdown optimization
+    /// (see 
`datafusion-optimizer-udf_preimage::preimage_in_comparison_for_binary`)
+    ///
+    /// Currently is only implemented by:
+    /// - `date_part(YEAR, expr)`
+    ///
+    /// # Arguments:
+    /// * `lit_value`:  The literal `&ScalarValue` used in comparison
+    /// * `target_type`: The datatype of the column expression inside the 
function
+    ///
+    /// # Returns
+    ///
+    /// Returns an `Interval` of the appropriate target type if a

Review Comment:
   It's great, thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to