Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-13503

Add contract in `LookupableTableSource` to specify the behavior when lookupKeys contains null

    XMLWordPrintableJSON

Details

    Description

      I think we should add contract in `LookupableTableSource` to specify expected behavior when the lookupKeys contains null value.
      For example, one input record of eval method is (null,1) which means to look up data in (a,b) columns which key satisfy the requirement. there are at least three possibility 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`

      In fact, there are different behavior in current code.
      For example, in Jdbc connector,
      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.
      BTW, Is this behavior reasonable?

      and the `InMemoryLookupableTableSource` behaviors like point 2 in the above list.
      some private connector in Blink behaviors like point 1

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jingzhang Jing Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m