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

This actually pretty tricky because you can add escape characters to %....