Lewis Hamilton smashed the Shanghai circuit lap record on his way to a stunning first sprint race pole for Ferrari in China on Friday.