is the resistor like a narrow tube between two large tubes limiting the water flow (no wasted energy).
Yes, there is wasted energy. If there was no wasted energy then we could make all water pipes as small as we like. But we don't. For big water flows we have big pipes, and for small water flows we have smaller pipes. The size of the pipe is designed to minimize wasted energy while keeping the size and cost of the pipe within reasonable constraints.
This is just like choosing the right size of wire for the desired current. We use bigger wires for higher currents, but we don't use unreasonably thick wires because that would be too expensive and the wires would be too difficult to install.
As with all analogies, the water analogy might struggle a bit here.
Actually, it's pretty good.
Humm.... but what is the mechanism in the fluid that converts the power supplied by the pump into heat?
Let's look at this more closely.
There are two quantities that can affect the capability of flowing water to do work. One is the flow rate, and the other is the pressure. These are directly analogous to current and voltage.
When water flows through a constriction in a pipe and out the other side, the flow rate is indeed unchanged. However, the water loses pressure on the other side of the restriction, and the mechanical work done by the pump is turned into heat. The amount of work turned into heat (the power dissipated) is precisely proportional to the pressure loss times the flow rate (like voltage drop times current in a resistor).
Here's how this happens. When the water enters the narrow section of pipe, it has to speed up to get through the smaller area for flow. In speeding up, it gains kinetic energy at the cost of pressure energy. So in the narrow section the pressure goes down (this is Bernoulli's principle). Now, when the water comes out of the narrow section and back into the original larger pipe, then indeed the flowing velocity returns to what it was. However, it may not get back to the original pressure. The fast flowing water when it leaves the narrow section and enters the larger pipe will suffer a lot of turbulence and this causes the kinetic energy of the water to be dissipated and not fully recovered.
If the pipe is arranged to have a gradual narrowing and a gradual expansion without any sharp changes then the energy lost to turbulence can be reduced. However, the fast flowing water in the narrow section will still have a lot of friction with the pipe walls, and this will still turn pressure energy into heat. So whatever you do, friction in pipes will always cause energy to be dissipated as heat, just like resistance in wires.