Applying An Enchanted Book With (For Ex.) Impaling 5, Looting 3, And Unbreaking 3 to a Diamond sword with (For Ex.) Sharpness 4, and Unbreaking 3, the diamond sword does not gain ANY of the enchantments from the book. I just lost a looting book on my survival world due to that 😞
I should also mention i got the book from fishing.