A hose pipe would be connected to a bilge pump to allow sea water to be removed from the bilges of a ship and ejected into the sea. Since ships' hulls were (and still are) not water-tight, this had to be done regularly, and was an arduous task in the days of manual pumps.
Drunken sailors were sometimes hosed-down with bilge water as a form of punishment. The sailor would simply be placed, face up, by the scuppers (where the water would drain off the deck immediately) and given a thorough soaking. It was far less dangerous than keel-hauling and much less painful than flogging, although there was possibly a risk of drowning, either on the bilge water or the sailor's own vomit. Perhaps we should consider it to be an early form of waterboarding.
P.S. Since I can find no reference to the custom as a form of punishment, it may simply have been used as a way of bringing a sailor out of a drunken stupor. The real punishment (if any) would come later. On merchant ships, it would probably have been a fine.
Royal Navy & Marine Customs and Traditions
BBC: What did they do with the drunken sailor?