i'm looking for sample working code snippet for lookup join of a stream with a hive table in flink. using 1.16 version. The flink documentation provides examples with creating a new hive table and a stream table backed by a kafka connector. https://nightlies.apache.org/flink/flink-docs-master/docs/connectors/table/hive/hive_read_write/#temporal-join-the-latest-table. My requirement is
I have a hive table existing in the database and queried the table as below. Table t1 = streamTableenvironment.sqlQuery(select * from lookuptable where col1 != col2 /*+ OPTIONS('streaming-source.enable'='false','streaming-source.partition.include'='all', 'lookup.join.cache.ttl'='12 h') */
kafka stream(loading it using kafkasource and converting to datastream and i need to apply some DataStream d1 = streamEnvironment.source(kafkasource)
Now i want to do left lookup join on d1 and t1 with t1 as lookup table.
can some one please help me by providing an working example i tried multiple things but getting temporal join not supported yet exception. However, i see in the documents the lookup join is implemented in flink for hive look up join
Below example shows the test case but created the tables from scratch and not sure whether it really works or not. https://github.com/apache/flink/blob/efba9a74146909786cf62da9904d77d890d82fe6/flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/connectors/hive/HiveLookupJoinITCase.java#L230
I think this is where the lookup join code is implemented https://github.com/apache/flink/blob/efba9a74146909786cf62da9904d77d890d82fe6/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveLookupTableSource.java#L226