alamb commented on a change in pull request #1606:
URL: https://github.com/apache/arrow-datafusion/pull/1606#discussion_r786861936



##########
File path: datafusion/src/physical_plan/expressions/coercion.rs
##########
@@ -147,6 +147,10 @@ pub fn temporal_coercion(lhs_type: &DataType, rhs_type: 
&DataType) -> Option<Dat
     }
 }
 
+pub(crate) fn is_dictionary(t: &DataType) -> bool {

Review comment:
       The duplication of code between this module and `binary_rule.rs` is not 
good -- I am going to try and consolidate it  as a follow on PR cc @liukun4515 

##########
File path: datafusion/src/physical_plan/coercion_rule/binary_rule.rs
##########
@@ -77,7 +77,7 @@ pub(crate) fn coerce_types(
 }
 
 fn comparison_eq_coercion(lhs_type: &DataType, rhs_type: &DataType) -> 
Option<DataType> {
-    if lhs_type == rhs_type {
+    if lhs_type == rhs_type && !is_dictionary(lhs_type) {

Review comment:
       the arrow `eq` kernels don't support `DictionaryArray` <==> 
`DictionaryArray` comparisons yet, so we need to handle this case specially. I 
will also file a ticket to add native DictionaryArray comparison support. 




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


Reply via email to