[SPARK-2395][SQL] Optimize common LIKE patterns.

Yeah, this is a very cool optimization, and it's should support the escaping character of the user input, otherwise bug exists.