[ 
https://issues.apache.org/jira/browse/FLINK-13503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jing Zhang updated FLINK-13503:
-------------------------------
    Description: 
The query template in `JdbcLookUpFunction` like:
SELECT c, d, e, f from T where a = ? and b = ?

If pass (null, 1) to `eval` method, it will generate the following query:
SELECT c, d, e, f from T where a = null and b = 1
Which always outputs empty records.
Is this behavior reasonable?

Besides, I think we should add contract in `LookupableTableSource` to specify 
expected behavior when the lookupKeys contains null value. Because there is 
ambiguity here:
  * to ignore null value, that is, in the above example, only looks `b = 1`
  * to lookup `is value`, that is, in the above example, only looks `a is null 
and b = 1`
  * to return empty records, that is, in the above example, only looks `a = 
null and b = 1`

  was:
The query template in `JdbcLookUpFunction` like:
SELECT c, d, e, f from T where a = ? and b = ?

If pass (null, 1) to `eval` method, it will generate the following query:
SELECT c, d, e, f from T where a = null and b = ?
Which always outputs empty records.
Is this behavior reasonable?



> Correct the behavior of `JDBCLookupFunction` when input data has null 
> ----------------------------------------------------------------------
>
>                 Key: FLINK-13503
>                 URL: https://issues.apache.org/jira/browse/FLINK-13503
>             Project: Flink
>          Issue Type: Task
>          Components: Connectors / JDBC
>    Affects Versions: 1.9.0, 1.10
>            Reporter: Jing Zhang
>            Priority: Minor
>
> The query template in `JdbcLookUpFunction` like:
> SELECT c, d, e, f from T where a = ? and b = ?
> If pass (null, 1) to `eval` method, it will generate the following query:
> SELECT c, d, e, f from T where a = null and b = 1
> Which always outputs empty records.
> Is this behavior reasonable?
> Besides, I think we should add contract in `LookupableTableSource` to specify 
> expected behavior when the lookupKeys contains null value. Because there is 
> ambiguity here:
>   * to ignore null value, that is, in the above example, only looks `b = 1`
>   * to lookup `is value`, that is, in the above example, only looks `a is 
> null and b = 1`
>   * to return empty records, that is, in the above example, only looks `a = 
> null and b = 1`



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to