The word "whale riding" is common in elegiac couplets. Where did it come from? What is the reason?

Riding a whale has two meanings, one is riding a big fish (whale) to live in seclusion or become immortal, which comes from Selected Works of Yang Xiong: "Riding a giant scale and riding a Beijing fish". Second, Du Fu's allusion to the legend that Li Bai drowned by riding a whale drunk. The elegiac couplet mostly uses the first meaning, which is the same as the saying of driving the crane to die in the west. They are all obscure expressions of death, which are generally used by people with long life and high respect. People like me are definitely not for me.