The left table should be the bigger one and the right table the smaller one for broadcast join to be considered in spark. It is explained very nicely in this thread. Refer the top rated answer in the link below.
Broadcast join in spark not working for left outer