@Nikolay Chalkanov :
The error message indicates that the join hint is not associated with any join operator. This can happen if the hint is not placed correctly, or if there is no join operator in the query that can take advantage of the hint.
In the code you posted, it seems that you are using the merge method to perform the join operation. According to the Delta Lake documentation, the merge method does not support broadcast hints:
https://docs.delta.io/latest/delta-update.html#joins
Therefore, it is expected that the hint is being ignored.
The video you mentioned might be using a different method to perform the join operation, which supports broadcast hints. You could try using the join method instead of merge, and see if the broadcast hint is accepted:
target_tbl.alias("target")\
.join(stage_df.hint("broadcast").alias("source"), join_expr, "inner")\
.write.format("delta").mode("overwrite").save("output_delta")
Keep in mind that using broadcast hints can have performance implications, and it might not always be the best option depending on the size of your data and the resources available.