liukun4515 commented on code in PR #2834:
URL: https://github.com/apache/arrow-datafusion/pull/2834#discussion_r915391620


##########
datafusion/physical-expr/src/expressions/in_list.rs:
##########
@@ -270,37 +270,27 @@ fn not_in_list_utf8<OffsetSize: OffsetSizeTrait>(
 }
 
 //check all filter values of In clause are static.
-//include `CastExpr + Literal` or `Literal`
-fn check_all_static_filter_expr(list: &[Arc<dyn PhysicalExpr>]) -> bool {
-    list.iter().all(|v| {
-        let cast = v.as_any().downcast_ref::<expressions::CastExpr>();
-        if let Some(c) = cast {
-            c.expr()
-                .as_any()
-                .downcast_ref::<expressions::Literal>()
-                .is_some()
-        } else {
-            let cast = v.as_any().downcast_ref::<expressions::Literal>();
-            cast.is_some()
-        }
+//include `TryCastExpr/CastExpr + Literal` or `Literal`
+fn check_all_static_filter_expr(list: &[Arc<dyn PhysicalExpr>], schema: 
&Schema) -> bool {
+    let batch = RecordBatch::new_empty(Arc::new(schema.to_owned()));

Review Comment:
   I add a new function `try_cast_static_filter_to_set` to replace these two 
function in the InLIst.
   



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to