Hello Experts, I have two streams and joining them...
# troubleshooting
s
Hello Experts, I have two streams and joining them with a column, lets say
code
from the second stream to get the
code description
. I need to maintain the state so I'm using Table API with regular joins. I have millions of records of the same
code
in first stream because of this during join all data is landing on one KPU/taskmanager, though application is running with 60 KPUs making other 59 KPUs idle. Is there any way to distribute the data across the KPUs evenly in case of same
code
. I tried with broadcast also but got into issues where any update on broadcast stream for
code description
or
code
itself, I need to scan millions of records to update them using
applyToKeyedState
. Please give your inputs if there is any way to distribute the data evenly in this case. I am stuck here from the last one week and unable to figure out how to distribute the data across all KPUs.
k
s
Thank you @Kirill Ternovsky , no I didn't try this. We are using aws kda to deploy our application, may be using some default value. Let me configure this setting and give it a try.
k
👍 good luck! Will be good to see how to take advantage of all provisioned KPUs.
s
I tried by setting table.exec.resource.default-parallelism, but getting same issue
Copy code
EnvironmentSettings tableSettings = EnvironmentSettings
	   		     .newInstance()
	   		     .useBlinkPlanner()
	   		     .build();
		StreamTableEnvironment tableEnvironment = StreamTableEnvironment.create(env,tableSettings);
		Configuration config=tableEnvironment.getConfig().getConfiguration();
		config.setInteger("table.exec.resource.default-parallelism",32);
		return tableEnvironment;
Complete load going on one subtask
k
And your taskmanager has 32 slots?
s
yes
k
If your
taskmanager.numberOfTaskSlots
is 32 and you've got the table parallelism set to 32, I'm out of ideas. Maybe something in your join operation that prevents the task from being split? https://stackoverflow.com/questions/73063272/how-does-parallelism-works-when-using-flink-sql
s
Based on above link
Flink redistributes the data across the parallel instances based on the join key
My join key is code column on second stream and my most of the data in firststream has same code which is around 138 million, something like below
Copy code
select * from firststream left join secondstream firststream.code=secondstream.code
Is this the reason it is going on one node.
Thank you @Kirill Ternovsky I will check with AWS KDA team also in case they have any idea, may be something with AWS KDA library.