Spark algorithm to make a link analysis
This sounds like a classic frequent pattern mining problem, where you're trying to find sets of items that are frequently found together within users' sets of purchases.

Start here: https://spark.apache.org/docs/latest/mllib-frequent-pattern-mining.html