At least for spark-shell the Spark syntax needs this fixing. Without the parenthesis, the following command on page 421 of the book fails to generate proper Array[...] into the params Dataframe:
val params = new ParamGridBuilder() .addGrid(rForm.formula, Array( ...
SDG_ch24_MLlib_in_Action_fail.txt
SDG_ch24_MLlib_in_Action_fixed.txt