Generally speaking, whales will not attack people on their own initiative. Because they live in the sea all the year round, they feed on fish, shrimp and other marine animals, and their diet is relatively fixed. They have the ability to recognize food, and humans are not in their diet, so they generally do not attack humans. However, there are two exceptions.
One is that humans take the initiative to attack them, and they will naturally fight back after being attacked. In the 19th and 20th centuries, when humans hunted gray whales in large numbers, many people died because of the counterattack of gray whales. The second situation is that captive whales, because the environment is too bad and long-term abuse, may become mentally abnormal, and then attack humans. A killer whale in the United States, named Tirikum, has been training and performing at a high level since its infancy. And will not get food because of punishment training. When he died at the age of 36, he had already carried three lives on his body.
Whales generally do not eat people, because human beings themselves are not their diet food. Whales are also more intelligent and have a better sense of what they eat. But there have been cases where people have been killed by whale attacks. There are two main situations, one is that captive whales may attack humans when they are abused for a long time. Second, when human beings kill whales and take the initiative to attack them, they will fight back. But in general, whales don't eat people, they just kill them.