NEW YORK (Reuters) - Major U.S. stock indexes ended little changed on Friday even as Amazon.com’s $13.7 billion deal to buy upscale grocer Whole Foods roiled the retail sector and rocked shares of an array of companies including Wal-Mart and Target.

Energy sector shares helped buoy the S&P 500 and the Dow industrials, while Apple dragged on the Nasdaq.

The deal by Amazon, a proven retail disruptor, marked a major step by the internet retailer into the brick-and-mortar retail sector.

Wal-Mart WMT.N shares sank 4.7 percent, weighing the most on the Dow. Shares of Target TGT.N, Walgreen Boots WBA.O and Costco COST.O fell between 5 percent and 7 percent.

“It’s going to send a shock wave across the board, and this represents the true utmost in market disruption,” said Burns McKinney, chief investment officer with the Dallas investment team for Allianz Global Investors. “There’s big winners and big losers.”

Amazon shares gained 2.4 percent, making the stock the biggest boost to the S&P 500. Whole Foods WFM.O shares surged 29.1 percent.

The S&P consumer staples sector .SPLRCS fell 1 percent, by far the worst performing major sector. The S&P 500 food and staples retailing index .SPLRCFD dropped 4.2 percent.

Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., June 2, 2017. REUTERS/Brendan McDermid

Grocery chain Kroger KR.N was the biggest loser on the S&P 500, falling 9.2 percent, while Supervalu SVU.N dropped 14.4 percent.

“I would not like to be somebody playing in the grocery space right now,” said Jan Rogers Kniffen, chief executive of retail consultancy firm J. Rogers Kniffen WWE in New York.

The Dow Jones Industrial Average .DJI rose 24.38 points, or 0.11 percent, to end at 21,384.28, the S&P 500 .SPX gained 0.69 point, or 0.03 percent, to 2,433.15 and the Nasdaq Composite .IXIC dropped 13.74 points, or 0.22 percent, to 6,151.76.

The technology sector .SPLRCT fell 0.2 percent, continuing its recent slump. Apple AAPL.O shares closed down 1.4 percent.

Tech has led the S&P 500’s 8.7 percent rally this year, but posted its second week of declines, prompting questions over whether investors are moving money into other sectors.

“I think we need to see more of a pullback to say there is a serious rotation going on as opposed to just some profits coming off the top,” said Chuck Carlson, chief executive officer at Horizon Investment Services in Hammond, Indiana.

Energy shares .SPNY rose 1.7 percent, propping up the S&P 500. Oil prices CLc1LCOc1 bounced off the year's lows as some producers reduced exports and U.S. rig additions slowed.

U.S. homebuilding fell for a third straight month in May to the lowest in eight months as construction activity declined broadly. Investors were continuing to digest the Federal Reserve’s interest rate hike on Wednesday, with some concerned about the economy’s ability to absorb higher rates.

In other corporate news, Booz Allen Hamilton BAH.N shares dropped 19 percent after news of a U.S. Department of Justice investigation.

Advancing issues outnumbered declining ones on the NYSE by a 1.36-to-1 ratio; on Nasdaq, a 1.22-to-1 ratio favored decliners.

About 9.7 billion shares changed hands in U.S. exchanges, well above the 6.8 billion daily average over the last 20 sessions.