Hello! Welcome to the forum!
I think you have a yucca plant there, not a pineapple!
If you have the right type of pollinator (Yucca moths), the flowers make a fruit that is edible. The Yucca root is not the same as the yuca (cassava) root. The cassava roots are edible, but I'm not sure if the Yucca roots are edible...
They're pretty popular for landscaping around here!
Good luck with your plants!
Lindsay