Interface LookupTableSource.LookupContext

All Superinterfaces:
DynamicTableSource.Context
Enclosing interface:
LookupTableSource

@PublicEvolving public static interface LookupTableSource.LookupContext extends DynamicTableSource.Context
Context for creating runtime implementation via a LookupTableSource.LookupRuntimeProvider.

It offers utilities by the planner for creating runtime implementation with minimal dependencies to internal data structures.

Methods should be called in LookupTableSource.getLookupRuntimeProvider(LookupContext). Returned instances that are Serializable can be directly passed into the runtime implementation class.

  • Method Details

    • getKeys

      int[][] getKeys()
      Returns an array of key index paths that should be used during the lookup. The indices are 0-based and support composite keys within (possibly nested) structures.

      For example, given a table with data type ROW < i INT, s STRING, r ROW < i2 INT, s2 STRING > >, this method would return [[0], [2, 1]] when i and s2 are used for performing a lookup.

      Returns:
      array of key index paths
    • preferCustomShuffle

      boolean preferCustomShuffle()
      Whether the distribution of the input stream data matches the partitioner provided by the LookupTableSource. If the interface SupportsLookupCustomShuffle is not implemented, false is guaranteed to be returned.

      The method LookupTableSource.getLookupRuntimeProvider(org.apache.flink.table.connector.source.LookupTableSource.LookupContext) will be called first, then the framework will set up the custom shuffle based on the result returned by SupportsLookupCustomShuffle.getPartitioner().

      Returns:
      true if planner is ready to apply the custom partitioner provided by the source, otherwise returns false