Caleb Ewan won Stage 2 of the UAE Tour in a sprint finish to move to the top of the GC classification.