SPARK-1497. Fix scalastyle warnings in YARN, Hive code

(I wasn't sure how to automatically set `SPARK_YARN=true` and `SPARK_HIVE=true` when running scalastyle, but these are the errors that turn up.)