just use google-there are dozens of railway time planners, but as rian explains, your RENFE is always a notorious lax railway for this. Just try out a few. NOTE; for ALL very fast express trains, like AVE and TGV in France, you must also make REServations and these can cost a lot extra-in money and trouble on how to do it. I also very much doubt you can do ES-Hamburg in 1 day, so you may have to overnight somwhere-but there are a very few nighttrains too.
IF you want to be more certian and have the capacity to read complicated printed timetable: there is still a timetablebook with all EUR's main trains, 4 times/yr, it is named EUROPean Rail Timetable and cost about 20 gbp/25 eur-older ones, still good for general planning, cost less. You can order the new one on amazon or older ones via them=from UK, postage is extra and now maybe also import as UK is out of EU.
The best planner for international travel is the DB website or DB Navigator app. Be warned that the Interrail planner app does not get enough updates to be reliable. Also that Spanish railways keep their local and regional trains a secret so they are not included in any planner except for the Spanish ones.