Still working on my trip. Do I need go through Madrid if we want to travel by train from Granada to Barcelona?
The fastest route is definitely through Madrid. That's the way express rail line runs. Some folks opt to fly, possibly as much because the train departures are infrequent as because the train trip takes between 7 and 9 hours.
You can check the schedules on https://www.renfe.com/es/en. To see the route a particular train takes, click on one of the fare boxes then on Journey details. If a transfer is involved, it will be clear from the way the stops are displayed, and there will also be separate numbers shown for each train. You'll be able to see how long your layover is.
I'd fly Vueling which has 4 direct 1 hour 30 minute flights a day and depending on when you buy tickets could come out cheaper than the train.
Also you won't have to factor in food and drink on such short flight compared to the train.
The current fastest connection takes around 6:20. Although it might be a bit faster in a few years when the Murcia–Almería high-speed rail line opens.