A violent rotation is taking place under the hood of the stock market ahead of second-quarter earnings.