@hequn8128 I'm pretty sure that what you have just pointed out is bug in Flink 
SQL. I'm not 100% sure (maybe 95%), but when comparing different types like 
`CHAR(3)` with `CHAR(5)` or `VARCHAR(2)`, all of the operands should be first 
converted to same type (adding/ignoring padding when necessary) and only then 
compared.

In other words `'A  ' == 'A'` should return true, and this PR is not a proper 
fix to this problem. It doesn't fix for example:

```
SELECT * FROM country WHERE country_name = 'GERMANY  '
```

This further convinces me that:
> and our CHAR(x) support seems to be broken (for example 'A ' || 'B ' should 
> return 'A B ')

Probably either we should convert string literals to `VARCHAR` or properly 
implement support for `CHAR`

[ Full content available at: https://github.com/apache/flink/pull/6519 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to