Pineapple contains an enzyme called bromelain, which reacts with dairy products and makes the yogurt bitter. If you add pineapple directly to yogurt, your raita can turn bitter in a few minutes. This can be avoided by cooking the pineapple; my recipe exactly does that. Canned pineapple also doesn't turn bitter as it is cooked before canning, but I really do not encourage the use of canned pineapple. Their taste is very different from the fresh ones, and that can result in very unappetizing raita.