buraksenn commented on code in PR #21402:
URL: https://github.com/apache/datafusion/pull/21402#discussion_r3167818400


##########
datafusion/physical-expr/src/expressions/in_list.rs:
##########
@@ -642,20 +659,34 @@ impl InListExpr {
 
     /// Create a new InList expression directly from an array, bypassing 
expression evaluation.
     ///
-    /// This is more efficient than `in_list()` when you already have the list 
as an array,
-    /// as it avoids the conversion: `ArrayRef -> Vec<PhysicalExpr> -> 
ArrayRef -> StaticFilter`.
-    /// Instead it goes directly: `ArrayRef -> StaticFilter`.
+    /// This is more efficient than [`InListExpr::try_new`] when you already 
have the list
+    /// as an array, as it builds the static filter directly from the array 
instead of
+    /// reconstructing an intermediate array from literal expressions.
+    ///
+    /// The `list` field is populated with literal expressions extracted from
+    /// the array, and the array is used to build a static filter for
+    /// efficient set membership evaluation.
     ///
-    /// The `list` field will be empty when using this constructor, as the 
array is stored
-    /// directly in the static filter.
+    /// The `array` may be dictionary-encoded — it will be flattened to its
+    /// value type such that specialized filters are used.
     ///
-    /// This does not make the expression any more performant at runtime, but 
it does make it slightly
-    /// cheaper to build.
+    /// Returns an error if the expression's data type and the array's data 
type
+    /// are not logically equal. Null arrays are always accepted.
     pub fn try_new_from_array(

Review Comment:
   I was thinking since it was only a if check with null and single line there 
is no need but as you've said it will help to prevent drift and centralize 
check. Extracting helper



-- 
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