neilconway opened a new pull request, #20456:
URL: https://github.com/apache/datafusion/pull/20456

   ## Which issue does this PR close?
   
   - Closes #15161.
   
   ## Rationale for this change
   
   This PR and #20426 are two different approaches to fixing #15161. In this 
approach, we don't allow string to numeric coercion in comparison contexts at 
all. We then teach the type coercion analyzer to allow comparisons of that 
kind, as long as an integer column is being compared with a string literal 
(`int_col < '5'`) should be allowed. This means that `text_col = 5` and 
`int_col = text_col` are both rejected. Similarly, `int_col IN ('5')` and 
`int_col BETWEEN '5' and '10'` are allowed, while `text_col IN (5)` is rejected.
   
   We continue to allow flexible type widening for UNIONs, so `SELECT 1 UNION 
ALL SELECT 'hello'` continues to work (personally I think this is very dubious 
behavior; Postgres disallows it but DuckDB and ClickHouse allow it.) We also 
allow mixed types in `CASE` statements.
   
   ## What changes are included in this PR?
   
   ## Are these changes tested?
   
   ## Are there any user-facing changes?
   


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