From the Super Mario Wiki
Water Shooters are devices that appear in Super Mario Galaxy, first appearing in Honeyhive Galaxy. It shoots water similarly to the Squirt Nozzle used by F.L.U.D.D. in Super Mario Sunshine, the only difference between the two nozzles being that Water Shooters are blue in color while F.L.U.D.D. is yellow and the water produced is in the form of a bubble, rather than a spray.
The Water Shooters also appear in the sequel, Super Mario Galaxy 2. Here, they appear in the Space Storm Galaxy's second mission, which is more or less based upon the Buoy Base Galaxy. They were in the first section with the fast-moving floor. They also shot bubbles faster than before, though they could be slowed down with a Ground Pound Switch. They also appear in Starshine Beach Galaxy and Honeyhop Galaxy.