etseidl commented on code in PR #15764: URL: https://github.com/apache/datafusion/pull/15764#discussion_r2051538025
########## datafusion/physical-optimizer/src/pruning.rs: ########## @@ -1215,8 +1215,33 @@ fn is_compare_op(op: Operator) -> bool { // For example, casts from string to numbers is not correct. // Because the "13" is less than "3" with UTF8 comparison order. fn verify_support_type_for_prune(from_type: &DataType, to_type: &DataType) -> Result<()> { - // TODO: support other data type for prunable cast or try cast - if matches!( + // Dictionary casts are always supported as long as the value types are supported Review Comment: I think the big issue is when comparing string to numeric (both sides will be coerced to string IIUC). Rather than a whitelist here, maybe instead disallow casts we know will fail, so this could maybe just return false if the LHS is numeric and the rhs is string. -- 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...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org