Zackary Naas
02/01/2025, 3:39 PMleftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey]
For this application, I am executing the table creation sql statement for each of the tables, then building a table api pipeline for the joins and transformations. Finally, I am converting the final "Table" object into a datastream and sinking the data it into Iceberg.
This join is resulting in very bad performance, due to the lack of use of the defined unique keys ( primary keys ) on the underlying tables. I believe Flink should persist the unique keys constraints when doing this join and I am struggling to understand what may be going wrong here. Thanks in advance for any help, experience or feedback you can provide!!Pedro Mázala
02/03/2025, 8:46 AMZackary Naas
02/03/2025, 2:50 PMZackary Naas
02/03/2025, 5:45 PM[1]:TableSourceScan(table=[[default_catalog, default_database, txns]], fields=[amount, balance, id, created_at, ...])
+- [2]:Calc(select=[amount AS t$amount, balance AS t$balance, id AS t$id, created_at AS t$created_at, ...], where=[(type = 'ReceivableInvoice')])
Then, the join/calc operator looks like:
Join(joinType=[InnerJoin], where=[((td$txn_id = t$id) AND (td$kafka_key_customer = t$kafka_key_customer))], select=[t$amount, t$balance, t$id, t$created_at, td$balance, ...], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey])
+- [8]:Calc(select=[t$amount, t$balance, t$bank_account_id, t$id, t$created_at, td$balance, ...])Pedro Mázala
02/04/2025, 8:30 AMZackary Naas
02/05/2025, 2:18 AMleftInputSpec and rightInputSpec to respect the primary key definitions on the initial join of the two kafka tables, the result is essentially a new table that doesn't have any primary key defined. I understand that it wouldn't make sense for the system to assign a PK automatically in this case.
What I need help with now is how in the world can I add a PK to that 'Table' object, leveraging the Table API, before I continue and join that Table object to the next kafka table?
I've been digging into the documentation, issues, everywhere and I can't figure out how one would accomplish this, or even if it is accomplishable. 😓