alamb opened a new issue, #12500:
URL: https://github.com/apache/datafusion/issues/12500

   ### Is your feature request related to a problem or challenge?
   
   Part of https://github.com/apache/datafusion/issues/11752
   
   While working on enabling StringView by default in  
https://github.com/apache/datafusion/pull/12092 I found another feature gap 
that occurs in the ClickBench benchmarks
   
   ClickBench `hits_partitioned` has a column that resolves to `Binary` 
(`BinaryView` after https://github.com/apache/datafusion/pull/12092) that is 
then treated as a String (compared to a string, etc). 
   
   In order for this to work, DataFusion needs to know it is ok to cast to 
String. It knows how to do this for `Binary` --> `Utf8` but not `BinaryView` 
--> `Utf8View`, etc. Without this running ClickBench on `hits_partitioned` does 
not work. 
   
   
   A small example is like 
   
   ```sql
   > create table foo as values (arrow_cast('one', 'BinaryView'), 
arrow_cast('two', 'BinaryView'));
   0 row(s) fetched.
   Elapsed 0.006 seconds.
   
   > select column1 like 'o%' from foo;
   type_coercion
   caused by
   Error during planning: There isn't a common type to coerce BinaryView and 
Utf8 in LIKE expression
   
   ```
   
   
   ### Describe the solution you'd like
   
   
   1. Add coercion rules for BinaryView --> Utf8/Utf8View
   2. Add a test
   
   ### Describe alternatives you've considered
   
   Fix the relevant code here: 
https://github.com/apache/datafusion/blob/a08f923c2acb1a46614970231d9a672c36ce3ad2/datafusion/expr-common/src/type_coercion/binary.rs#L1037-L1045
   
   (you can see what I had to do on 
https://github.com/apache/datafusion/pull/12092)
   
   Add a test in sqllogictest 
   * instructions here 
https://github.com/apache/datafusion/tree/main/datafusion/sqllogictest
   
   Perhaps in this file: 
https://github.com/apache/datafusion/blob/a08f923c2acb1a46614970231d9a672c36ce3ad2/datafusion/sqllogictest/test_files/binary.slt#L228-L233
   
   
   
   ### Additional context
   
   _No response_


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