As per the diagram the Syntax check is done at the step 1 . unless the syntax is not right it wont proceed to the next step where an optimal query plan will be formulated.
Step 1: Syntax Check
Step 2 : Building a logical query plan ( post syntax check)
Step 3: Convert the logical query plan into a physical plan
Step 4 : Prepare a MapReduce Job from the Phyisical plan
Step 5: Launch the MapReduce Job to the cluster.