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

nit: A