[SPARK-2862] Use shorthand range notation to avoid Scala bug

I should have the Scala bug raised today. Will update it once done.