jayzhan211 commented on issue #9098:
URL: 
https://github.com/apache/arrow-datafusion/issues/9098#issuecomment-1922745922

   While I tried out, I failed in one of the query in `joins.slt`
   ```
   query TIR
   select col1, col2, coalesce(sum_col3, 0) as sum_col3
   from (select distinct col2 from tbl) AS q1
   cross join (select distinct col1 from tbl) AS q2
   left outer join (SELECT col1, col2, sum(col3) as sum_col3 FROM tbl GROUP BY 
col1, col2) AS q3
   USING(col2, col1)
   ORDER BY col1, col2
   ```
   
   which the error is that 
   ```
   External error: query failed: DataFusion error: Error during planning: No 
function matches the given name and argument types 'coalesce(UInt64, Int64)'. 
You might need to add explicit type casts.
        Candidate functions:
        coalesce(CoercibleT, .., CoercibleT)
   ```
   
   This error occurs because when we have type i64 and u64 in 
`comparison_coercion`, it returns i64. But `coerced_from` fails to convert u64 
to i64.
   
   We can get the same error with `select make_array(1, arrow_cast(2, 
'UInt64'));`, which has the signature VariadicEqual.
   
   One solution is that we introduce i128 like duckdb, then we can convert both 
u64 and i64 to i128.
   The other solution is that we coerced the value to either f64 or i64 or u64 
that may lost value but most of the cases are fine. 


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