That was almost certainly intentional, and, as such, it's pretty damnable. The Orioles broadcasters surmised that Machado was trying to helicopter his bat toward the mound, based on his lingering glare. Yet he missed. He could've hit an umpire or Alberto Callaspoat third, whirled the bat into the dugout or even into the stands. You can't do that. You can't do that because it's stupid and dangerous. It would seem that this needs to be explained to Mr. Machado.
Anyhow, benches and bullpens emptied, and Machado and Abad were tossed from the game. Beyond those formalities, here's hoping Macahdo gets himself a fairly lengthy "time out" from MLB for doing this. I think throwing at hitters for any reason other than reclaiming the inner part of the plate is also childish, but this is another level.
The best that can be said about Machado is that he's 21 years old but of late acting like someone 19 or so years younger.